mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-27 21:20:12 +01:00
anv/genX: Solve the vkCreateGraphicsPipelines crash
The crash is due to NULL pColorBlendState, which is legal if the pipeline has rasterization disabled or if the subpass of the render pass the pipeline is created against does not use any color attachments. Test: Sample subpasses from LunarG can run without crash Signed-off-by: Xu,Randy <randy.xu@intel.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Cc: "17.0 13.0" <mesa-stable@lists.freedesktop.org>
This commit is contained in:
parent
e70e7cc7ff
commit
57595cb073
1 changed files with 2 additions and 2 deletions
|
|
@ -902,7 +902,7 @@ emit_cb_state(struct anv_pipeline *pipeline,
|
|||
/* We can have at most 8 attachments */
|
||||
assert(i < 8);
|
||||
|
||||
if (binding->index >= info->attachmentCount)
|
||||
if (info == NULL || binding->index >= info->attachmentCount)
|
||||
continue;
|
||||
|
||||
assert(binding->binding == 0);
|
||||
|
|
@ -1423,7 +1423,7 @@ emit_3dstate_ps(struct anv_pipeline *pipeline,
|
|||
* source blend factors.
|
||||
*/
|
||||
bool dual_src_blend = false;
|
||||
if (wm_prog_data->dual_src_blend) {
|
||||
if (wm_prog_data->dual_src_blend && blend) {
|
||||
for (uint32_t i = 0; i < blend->attachmentCount; i++) {
|
||||
const VkPipelineColorBlendAttachmentState *bstate =
|
||||
&blend->pAttachments[i];
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue