[Mesa-stable] [Mesa-dev] [PATCH] radv: fix crash in vkCmdClearAttachments with unused attachment

Bas Nieuwenhuizen bas at basnieuwenhuizen.nl
Mon Jul 22 12:07:03 UTC 2019


r-b

On Mon, Jul 22, 2019 at 10:09 AM Samuel Pitoiset
<samuel.pitoiset at gmail.com> wrote:
>
> depth_stencil_attachment and/or ds_resolve attachment can be NULL.
>
> This fixes crashes with
> dEQP-VK.renderpass.suballocation.unused_clear_attachments.*
>
> Cc: 19.1 <mesa-stable at lists.freedesktop.org>
> Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
> ---
>  src/amd/vulkan/radv_meta_clear.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/amd/vulkan/radv_meta_clear.c b/src/amd/vulkan/radv_meta_clear.c
> index dd2ba402f40..b93ba3e0b29 100644
> --- a/src/amd/vulkan/radv_meta_clear.c
> +++ b/src/amd/vulkan/radv_meta_clear.c
> @@ -1688,7 +1688,7 @@ emit_clear(struct radv_cmd_buffer *cmd_buffer,
>                 if (ds_resolve_clear)
>                         ds_att = subpass->ds_resolve_attachment;
>
> -               if (ds_att->attachment == VK_ATTACHMENT_UNUSED)
> +               if (!ds_att || ds_att->attachment == VK_ATTACHMENT_UNUSED)
>                         return;
>
>                 VkImageLayout image_layout = ds_att->layout;
> --
> 2.22.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-stable mailing list