anv: ignore pColorBlendState if all color attachments of the subpass are unused
authorSamuel Iglesias Gonsálvez <siglesias@igalia.com>
Mon, 7 May 2018 06:42:56 +0000 (08:42 +0200)
committerSamuel Iglesias Gonsálvez <siglesias@igalia.com>
Wed, 9 May 2018 05:01:10 +0000 (07:01 +0200)
commit2cf64fdb4623cb145e51f615cf0baf85de23234d
tree2c8275db981e45532739628b38cb7636999e130e
parente7a7b712fe81aac96eaae267ad6cb5444f02e7f6
anv: ignore pColorBlendState if all color attachments of the subpass are unused

According to Vulkan spec:

  "pColorBlendState is a pointer to an instance of the
   VkPipelineColorBlendStateCreateInfo structure, and is ignored 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."

Fixes tests from CL#2505:

   dEQP-VK.renderpass.*.simple.color_unused_omit_blend_state

v2:
- Check that blend is not NULL before usage.

Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/intel/vulkan/anv_pipeline.c
src/intel/vulkan/genX_pipeline.c