<div dir="auto">Sorry I didn't fix vec4 when I fixed fs. :-(<div dir="auto"><br></div><div dir="auto">Reciewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Jan 6, 2017 02:00, "Kenneth Graunke" <<a href="mailto:kenneth@whitecape.org">kenneth@whitecape.org</a>> wrote:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">We were failing to zero m0.2 of the sampler message header for TCS and<br>
GS messages in the simple case.  fs_generator has done this for about<br>
a year now, but we missed it in vec4_generator.<br>
<br>
Fixes ES31-CTS.core.texture_cube_<wbr>map_array.sampling,<br>
GL45-CTS.texture_cube_map_<wbr>array.sampling, and many<br>
dEQP-GLES31.functional.<wbr>shaders.opaque_type_indexing.<wbr>sampler subtests:<br>
- dynamically_uniform.<wbr>tessellation_control.<wbr>isampler3d<br>
- dynamically_uniform.<wbr>tessellation_control.<wbr>isamplercube<br>
- dynamically_uniform.<wbr>tessellation_control.sampler2d<br>
- dynamically_uniform.<wbr>tessellation_control.<wbr>usamplercube<br>
- dynamically_uniform.<wbr>tessellation_control.<wbr>sampler2darray<br>
- dynamically_uniform.<wbr>tessellation_control.<wbr>isampler2darray<br>
- dynamically_uniform.<wbr>tessellation_control.<wbr>usampler3d<br>
- dynamically_uniform.<wbr>tessellation_control.<wbr>usampler2darray<br>
- dynamically_uniform.<wbr>tessellation_control.<wbr>usampler2d<br>
- dynamically_uniform.<wbr>tessellation_control.sampler3d<br>
- dynamically_uniform.<wbr>tessellation_control.<wbr>samplercube<br>
- dynamically_uniform.<wbr>tessellation_control.<wbr>isampler2d<br>
- uniform.tessellation_control.<wbr>isampler3d<br>
- uniform.tessellation_control.<wbr>isamplercube<br>
- uniform.tessellation_control.<wbr>usampler2d<br>
- uniform.tessellation_control.<wbr>usampler3d<br>
- uniform.tessellation_control.<wbr>sampler2darray<br>
- uniform.tessellation_control.<wbr>isampler2darray<br>
- uniform.tessellation_control.<wbr>usampler2darray<br>
- uniform.tessellation_control.<wbr>sampler2d<br>
- uniform.tessellation_control.<wbr>usamplercube<br>
- uniform.tessellation_control.<wbr>sampler3d<br>
- uniform.tessellation_control.<wbr>samplercube<br>
- uniform.tessellation_control.<wbr>isampler2d<br>
<br>
Cc: <a href="mailto:mesa-stable@lists.freedesktop.org">mesa-stable@lists.freedesktop.<wbr>org</a><br>
Signed-off-by: Kenneth Graunke <<a href="mailto:kenneth@whitecape.org">kenneth@whitecape.org</a>><br>
---<br>
 src/mesa/drivers/dri/i965/brw_<wbr>vec4_generator.cpp | 14 ++++++++++++--<br>
 1 file changed, 12 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/src/mesa/drivers/dri/i965/<wbr>brw_vec4_generator.cpp b/src/mesa/drivers/dri/i965/<wbr>brw_vec4_generator.cpp<br>
index 3d688cff144..f095cc2d0f2 100644<br>
--- a/src/mesa/drivers/dri/i965/<wbr>brw_vec4_generator.cpp<br>
+++ b/src/mesa/drivers/dri/i965/<wbr>brw_vec4_generator.cpp<br>
@@ -106,6 +106,7 @@ generate_math2_gen4(struct brw_codegen *p,<br>
 static void<br>
 generate_tex(struct brw_codegen *p,<br>
              struct brw_vue_prog_data *prog_data,<br>
+             gl_shader_stage stage,<br>
              vec4_instruction *inst,<br>
              struct brw_reg dst,<br>
              struct brw_reg src,<br>
@@ -238,8 +239,16 @@ generate_tex(struct brw_codegen *p,<br>
              */<br>
             dw2 |= GEN9_SAMPLER_SIMD_MODE_<wbr>EXTENSION_SIMD4X2;<br>
<br>
-         if (dw2)<br>
+         /* The VS, DS, and FS stages have the g0.2 payload delivered as 0,<br>
+          * so header0.2 is 0 when g0 is copied.  The HS and GS stages do<br>
+          * not, so we must set to to 0 to avoid setting undesirable bits<br>
+          * in the message header.<br>
+          */<br>
+         if (dw2 ||<br>
+             stage == MESA_SHADER_TESS_CTRL ||<br>
+             stage == MESA_SHADER_GEOMETRY) {<br>
             brw_MOV(p, get_element_ud(header, 2), brw_imm_ud(dw2));<br>
+         }<br>
<br>
          brw_adjust_sampler_state_<wbr>pointer(p, header, sampler_index);<br>
          brw_pop_insn_state(p);<br>
@@ -1748,7 +1757,8 @@ generate_code(struct brw_codegen *p,<br>
       case SHADER_OPCODE_TG4:<br>
       case SHADER_OPCODE_TG4_OFFSET:<br>
       case SHADER_OPCODE_SAMPLEINFO:<br>
-         generate_tex(p, prog_data, inst, dst, src[0], src[1], src[2]);<br>
+         generate_tex(p, prog_data, nir->stage,<br>
+                      inst, dst, src[0], src[1], src[2]);<br>
          break;<br>
<br>
       case VS_OPCODE_URB_WRITE:<br>
<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></blockquote></div><br></div>