<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sun, Jan 8, 2017 at 9:26 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">Signed-off-by: Kenneth Graunke <<a href="mailto:kenneth@whitecape.org">kenneth@whitecape.org</a>><br>
---<br>
src/compiler/spirv/spirv_to_<wbr>nir.c | 28 ++++++++++++++++++++++------<br>
1 file changed, 22 insertions(+), 6 deletions(-)<br>
<br>
One totally bogus thing here: we set CCW backwards. In all three driver<br>
backends (i965, nvc0, radeonsi), we invert CCW because it doesn't seem to<br>
match the HW. That means that Vulkan CCW and HW CCW match, and it's just<br>
OpenGL that's backwards. We should figure out what's actually going on<br>
here and decide which meaning we want to go with.<br>
<br>
diff --git a/src/compiler/spirv/spirv_to_<wbr>nir.c b/src/compiler/spirv/spirv_to_<wbr>nir.c<br>
index 41da0e85c9d..8f19afa77ee 100644<br>
--- a/src/compiler/spirv/spirv_to_<wbr>nir.c<br>
+++ b/src/compiler/spirv/spirv_to_<wbr>nir.c<br>
@@ -2655,8 +2655,12 @@ vtn_handle_execution_mode(<wbr>struct 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_<wbr>out = mode->literals[0];<br>
+ if (b->shader->stage == MESA_SHADER_TESS_CTRL) {<br>
+ b->shader->info->tcs.vertices_<wbr>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>
@@ -2666,11 +2670,13 @@ vtn_handle_execution_mode(<wbr>struct 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>
+ b->shader->info->tes.<wbr>primitive_mode =<br>
+ gl_primitive_from_spv_<wbr>execution_mode(mode->exec_<wbr>mode);<br>
+ } else {<br>
+ assert(b->shader->stage == MESA_SHADER_GEOMETRY);<br>
b->shader->info->gs.vertices_<wbr>in =<br>
vertices_in_from_spv_<wbr>execution_mode(mode->exec_<wbr>mode);<br>
- } else {<br>
- assert(!"Tesselation shaders not yet supported");<br>
}<br>
break;<br>
<br>
@@ -2683,12 +2689,22 @@ vtn_handle_execution_mode(<wbr>struct vtn_builder *b, struct vtn_value *entry_point,<br>
break;<br>
<br>
case SpvExecutionModeSpacingEqual:<br>
+ b->shader->info->tes.spacing = TESS_SPACING_EQUAL;<br>
+ break;<br>
case SpvExecutionModeSpacingFractio<wbr>nalEven:<br>
+ b->shader->info->tes.spacing = TESS_SPACING_FRACTIONAL_EVEN;<br>
+ break;<br>
case SpvExecutionModeSpacingFractio<wbr>nalOdd:<br>
+ b->shader->info->tes.spacing = TESS_SPACING_FRACTIONAL_ODD;<br>
+ break;<br>
case SpvExecutionModeVertexOrderCw:<br>
+ b->shader->info->tes.ccw = true;<br>
+ break;<br>
case SpvExecutionModeVertexOrderCcw<wbr>:<br>
+ b->shader->info->tes.ccw = false;<br></blockquote><div><br></div><div>Given the issues we found with point_mode, I think we want to assert that we're in the right stage on all of these.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+ break;<br>
case SpvExecutionModePointMode:<br>
- assert(!"TODO: Add tessellation metadata");<br>
+ b->shader->info->tes.point_<wbr>mode = true;<br></blockquote><div><br></div><div>these can come through either stage so we need to have them in both tes and tcs and switch correctly.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
break;<br>
<br>
case SpvExecutionModePixelCenterInt<wbr>eger:<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.11.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></div>