<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sun, Nov 20, 2016 at 8:03 PM, Jordan Justen <span dir="ltr"><<a href="mailto:jordan.l.justen@intel.com" target="_blank">jordan.l.justen@intel.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Fixes:<br>
<br>
ES31-CTS.functional.texture.<wbr>border_clamp.formats.depth24_<wbr>stencil8_sample_stencil.<wbr>nearest_size_pot<br>
ES31-CTS.functional.texture.<wbr>border_clamp.formats.depth24_<wbr>stencil8_sample_stencil.<wbr>nearest_size_npot<br>
ES31-CTS.functional.texture.<wbr>border_clamp.formats.depth32f_<wbr>stencil8_sample_stencil.<wbr>nearest_size_pot<br>
ES31-CTS.functional.texture.<wbr>border_clamp.formats.depth32f_<wbr>stencil8_sample_stencil.<wbr>nearest_size_npot<br>
ES31-CTS.functional.texture.<wbr>border_clamp.unused_channels.<wbr>depth24_stencil8_sample_<wbr>stencil<br>
ES31-CTS.functional.texture.<wbr>border_clamp.unused_channels.<wbr>depth32f_stencil8_sample_<wbr>stencil<br>
<br>
Signed-off-by: Jordan Justen <<a href="mailto:jordan.l.justen@intel.com">jordan.l.justen@intel.com</a>><br>
---<br>
 src/mesa/drivers/dri/i965/brw_<wbr>sampler_state.c | 18 +++++++++---------<br>
 src/mesa/drivers/dri/i965/brw_<wbr>state.h         |  9 ---------<br>
 2 files changed, 9 insertions(+), 18 deletions(-)<br>
<br>
diff --git a/src/mesa/drivers/dri/i965/<wbr>brw_sampler_state.c b/src/mesa/drivers/dri/i965/<wbr>brw_sampler_state.c<br>
index 7df2c55..412efb9 100644<br>
--- a/src/mesa/drivers/dri/i965/<wbr>brw_sampler_state.c<br>
+++ b/src/mesa/drivers/dri/i965/<wbr>brw_sampler_state.c<br>
@@ -213,7 +213,7 @@ static void<br>
 upload_default_color(struct brw_context *brw,<br>
                      const struct gl_sampler_object *sampler,<br>
                      mesa_format format, GLenum base_format,<br>
-                     bool is_integer_format,<br>
+                     bool is_integer_format, bool is_stencil_sampling,<br>
                      uint32_t *sdc_offset)<br>
 {<br>
    union gl_color_union color;<br>
@@ -277,7 +277,7 @@ upload_default_color(struct brw_context *brw,<br>
       uint32_t *sdc = brw_state_batch(brw, AUB_TRACE_SAMPLER_DEFAULT_<wbr>COLOR,<br>
                                       4 * 4, 64, sdc_offset);<br>
       memcpy(sdc, color.ui, 4 * 4);<br>
-   } else if (brw->is_haswell && is_integer_format) {<br>
+   } else if (brw->is_haswell && (is_integer_format || is_stencil_sampling)) {<br>
       /* Haswell's integer border color support is completely insane:<br>
        * SAMPLER_BORDER_COLOR_STATE is 20 DWords.  The first four are<br>
        * for float colors.  The next 12 DWords are MBZ and only exist to<br>
@@ -291,10 +291,9 @@ upload_default_color(struct brw_context *brw,<br>
       memset(sdc, 0, 20 * 4);<br>
       sdc = &sdc[16];<br>
<br>
+      bool stencil = format == MESA_FORMAT_S_UINT8 || is_stencil_sampling;<br>
       const int bits_per_channel =<br>
-         _mesa_get_format_bits(format,<br>
-                               format == MESA_FORMAT_S_UINT8 ?<br>
-                               GL_STENCIL_BITS : GL_RED_BITS);<br>
+         _mesa_get_format_bits(format, stencil ? GL_STENCIL_BITS : GL_RED_BITS);<br>
<br>
       /* From the Haswell PRM, "Command Reference: Structures", Page 36:<br>
        * "If any color channel is missing from the surface format,<br>
@@ -389,12 +388,13 @@ upload_default_color(struct brw_context *brw,<br>
  * Sets the sampler state for a single unit based off of the sampler key<br>
  * entry.<br>
  */<br>
-void<br>
+static void<br>
 brw_update_sampler_state(<wbr>struct brw_context *brw,<br>
                          GLenum target, bool tex_cube_map_seamless,<br>
                          GLfloat tex_unit_lod_bias,<br>
                          mesa_format format, GLenum base_format,<br>
                          bool is_integer_format,<br>
+                         bool is_stencil_sampling,<br></blockquote><div><br></div><div>Doesn't is_stencil_sampling imply is_integer_format?  I mean, stencil is always R8_UINT, right?<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
                          const struct gl_sampler_object *sampler,<br>
                          uint32_t *sampler_state,<br>
                          uint32_t batch_offset_for_sampler_<wbr>state)<br>
@@ -516,8 +516,8 @@ brw_update_sampler_state(<wbr>struct brw_context *brw,<br>
    if (wrap_mode_needs_border_color(<wbr>wrap_s) ||<br>
        wrap_mode_needs_border_color(<wbr>wrap_t) ||<br>
        wrap_mode_needs_border_color(<wbr>wrap_r)) {<br>
-      upload_default_color(brw, sampler,<br>
-                           format, base_format, is_integer_format,<br>
+      upload_default_color(brw, sampler, format, base_format,<br>
+                           is_integer_format, is_stencil_sampling,<br>
                            &border_color_offset);<br>
    }<br>
<br>
@@ -555,7 +555,7 @@ update_sampler_state(struct brw_context *brw,<br>
    brw_update_sampler_state(brw, texObj->Target, ctx->Texture.CubeMapSeamless,<br>
                             texUnit->LodBias,<br>
                             firstImage->TexFormat, firstImage->_BaseFormat,<br>
-                            texObj->_IsIntegerFormat,<br>
+                            texObj->_IsIntegerFormat, texObj->StencilSampling,<br></blockquote><div><br></div><div>In other words, you could just make that comma a pipe and call it a day.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
                             sampler,<br>
                             sampler_state, batch_offset_for_sampler_<wbr>state);<br>
 }<br>
diff --git a/src/mesa/drivers/dri/i965/<wbr>brw_state.h b/src/mesa/drivers/dri/i965/<wbr>brw_state.h<br>
index 07126e8..176557b 100644<br>
--- a/src/mesa/drivers/dri/i965/<wbr>brw_state.h<br>
+++ b/src/mesa/drivers/dri/i965/<wbr>brw_state.h<br>
@@ -335,15 +335,6 @@ void brw_emit_sampler_state(struct brw_context *brw,<br>
                             bool non_normalized_coordinates,<br>
                             uint32_t border_color_offset);<br>
<br>
-void brw_update_sampler_state(<wbr>struct brw_context *brw,<br>
-                              GLenum target, bool tex_cube_map_seamless,<br>
-                              GLfloat tex_unit_lod_bias,<br>
-                              mesa_format format, GLenum base_format,<br>
-                              bool is_integer_format,<br>
-                              const struct gl_sampler_object *sampler,<br>
-                              uint32_t *sampler_state,<br>
-                              uint32_t batch_offset_for_sampler_<wbr>state);<br>
-<br>
 /* gen6_wm_state.c */<br>
 void<br>
 gen6_upload_wm_state(struct brw_context *brw,<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.10.2<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>