<div dir="ltr"><div><div>Assuming the answer to both of the below questions is "yes", everything except patch 10 is<br><br></div>Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>><br><br></div>I don't think caching will be all thar thard to fix.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 10, 2017 at 9:06 AM, Jason Ekstrand <span dir="ltr"><<a href="mailto:jason@jlekstrand.net" target="_blank">jason@jlekstrand.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class="">On Mon, Jan 9, 2017 at 11:37 PM, Kenneth Graunke <span dir="ltr"><<a href="mailto:kenneth@whitecape.org" target="_blank">kenneth@whitecape.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">v2: Use info->tess.<br>
<br>
Signed-off-by: Kenneth Graunke <<a href="mailto:kenneth@whitecape.org" target="_blank">kenneth@whitecape.org</a>><br>
Reviewed-by: Dave Airlie <<a href="mailto:airlied@redhat.com" target="_blank">airlied@redhat.com</a>> [v1]<br>
Reviewed-by: Iago Toral Quiroga <<a href="mailto:itoral@igalia.com" target="_blank">itoral@igalia.com</a>> [v1]<br>
Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net" target="_blank">jason@jlekstrand.net</a>> [v1]<br>
---<br>
 src/compiler/spirv/spirv_to_n<wbr>ir.c | 45 ++++++++++++++++++++++++++++++<wbr>+++------<br>
 1 file changed, 39 insertions(+), 6 deletions(-)<br>
<br>
diff --git a/src/compiler/spirv/spirv_to_<wbr>nir.c b/src/compiler/spirv/spirv_to_<wbr>nir.c<br>
index befee1a4b9b..8f662aa35e2 100644<br>
--- a/src/compiler/spirv/spirv_to_<wbr>nir.c<br>
+++ b/src/compiler/spirv/spirv_to_<wbr>nir.c<br>
@@ -2753,8 +2753,12 @@ vtn_handle_execution_mode(stru<wbr>ct vtn_builder *b, struct vtn_value *entry_point,<br>
       break; /* Nothing to do with this */<br>
<br>
    case SpvExecutionModeOutputVertices<wbr>:<br>
-      assert(b->shader->stage == MESA_SHADER_GEOMETRY);<br>
-      b->shader->info->gs.vertices_o<wbr>ut = mode->literals[0];<br>
+      if (b->shader->stage == MESA_SHADER_TESS_CTRL) {<br></blockquote><div><br></div></span><div>Is this only allowed in TCS?  Just double-checking...<br></div><span class=""><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+         b->shader->info->tess.tcs_ver<wbr>tices_out = mode->literals[0];<br>
+      } else {<br>
+         assert(b->shader->stage == MESA_SHADER_GEOMETRY);<br>
+         b->shader->info->gs.vertices_<wbr>out = mode->literals[0];<br>
+      }<br>
       break;<br>
<br>
    case SpvExecutionModeInputPoints:<br>
@@ -2764,11 +2768,13 @@ vtn_handle_execution_mode(stru<wbr>ct vtn_builder *b, struct vtn_value *entry_point,<br>
    case SpvExecutionModeInputTriangles<wbr>Adjacency:<br>
    case SpvExecutionModeQuads:<br>
    case SpvExecutionModeIsolines:<br>
-      if (b->shader->stage == MESA_SHADER_GEOMETRY) {<br>
+      if (b->shader->stage == MESA_SHADER_TESS_EVAL) {<br></blockquote><div><br></div></span><div>Same question here only TES.<br></div><div><div class="h5"><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+         b->shader->info->tess.primiti<wbr>ve_mode =<br>
+            gl_primitive_from_spv_executio<wbr>n_mode(mode->exec_mode);<br>
+      } else {<br>
+         assert(b->shader->stage == MESA_SHADER_GEOMETRY);<br>
          b->shader->info->gs.vertices_i<wbr>n =<br>
             vertices_in_from_spv_executio<wbr>n_mode(mode->exec_mode);<br>
-      } else {<br>
-         assert(!"Tesselation shaders not yet supported");<br>
       }<br>
       break;<br>
<br>
@@ -2781,12 +2787,39 @@ vtn_handle_execution_mode(stru<wbr>ct vtn_builder *b, struct vtn_value *entry_point,<br>
       break;<br>
<br>
    case SpvExecutionModeSpacingEqual:<br>
+      assert(b->shader->stage == MESA_SHADER_TESS_CTRL ||<br>
+             b->shader->stage == MESA_SHADER_TESS_EVAL);<br>
+      b->shader->info->tess.spacing = TESS_SPACING_EQUAL;<br>
+      break;<br>
    case SpvExecutionModeSpacingFractio<wbr>nalEven:<br>
+      assert(b->shader->stage == MESA_SHADER_TESS_CTRL ||<br>
+             b->shader->stage == MESA_SHADER_TESS_EVAL);<br>
+      b->shader->info->tess.spacing = TESS_SPACING_FRACTIONAL_EVEN;<br>
+      break;<br>
    case SpvExecutionModeSpacingFractio<wbr>nalOdd:<br>
+      assert(b->shader->stage == MESA_SHADER_TESS_CTRL ||<br>
+             b->shader->stage == MESA_SHADER_TESS_EVAL);<br>
+      b->shader->info->tess.spacing = TESS_SPACING_FRACTIONAL_ODD;<br>
+      break;<br>
    case SpvExecutionModeVertexOrderCw:<br>
+      assert(b->shader->stage == MESA_SHADER_TESS_CTRL ||<br>
+             b->shader->stage == MESA_SHADER_TESS_EVAL);<br>
+      /* Vulkan's notion of CCW seems to match the hardware backends,<br>
+       * but be the opposite of OpenGL.  Currently NIR follows GL semantics,<br>
+       * so we set it backwards here.<br>
+       */<br>
+      b->shader->info->tess.ccw = true;<br>
+      break;<br>
    case SpvExecutionModeVertexOrderCcw<wbr>:<br>
+      assert(b->shader->stage == MESA_SHADER_TESS_CTRL ||<br>
+             b->shader->stage == MESA_SHADER_TESS_EVAL);<br>
+      /* Backwards; see above */<br>
+      b->shader->info->tess.ccw = false;<br>
+      break;<br>
    case SpvExecutionModePointMode:<br>
-      assert(!"TODO: Add tessellation metadata");<br>
+      assert(b->shader->stage == MESA_SHADER_TESS_CTRL ||<br>
+             b->shader->stage == MESA_SHADER_TESS_EVAL);<br>
+      b->shader->info->tess.point_mo<wbr>de = true;<br>
       break;<br>
<br>
    case SpvExecutionModePixelCenterInt<wbr>eger:<br>
<span class="m_-6600388356426000968HOEnZb"><font color="#888888">--<br>
2.11.0<br>
<br>
______________________________<wbr>_________________<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/<wbr>mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div></div></div><br></div></div>
</blockquote></div><br></div>