summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2018-08-20 21:33:24 -0400
committerAndres Gomez <[email protected]>2018-09-04 23:32:36 +0300
commit7e0efcec63d6f41d0c8f59a9e09f373de1ffe725 (patch)
tree49f7bb3b41144bc42d7a72042a889ca06cfad85c
parentaa9d0fdbf6452c09f30701524418b2a144f56aca (diff)
st/mesa: help fix stencil border color for GL_DEPTH_STENCIL textures
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 <[email protected]> (cherry picked from commit 725e8ad5590749ca2fa4bd89e1e8007fd20b114e)
-rw-r--r--src/mesa/state_tracker/st_atom_sampler.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_atom_sampler.c b/src/mesa/state_tracker/st_atom_sampler.c
index 289856cd72d..27e4da31581 100644
--- a/src/mesa/state_tracker/st_atom_sampler.c
+++ b/src/mesa/state_tracker/st_atom_sampler.c
@@ -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 */