pvr: Fix segfaults when pDepthStencilAttachment is NULL
authorJarred Davies <jarred.davies@imgtec.com>
Tue, 31 Jan 2023 19:24:30 +0000 (19:24 +0000)
committerMarge Bot <emma+marge@anholt.net>
Tue, 14 Mar 2023 19:27:27 +0000 (19:27 +0000)
commit1115a2902593e8fc379a4781aebde54cf32e1bd5
treea48c1d44658b1dee583f43448b55b81cd36e32ff
parent7176e0c1602d74df30ff070035c536e151be9605
pvr: Fix segfaults when pDepthStencilAttachment is NULL

depth_stencil_attachment has been changed from a pointer to the attachment idx
to just the attachment idx, as this avoids the driver having to check for NULL
when comparing attachments indexes with depth_stencil_attachment.

Anyplace that relies on depth_stencil_attachment being a valid index must
already check that depth_stencil_attachment is not VK_ATTACHMENT_UNUSED, so
this change avoids having to check both the pointer and the index for the same
information.

Noticed when running dEQP-VK.api.smoke.triangle

Signed-off-by: Jarred Davies <jarred.davies@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21690>
src/imagination/vulkan/pvr_cmd_buffer.c
src/imagination/vulkan/pvr_hw_pass.c
src/imagination/vulkan/pvr_pass.c
src/imagination/vulkan/pvr_pipeline.c
src/imagination/vulkan/pvr_private.h