summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/readpix.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2011-11-17 13:56:30 -0800
committerEric Anholt <[email protected]>2011-11-22 13:58:37 -0800
commit755f0a0a02c5cf3be7e69ad51b411711fcc0bc27 (patch)
tree747b719ada5a6c311845a42719c73a9c69325cbf /src/mesa/main/readpix.c
parent250a9c8e7eabd38e38f39898b117f26533609d07 (diff)
mesa: Make formats.c "datatype" values match glGetTexLevelParameter return.
The formats.c code's "datatype" value is "what does this value mean", i.e. unorm or snorm or float, and is the return value from the GL_TEXTURE_RED_TYPE class of queries. The depth formats were marked as GL_UNSIGNED_INT, which is what we use for integer, and not what we should be returning from the glGetTexLevelParameter. In texstore, we were inappropriately using it as an argument to _mesa_unpack_depth_span() that was expecting a value like GL_UNSIGNED_INT or GL_UNSIGNED_SHORT. Just hardcode _mesa_unpack_depth_span()'s arguments for now, though it looks like the consumers of that interface would be happier with using MESA_FORMAT. Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/main/readpix.c')
-rw-r--r--src/mesa/main/readpix.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mesa/main/readpix.c b/src/mesa/main/readpix.c
index 8048a7286df..a7b7ed7f2a7 100644
--- a/src/mesa/main/readpix.c
+++ b/src/mesa/main/readpix.c
@@ -60,7 +60,7 @@ fast_read_depth_pixels( struct gl_context *ctx,
if (packing->SwapBytes)
return GL_FALSE;
- if (_mesa_get_format_datatype(rb->Format) != GL_UNSIGNED_INT)
+ if (_mesa_get_format_datatype(rb->Format) != GL_UNSIGNED_NORMALIZED)
return GL_FALSE;
if (!((type == GL_UNSIGNED_SHORT && rb->Format == MESA_FORMAT_Z16) ||
@@ -381,7 +381,7 @@ fast_read_depth_stencil_pixels_separate(struct gl_context *ctx,
GLubyte *depthMap, *stencilMap;
int depthStride, stencilStride, i, j;
- if (_mesa_get_format_datatype(depthRb->Format) != GL_UNSIGNED_INT)
+ if (_mesa_get_format_datatype(depthRb->Format) != GL_UNSIGNED_NORMALIZED)
return GL_FALSE;
ctx->Driver.MapRenderbuffer(ctx, depthRb, x, y, width, height,