Skip to content
Snippets Groups Projects
Commit c8949e24 authored by Faith Ekstrand's avatar Faith Ekstrand :speech_balloon:
Browse files

anv/pipeline: Don't look at blend state unless we have an attachment


Without this, we may end up dereferencing blend before we check for
binding->index != UINT32_MAX.  However, Vulkan allows the blend state to
be NULL so long as you don't have any color attachments.  This fixes a
segfault when running The Talos Principal.

Fixes: 12f4e00b
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: default avatarAlex Smith <asmith@feralinteractive.com>
Reviewed-by: default avatarLionel Landwerlin <lionel.g.landwerlin@intel.com>
parent 8116b917
No related branches found
No related tags found
No related merge requests found
......@@ -1351,10 +1351,10 @@ has_color_buffer_write_enabled(const struct anv_pipeline *pipeline,
if (binding->set != ANV_DESCRIPTOR_SET_COLOR_ATTACHMENTS)
continue;
const VkPipelineColorBlendAttachmentState *a =
&blend->pAttachments[binding->index];
if (binding->index == UINT32_MAX)
continue;
if (binding->index != UINT32_MAX && a->colorWriteMask != 0)
if (blend->pAttachments[binding->index].colorWriteMask != 0)
return true;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment