<div dir="ltr">Also, we should probably consider converting it over to a system value one of these days. That would make more sense from a theoretical model perspective. Not sure if it makes sense in any drivers though.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jan 9, 2017 at 8:03 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 4:50 AM, Iago Toral Quiroga <span dir="ltr"><<a href="mailto:itoral@igalia.com" target="_blank">itoral@igalia.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Geometry and Tessellation stages do handle this as a system value instead.<br>
<br>
Fixes:<br>
dEQP-VK.geometry.basic.primiti<wbr>ve_id<br>
---<br>
src/compiler/spirv/vtn_variab<wbr>les.c | 3 ++-<br>
1 file changed, 2 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/src/compiler/spirv/vtn_varia<wbr>bles.c b/src/compiler/spirv/vtn_varia<wbr>bles.c<br>
index 9b84c97..cf47e5d 100644<br>
--- a/src/compiler/spirv/vtn_varia<wbr>bles.c<br>
+++ b/src/compiler/spirv/vtn_varia<wbr>bles.c<br>
@@ -908,7 +908,8 @@ vtn_get_builtin_location(struc<wbr>t vtn_builder *b,<br>
set_mode_system_value(mode);<br>
break;<br>
case SpvBuiltInPrimitiveId:<br>
- if (*mode == nir_var_shader_out) {<br>
+ if (*mode == nir_var_shader_out ||<br>
+ b->shader->stage == MESA_SHADER_FRAGMENT) {<br></blockquote><div><br></div></span><div>Can we do this instead:<br><br></div><div>if (b->shader->stage == MESA_SHADER_FRAGMENT) {<br></div><div> assert(*mode == nir_var_shader_in);<br></div><div> *location = VARYING_SLOT_PRIMITIVE_ID;<br></div><div>} else if (*mode == nir_var_shader_out) {<br> ...<br></div><span class=""><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
*location = VARYING_SLOT_PRIMITIVE_ID;<br>
} else {<br>
*location = SYSTEM_VALUE_PRIMITIVE_ID;<br>
<span class="m_6163202338290005322HOEnZb"><font color="#888888">--<br>
2.7.4<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></span></div><br></div></div>
</blockquote></div><br></div>