<div dir="ltr"><div>Maybe we should just roll the depthTestEnable check in with the ds_aspects & VK_IMAGE_ASPECT_DEPTH_BIT check right below it.  In either case,</div><div><br></div><div>Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>><br></div></div><br><div class="gmail_quote"><div dir="ltr">On Thu, Oct 25, 2018 at 5:25 AM Alex Smith <<a href="mailto:asmith@feralinteractive.com">asmith@feralinteractive.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">When depth testing is disabled, we shouldn't pay attention to the<br>
specified depthCompareOp, and just treat it as always passing. Before,<br>
if the depth test is disabled, but depthCompareOp is VK_COMPARE_OP_NEVER<br>
(e.g. from the app having zero-initialized the structure), then<br>
sanitize_stencil_face() would have incorrectly changed passOp to<br>
VK_STENCIL_OP_KEEP.<br>
<br>
Signed-off-by: Alex Smith <<a href="mailto:asmith@feralinteractive.com" target="_blank">asmith@feralinteractive.com</a>><br>
---<br>
 src/intel/vulkan/genX_pipeline.c | 8 ++++++--<br>
 1 file changed, 6 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/src/intel/vulkan/genX_pipeline.c b/src/intel/vulkan/genX_pipeline.c<br>
index 33f1f7832a..877a9fb850 100644<br>
--- a/src/intel/vulkan/genX_pipeline.c<br>
+++ b/src/intel/vulkan/genX_pipeline.c<br>
@@ -755,9 +755,13 @@ sanitize_ds_state(VkPipelineDepthStencilStateCreateInfo *state,<br>
 {<br>
    *stencilWriteEnable = state->stencilTestEnable;<br>
<br>
-   /* If the depth test is disabled, we won't be writing anything. */<br>
-   if (!state->depthTestEnable)<br>
+   /* If the depth test is disabled, we won't be writing anything. Make sure<br>
+    * we treat it as always passing later on as well.<br>
+    */<br>
+   if (!state->depthTestEnable) {<br>
       state->depthWriteEnable = false;<br>
+      state->depthCompareOp = VK_COMPARE_OP_ALWAYS;<br>
+   }<br>
<br>
    /* The Vulkan spec requires that if either depth or stencil is not present,<br>
     * the pipeline is to act as if the test silently passes.<br>
-- <br>
2.14.4<br>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">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/mailman/listinfo/mesa-dev</a><br>
</blockquote></div>