turnip: fix incorrectly failing assert
authorJonathan Marek <jonathan@marek.ca>
Fri, 6 Dec 2019 01:58:58 +0000 (20:58 -0500)
committerJonathan Marek <jonathan@marek.ca>
Fri, 13 Dec 2019 01:33:16 +0000 (20:33 -0500)
pColorBlendState is allowed to be NULL if subpass has >0 color attachments
but they are all unused.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/freedreno/vulkan/tu_pipeline.c

index 8be68ab26651458ccd1a31428602d84f2c8fd6a2..3a17cc76494bf9f972fcffa931712b49a5a0695f 100644 (file)
@@ -1934,6 +1934,7 @@ tu_pipeline_builder_init_graphics(
          subpass->depth_stencil_attachment.attachment != VK_ATTACHMENT_UNUSED;
 
       assert(subpass->color_count == 0 ||
+             !create_info->pColorBlendState ||
              subpass->color_count == create_info->pColorBlendState->attachmentCount);
       builder->color_attachment_count = subpass->color_count;
       for (uint32_t i = 0; i < subpass->color_count; i++) {