st/mesa: help fix stencil border color for GL_DEPTH_STENCIL textures
authorMarek Olšák <marek.olsak@amd.com>
Tue, 21 Aug 2018 01:33:24 +0000 (21:33 -0400)
committerMarek Olšák <marek.olsak@amd.com>
Tue, 4 Sep 2018 18:01:43 +0000 (14:01 -0400)
GL_STENCIL_INDEX uses GL_INTENSITY for the border color, which is nicer
to hardware that doesn't read the stencil border value from the X channel.

This fixes a bunch of dEQP tests on Vega & Raven.

Cc: 18.1 18.2 <mesa-stable@lists.freedesktop.org>
src/mesa/state_tracker/st_atom_sampler.c

index 289856cd72dead995bc2543a879454d6e3e92ea2..27e4da315817235c183b18315131be2457bb4d0d 100644 (file)
@@ -163,6 +163,9 @@ st_convert_sampler(const struct st_context *st,
       const GLboolean is_integer = texobj->_IsIntegerFormat;
       GLenum texBaseFormat = _mesa_base_tex_image(texobj)->_BaseFormat;
 
+      if (texobj->StencilSampling)
+         texBaseFormat = GL_STENCIL_INDEX;
+
       if (st->apply_texture_swizzle_to_border_color) {
          const struct st_texture_object *stobj = st_texture_object_const(texobj);
          /* XXX: clean that up to not use the sampler view at all */