diff options
author | Eric Anholt <eric@anholt.net> | 2009-10-29 13:35:03 -0700 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2009-10-29 14:56:52 -0700 |
commit | 4b377ae292f75645ef356bd3bfac407230faf73a (patch) | |
tree | 6403885041cb9beab025111e851c13cdddf99330 | |
parent | 861fec163c1ae7e431956db0a08989d841e2b74e (diff) |
i915: Correct and make use of the defines for 32-bit depth texture modes.
Previously, S8_Z24 depth textures would always be treated as intensity.
Fixes piglit depth-tex-modes.
-rw-r--r-- | src/mesa/drivers/dri/i915/i915_reg.h | 6 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i915/i915_texstate.c | 7 |
2 files changed, 9 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/i915/i915_reg.h b/src/mesa/drivers/dri/i915/i915_reg.h index b5fa7fddb96..7f31ff674f2 100644 --- a/src/mesa/drivers/dri/i915/i915_reg.h +++ b/src/mesa/drivers/dri/i915/i915_reg.h @@ -626,9 +626,9 @@ #define MT_32BIT_AWVU2101010 (0xA<<3) #define MT_32BIT_GR1616 (0xB<<3) #define MT_32BIT_VU1616 (0xC<<3) -#define MT_32BIT_xI824 (0xD<<3) -#define MT_32BIT_xA824 (0xE<<3) -#define MT_32BIT_xL824 (0xF<<3) +#define MT_32BIT_x8I24 (0xD<<3) +#define MT_32BIT_x8L24 (0xE<<3) +#define MT_32BIT_x8A24 (0xF<<3) #define MT_422_YCRCB_SWAPY (0<<3) /* SURFACE_422 */ #define MT_422_YCRCB_NORMAL (1<<3) #define MT_422_YCRCB_SWAPUV (2<<3) diff --git a/src/mesa/drivers/dri/i915/i915_texstate.c b/src/mesa/drivers/dri/i915/i915_texstate.c index 1397f04a59e..0c29c558ec7 100644 --- a/src/mesa/drivers/dri/i915/i915_texstate.c +++ b/src/mesa/drivers/dri/i915/i915_texstate.c @@ -82,7 +82,12 @@ translate_texture_format(gl_format mesa_format, GLuint internal_format, case MESA_FORMAT_RGBA_DXT5: return (MAPSURF_COMPRESSED | MT_COMPRESS_DXT4_5); case MESA_FORMAT_S8_Z24: - return (MAPSURF_32BIT | MT_32BIT_xI824); + if (DepthMode == GL_ALPHA) + return (MAPSURF_32BIT | MT_32BIT_x8A24); + else if (DepthMode == GL_INTENSITY) + return (MAPSURF_32BIT | MT_32BIT_x8I24); + else + return (MAPSURF_32BIT | MT_32BIT_x8L24); default: fprintf(stderr, "%s: bad image format %x\n", __FUNCTION__, mesa_format); abort(); |