[Mesa-dev] [PATCH] st/mesa: apply DepthMode swizzle to stencil texturing as well

Ilia Mirkin imirkin at alum.mit.edu
Wed Feb 17 13:43:06 UTC 2016


Gallium doesn't present these as GL_RED-style. A swizzle is necessary to
present the proper data in the unused components.

Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
---

The GL 4.5 compat spec also makes it clear that sampling from stencil is the
same as sampling from depth (except obviously the stencil value is used). So
the same swizzling rules should apply.

However I'm unaware that this fixes anything in particular.

 src/mesa/state_tracker/st_atom_texture.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/src/mesa/state_tracker/st_atom_texture.c b/src/mesa/state_tracker/st_atom_texture.c
index f59eeec..4b7ad77 100644
--- a/src/mesa/state_tracker/st_atom_texture.c
+++ b/src/mesa/state_tracker/st_atom_texture.c
@@ -148,9 +148,7 @@ compute_texture_format_swizzle(GLenum baseFormat, GLenum depthMode,
       else
          return SWIZZLE_XYZW;
    case GL_STENCIL_INDEX:
-      return SWIZZLE_XYZW;
    case GL_DEPTH_STENCIL:
-      /* fall-through */
    case GL_DEPTH_COMPONENT:
       /* Now examine the depth mode */
       switch (depthMode) {
-- 
2.4.10



More information about the mesa-dev mailing list