<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Sep 15, 2017 at 11:18 AM, Ilia Mirkin <span dir="ltr"><<a href="mailto:imirkin@alum.mit.edu" target="_blank">imirkin@alum.mit.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Signed-off-by: Ilia Mirkin <<a href="mailto:imirkin@alum.mit.edu">imirkin@alum.mit.edu</a>><br>
---<br>
<br>
Note that the use of ICMS_INNER_CONSERVATIVE disagrees with the GL driver.<br>
Perhaps it's more performant than ICMS_NORMAL and is otherwise permitted?<br>
Not sure, so I left it as-is.<br>
<br>
Also note that there are no tests for this, and I have not verified anything<br>
besides the fact that the ext shows up on a gen9 device.<br></blockquote><div><br></div><div>Yeah... That's kind-of the problem with basically any EXT vulkan extension and why I haven't hooked any of them (including this one) up yet.  Could I interest you in at least writing a crucible test?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
 src/intel/vulkan/anv_<wbr>extensions.py |  2 ++<br>
 src/intel/vulkan/anv_pipeline.<wbr>c    |  1 +<br>
 src/intel/vulkan/genX_<wbr>pipeline.c   | 13 +++++++++++--<br>
 3 files changed, 14 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/src/intel/vulkan/anv_<wbr>extensions.py b/src/intel/vulkan/anv_<wbr>extensions.py<br>
index acec785959..5170d48aff 100644<br>
--- a/src/intel/vulkan/anv_<wbr>extensions.py<br>
+++ b/src/intel/vulkan/anv_<wbr>extensions.py<br>
@@ -76,6 +76,8 @@ EXTENSIONS = [<br>
     Extension('VK_KHR_xlib_<wbr>surface',                      6, 'VK_USE_PLATFORM_XLIB_KHR'),<br>
     Extension('VK_KHX_multiview',                         1, True),<br>
     Extension('VK_EXT_debug_<wbr>report',                      8, True),<br>
+    Extension('VK_EXT_post_depth_<wbr>coverage',               1,<br>
+              'device->instance-><wbr>physicalDevice.info.gen >= 9'),<br></blockquote><div><br></div><div>"device" in this case is the physical device.  Just "device->info.gen >= 9" should be sufficient.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
 ]<br>
<br>
 class VkVersion:<br>
diff --git a/src/intel/vulkan/anv_<wbr>pipeline.c b/src/intel/vulkan/anv_<wbr>pipeline.c<br>
index 94e99d8437..30d9d3df90 100644<br>
--- a/src/intel/vulkan/anv_<wbr>pipeline.c<br>
+++ b/src/intel/vulkan/anv_<wbr>pipeline.c<br>
@@ -130,6 +130,7 @@ anv_shader_compile_to_nir(<wbr>struct anv_pipeline *pipeline,<br>
       .image_write_without_format = true,<br>
       .multiview = true,<br>
       .variable_pointers = true,<br>
+      .post_depth_coverage = device->instance-><wbr>physicalDevice.info.gen >= 9,<br>
    };<br>
<br>
    nir_function *entry_point =<br>
diff --git a/src/intel/vulkan/genX_<wbr>pipeline.c b/src/intel/vulkan/genX_<wbr>pipeline.c<br>
index 6dfa49b873..84140cd523 100644<br>
--- a/src/intel/vulkan/genX_<wbr>pipeline.c<br>
+++ b/src/intel/vulkan/genX_<wbr>pipeline.c<br>
@@ -1532,6 +1532,16 @@ emit_3dstate_ps_extra(struct anv_pipeline *pipeline,<br>
       return;<br>
    }<br>
<br>
+#if GEN_GEN >= 9<br>
+   uint32_t coverage = ICMS_NONE;<br>
+   if (wm_prog_data->uses_sample_<wbr>mask) {<br>
+      if (wm_prog_data->post_depth_<wbr>coverage)<br>
+         coverage = ICMS_DEPTH_COVERAGE;<br>
+      else<br>
+         coverage = ICMS_INNER_CONSERVATIVE;<br>
+   }<br>
+#endif<br>
+<br>
    anv_batch_emit(&pipeline-><wbr>batch, GENX(3DSTATE_PS_EXTRA), ps) {<br>
       ps.PixelShaderValid              = true;<br>
       ps.AttributeEnable               = wm_prog_data->num_varying_<wbr>inputs > 0;<br>
@@ -1583,8 +1593,7 @@ emit_3dstate_ps_extra(struct anv_pipeline *pipeline,<br>
<br>
 #if GEN_GEN >= 9<br>
       ps.PixelShaderPullsBary    = wm_prog_data->pulls_bary;<br>
-      ps.InputCoverageMaskState  = wm_prog_data->uses_sample_mask ?<br>
-                                   ICMS_INNER_CONSERVATIVE : ICMS_NONE;<br>
+      ps.InputCoverageMaskState  = coverage;<br></blockquote><div><br></div><div>In the GL driver, we have this nice little if-ladder.  I think I'd prefer that to having a temporary and pulling it into it's own "#if GEN_GEN >= 9" block.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
 #else<br>
       ps.<wbr>PixelShaderUsesInputCoverageMa<wbr>sk = wm_prog_data->uses_sample_<wbr>mask;<br>
 #endif<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.13.5<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></div>