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/texstore.c | |
parent | b955474093445d6e5b8c5d3cfa69e2752a01bcf8 (diff) |
Initial work for GL_EXT_packed_depth_stencil extension.
glReadPixels done, glDrawPixels mostly done.
Diffstat (limited to 'src/mesa/main/texstore.c')
-rw-r--r-- | src/mesa/main/texstore.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index 53be319ad74..ccdb81c6155 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -881,7 +881,8 @@ _mesa_texstore_depth_component_float32(STORE_PARAMS) for (row = 0; row < srcHeight; row++) { const GLvoid *src = _mesa_image_address(dims, srcPacking, srcAddr, srcWidth, srcHeight, srcFormat, srcType, img, row, 0); - _mesa_unpack_depth_span(ctx, srcWidth, (GLfloat *) dstRow, + _mesa_unpack_depth_span(ctx, srcWidth, + GL_FLOAT, (GLfloat *) dstRow, 1.0F, srcType, src, srcPacking); dstRow += dstRowStride; } @@ -920,19 +921,16 @@ _mesa_texstore_depth_component16(STORE_PARAMS) + dstZoffset * dstImageStride + dstYoffset * dstRowStride + dstXoffset * dstFormat->TexelBytes; - GLint img, row, col; + GLint img, row; for (img = 0; img < srcDepth; img++) { GLubyte *dstRow = dstImage; for (row = 0; row < srcHeight; row++) { - GLfloat depthTemp[MAX_WIDTH]; const GLvoid *src = _mesa_image_address(dims, srcPacking, srcAddr, srcWidth, srcHeight, srcFormat, srcType, img, row, 0); GLushort *dst16 = (GLushort *) dstRow; - _mesa_unpack_depth_span(ctx, srcWidth, depthTemp, + _mesa_unpack_depth_span(ctx, srcWidth, + GL_UNSIGNED_SHORT, dst16, 65535.0F, srcType, src, srcPacking); - for (col = 0; col < srcWidth; col++) { - dst16[col] = (GLushort) (depthTemp[col] * 65535.0F); - } dstRow += dstRowStride; } dstImage += dstImageStride; @@ -4071,6 +4069,10 @@ _mesa_get_teximage(GLcontext *ctx, GLenum target, GLint level, _mesa_swap2((GLushort *) dest, width); } } + else if (format == GL_DEPTH_STENCIL_EXT) { + /* XXX special case */ + + } else { /* general case: convert row to RGBA format */ GLfloat rgba[MAX_WIDTH][4]; |