diff options
author | Jason Ekstrand <jason.ekstrand@collabora.com> | 2022-02-16 14:51:21 -0600 |
---|---|---|
committer | Dylan Baker <dylan.c.baker@intel.com> | 2022-02-24 14:56:51 -0800 |
commit | 4aa73d53108d1c2ce4e993cd515c461def2270c5 (patch) | |
tree | cac33c160c75b4a8065eb85d901f5ff71589c0f0 | |
parent | 1d25a226fa9adf73655fe4c8e4f3a4cf3e7c331c (diff) |
anv: Don't assume depth/stencil attachments have depth
If a secondary command buffer is used and the client provides a
framebuffer and that framebuffer has a stencil-only attchment, we would
try to get the aux usage for the depth component of that attachment and
crash. Check the aspects of the image before looking at aux usage.
This fixes at least the following SkQP tests on my Tigerlake:
- vk_circular-clips
- vk_filterfastbounds
- vk_innershapes_bw
- vk_lineclosepath
- vk_multipicturedraw_rrectclip_simple
- vk_pathinvfill
- vk_quadclosepath
- vk_rrect_clip_bw
- vk_windowrectangles
Fixes: 0d8b9c529ce3 ("anv: Allow PMA optimization to be enabled in secondary command buffers")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Tested-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15048>
(cherry picked from commit df0e2a1565587cec47a8074f0d4a597e21e99783)
-rw-r--r-- | .pick_status.json | 2 | ||||
-rw-r--r-- | src/intel/vulkan/genX_cmd_buffer.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/.pick_status.json b/.pick_status.json index eb0b8c819ea..abac5691959 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -2011,7 +2011,7 @@ "description": "anv: Don't assume depth/stencil attachments have depth", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "0d8b9c529ce34347032912d73c14c245919a3d37" }, diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c index a042e913d02..a59b075cfca 100644 --- a/src/intel/vulkan/genX_cmd_buffer.c +++ b/src/intel/vulkan/genX_cmd_buffer.c @@ -1873,7 +1873,7 @@ genX(BeginCommandBuffer)( const struct anv_image_view * const iview = anv_cmd_buffer_get_depth_stencil_view(cmd_buffer); - if (iview) { + if (iview && (iview->image->vk.aspects & VK_IMAGE_ASPECT_DEPTH_BIT)) { VkImageLayout layout = cmd_buffer->state.subpass->depth_stencil_attachment->layout; |