diff --git a/.pick_status.json b/.pick_status.json index d0983c4135d..d8948c0c2c0 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -4576,7 +4576,7 @@ "description": "lavapipe: fix 3d depth stencil image clearing.", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null }, diff --git a/src/gallium/frontends/lavapipe/lvp_execute.c b/src/gallium/frontends/lavapipe/lvp_execute.c index 1602e577a8c..90deaca5762 100644 --- a/src/gallium/frontends/lavapipe/lvp_execute.c +++ b/src/gallium/frontends/lavapipe/lvp_execute.c @@ -3095,15 +3095,20 @@ static void handle_clear_ds_image(struct vk_cmd_queue_entry *cmd, uint32_t level_count = vk_image_subresource_level_count(&image->vk, range); for (unsigned j = 0; j < level_count; j++) { struct pipe_surface *surf; - unsigned width, height; - + unsigned width, height, depth; width = u_minify(image->bo->width0, range->baseMipLevel + j); height = u_minify(image->bo->height0, range->baseMipLevel + j); + if (image->bo->target == PIPE_TEXTURE_3D) + depth = u_minify(image->bo->depth0, range->baseMipLevel + j); + else { + depth = vk_image_subresource_layer_count(&image->vk, range); + } + surf = create_img_surface_bo(state, range, image->bo, image->bo->format, width, height, - 0, vk_image_subresource_layer_count(&image->vk, range) - 1, j); + 0, depth - 1, j); state->pctx->clear_depth_stencil(state->pctx, surf,