v3dv: don't assume that bound descriptors have been written

The pipeline layout lifetime tests in CTS allocate some descriptors
and bind them to the command buffer without actually ever writing
valid resources to them since they never actually execute the command
buffers, so we want to be careful at bind time and not assume the
resources exist.

Fixes crashes in dEQP-VK.api.pipeline.pipeline_layout.lifetime.*

Fixes: 95f881adbd ('v3dv: add support for sampling simple 2D linear textures')
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25172>
This commit is contained in:
Iago Toral Quiroga
2023-09-12 10:09:12 +02:00
committed by Marge Bot
parent 9d2bad8b37
commit 64b49fb501

View File

@@ -3442,6 +3442,9 @@ handle_sample_from_linear_image(struct v3dv_cmd_buffer *cmd_buffer,
continue;
struct v3dv_descriptor *desc = &set->descriptors[blayout->descriptor_index];
if (!desc->image_view)
continue;
struct v3dv_image *image = (struct v3dv_image *) desc->image_view->vk.image;
struct v3dv_image_view *view = (struct v3dv_image_view *) desc->image_view;
if (image->tiled || view->vk.view_type == VK_IMAGE_VIEW_TYPE_1D)