From 1ad7b99925e044f82e635f746c1ef2df77f69ac9 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 28 Sep 2005 02:29:50 +0000 Subject: Initial work for GL_EXT_packed_depth_stencil extension. glReadPixels done, glDrawPixels mostly done. --- src/mesa/main/texformat_tmp.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src/mesa/main/texformat_tmp.h') diff --git a/src/mesa/main/texformat_tmp.h b/src/mesa/main/texformat_tmp.h index f060179eee..92df277564 100644 --- a/src/mesa/main/texformat_tmp.h +++ b/src/mesa/main/texformat_tmp.h @@ -1215,6 +1215,30 @@ static void store_texel_ycbcr_rev(struct gl_texture_image *texImage, #endif +/* MESA_TEXFORMAT_Z24_S8 ***************************************************/ + +static void FETCH(f_z24_s8)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + /* only return Z, not stencil data */ + const GLuint *src = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + const GLfloat scale = 0xffffff; + texel[0] = *src * scale; +} + +#if DIM == 3 +static void store_texel_z24_s8(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + /* only store Z, not stencil */ + GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + GLfloat z = *((GLfloat *) texel); + GLuint zi = ((GLuint) (z * 0xffffff)) << 8; + *dst = zi | (*dst & 0xff); +} +#endif + + #undef TEXEL_ADDR #undef DIM -- cgit v1.2.3