diff options
author | Brian Paul <[email protected]> | 2005-09-28 02:29:50 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2005-09-28 02:29:50 +0000 |
commit | 1ad7b99925e044f82e635f746c1ef2df77f69ac9 (patch) | |
tree | 7fa22cf8b21a35350191399dcab96db8c0d1e363 /src/mesa/main/texformat_tmp.h | |
parent | b955474093445d6e5b8c5d3cfa69e2752a01bcf8 (diff) |
Initial work for GL_EXT_packed_depth_stencil extension.
glReadPixels done, glDrawPixels mostly done.
Diffstat (limited to 'src/mesa/main/texformat_tmp.h')
-rw-r--r-- | src/mesa/main/texformat_tmp.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/mesa/main/texformat_tmp.h b/src/mesa/main/texformat_tmp.h index f060179eeea..92df2775642 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 |