lavapipe: fix 3d depth stencil image clearing.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18665>
(cherry picked from commit 9452e5e03a)
This commit is contained in:
Dave Airlie
2022-09-19 16:33:59 +10:00
committed by Dylan Baker
parent 6393e4b32c
commit 548b18003a
2 changed files with 9 additions and 4 deletions

View File

@@ -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
},

View File

@@ -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,