summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2011-07-31 20:48:24 -0700
committerEric Anholt <[email protected]>2011-09-27 12:12:07 -0700
commit59348722b7a2a9ec689af0613fa8435f78a90cc4 (patch)
tree54dfa2756a4dc12304fd571853000f3254824c20 /src/mesa/state_tracker
parent0c513a9c1b5125ba647c17f330635ded46d4d174 (diff)
mesa: Convert depth/stencil glGetTexImage() to using MapTextureImage().
Note that the implementation before and after appears to be broken in its handling of Z24_S8 vs S8_Z24. Tested-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r--src/mesa/state_tracker/st_cb_texture.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c
index ffb5635d257..eb73ce88228 100644
--- a/src/mesa/state_tracker/st_cb_texture.c
+++ b/src/mesa/state_tracker/st_cb_texture.c
@@ -938,6 +938,7 @@ st_GetTexImage(struct gl_context * ctx, GLenum target, GLint level,
format, type);
GLuint depth, i;
GLubyte *dest;
+ GLboolean do_map = GL_TRUE;
if (stImage->pt && util_format_is_s3tc(stImage->pt->format)) {
/* Need to decompress the texture.
@@ -949,8 +950,12 @@ st_GetTexImage(struct gl_context * ctx, GLenum target, GLint level,
return;
}
+ if (format == GL_DEPTH_STENCIL_EXT) {
+ do_map = GL_FALSE;
+ }
+
/* Map */
- if (stImage->pt) {
+ if (do_map && stImage->pt) {
/* Image is stored in hardware format in a buffer managed by the
* kernel. Need to explicitly map and unmap it.
*/
@@ -963,7 +968,7 @@ st_GetTexImage(struct gl_context * ctx, GLenum target, GLint level,
* util_format_get_blockwidth(stImage->pt->format)
/ util_format_get_blocksize(stImage->pt->format);
}
- else {
+ else if (do_map) {
/* Otherwise, the image should actually be stored in
* texImage->Data. This is pretty confusing for
* everybody, I'd much prefer to separate the two functions of
@@ -999,7 +1004,7 @@ st_GetTexImage(struct gl_context * ctx, GLenum target, GLint level,
texImage->Depth = depth;
/* Unmap */
- if (stImage->pt) {
+ if (do_map && stImage->pt) {
st_texture_image_unmap(st, stImage);
texImage->Data = NULL;
}