<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
On 07/05/18 16:46, Jason Ekstrand wrote:<br>
<blockquote type="cite"
cite="mid:CAOFGe94WjXG9P-5WWnAXmArAKoZyCTYLPxGUhKA4ch4BhFFVHQ@mail.gmail.com">
<div dir="ltr">
<div>Reviewed-by: Jason Ekstrand <<a
href="mailto:jason@jlekstrand.net" moz-do-not-send="true">jason@jlekstrand.net</a>><br>
<br>
</div>
</div>
</blockquote>
<br>
Thanks.<br>
<br>
<blockquote type="cite"
cite="mid:CAOFGe94WjXG9P-5WWnAXmArAKoZyCTYLPxGUhKA4ch4BhFFVHQ@mail.gmail.com">
<div dir="ltr">Have you audited to ensure that we don't actually
use it in this case?<br>
</div>
</blockquote>
<br>
I checked its usage in the driver. There is no problem except in one
call to has_color_buffer_write_enable() that could be problematic.
If you agree, I will add this hunk to this patch to avoid any
problem:<br>
<br>
diff --git a/src/intel/vulkan/genX_pipeline.c
b/src/intel/vulkan/genX_pipeline.c<br>
index d3af9304ba3..6016d257584 100644<br>
--- a/src/intel/vulkan/genX_pipeline.c<br>
+++ b/src/intel/vulkan/genX_pipeline.c<br>
@@ -1361,7 +1361,7 @@ has_color_buffer_write_enabled(const struct
anv_pipeline *pipeline,<br>
if (binding->index == UINT32_MAX)<br>
continue;<br>
<br>
- if (blend->pAttachments[binding->index].colorWriteMask
!= 0)<br>
+ if (blend &&
blend->pAttachments[binding->index].colorWriteMask != 0)<br>
return true;<br>
}<br>
<br>
What do you think?<br>
<br>
Sam<br>
<br>
<blockquote type="cite"
cite="mid:CAOFGe94WjXG9P-5WWnAXmArAKoZyCTYLPxGUhKA4ch4BhFFVHQ@mail.gmail.com">
<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"
moz-do-not-send="true">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" moz-do-not-send="true">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"
moz-do-not-send="true">mesa-dev@lists.freedesktop.org</a><br>
<a
href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev"
rel="noreferrer" target="_blank"
moz-do-not-send="true">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote>
</div>
<br>
</div>
</blockquote>
<br>
</body>
</html>