From 64b49fb501e960f0ddeeb9e9bce459d645f6923d Mon Sep 17 00:00:00 2001 From: Iago Toral Quiroga Date: Tue, 12 Sep 2023 10:09:12 +0200 Subject: [PATCH] v3dv: don't assume that bound descriptors have been written MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Part-of: --- src/broadcom/vulkan/v3dv_cmd_buffer.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/broadcom/vulkan/v3dv_cmd_buffer.c b/src/broadcom/vulkan/v3dv_cmd_buffer.c index a8349de..d43ca16 100644 --- a/src/broadcom/vulkan/v3dv_cmd_buffer.c +++ b/src/broadcom/vulkan/v3dv_cmd_buffer.c @@ -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) -- 2.7.4