<div dir="ltr"><div>Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>><br><br></div>Have you audited to ensure that we don't actually use it in this case?<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, May 7, 2018 at 1:01 AM, Samuel Iglesias Gonsálvez <span dir="ltr"><<a href="mailto:siglesias@igalia.com" target="_blank">siglesias@igalia.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">According to Vulkan spec:<br>
<br>
  "pColorBlendState is a pointer to an instance of the<br>
   VkPipelineColorBlendStateCreat<wbr>eInfo structure, and is ignored if the<br>
   pipeline has rasterization disabled or if the subpass of the render pass the<br>
   pipeline is created against does not use any color attachments."<br>
<br>
Fixes tests from CL#2505:<br>
<br>
   dEQP-VK.renderpass.*.simple.<wbr>color_unused_omit_blend_state<br>
<br>
Signed-off-by: Samuel Iglesias Gonsálvez <<a href="mailto:siglesias@igalia.com">siglesias@igalia.com</a>><br>
---<br>
 src/intel/vulkan/anv_pipeline.<wbr>c | 14 ++++++++++++--<br>
 1 file changed, 12 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/src/intel/vulkan/anv_<wbr>pipeline.c b/src/intel/vulkan/anv_<wbr>pipeline.c<br>
index 87788de10a5..8f30136b100 100644<br>
--- a/src/intel/vulkan/anv_<wbr>pipeline.c<br>
+++ b/src/intel/vulkan/anv_<wbr>pipeline.c<br>
@@ -1247,8 +1247,18 @@ anv_pipeline_validate_create_<wbr>info(const VkGraphicsPipelineCreateInfo *info)<br>
       if (subpass && subpass->depth_stencil_<wbr>attachment.attachment != VK_ATTACHMENT_UNUSED)<br>
          assert(info-><wbr>pDepthStencilState);<br>
<br>
-      if (subpass && subpass->color_count > 0)<br>
-         assert(info->pColorBlendState)<wbr>;<br>
+      if (subpass && subpass->color_count > 0) {<br>
+         bool all_color_unused = true;<br>
+         for (int i = 0; i < subpass->color_count; i++) {<br>
+            if (subpass->color_attachments[i]<wbr>.attachment != VK_ATTACHMENT_UNUSED)<br>
+               all_color_unused = false;<br>
+         }<br>
+         /* pColorBlendState is ignored if the pipeline has rasterization<br>
+          * disabled or if the subpass of the render pass the pipeline is<br>
+          * created against does not use any color attachments.<br>
+          */<br>
+         assert(info->pColorBlendState || all_color_unused);<br>
+      }<br>
    }<br>
<br>
    for (uint32_t i = 0; i < info->stageCount; ++i) {<br>
<span class="HOEnZb"><font color="#888888">-- <br>
2.17.0<br>
<br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div>