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.
This commit is contained in:
Eric Anholt
2009-10-29 13:35:03 -07:00
parent 861fec163c
commit 4b377ae292
2 changed files with 9 additions and 4 deletions
+3 -3
View File
@@ -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)
+6 -1
View File
@@ -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();