diff options
author | marha <marha@users.sourceforge.net> | 2011-07-11 09:02:33 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2011-07-11 09:02:33 +0200 |
commit | 4611d27b8966b26b8ac63514a461f31c3172c31c (patch) | |
tree | 5de36cfa4517b997cb703cb1eced374c9db1f2b1 /mesalib/src/mesa/main/readpix.c | |
parent | dbe01a4f78f09723b327d1d8522bfa5026c4f6e0 (diff) | |
parent | 0b43e0b4ddbd9fdac70658164f3dbf653067a4de (diff) | |
download | vcxsrv-4611d27b8966b26b8ac63514a461f31c3172c31c.tar.gz vcxsrv-4611d27b8966b26b8ac63514a461f31c3172c31c.tar.bz2 vcxsrv-4611d27b8966b26b8ac63514a461f31c3172c31c.zip |
Merge remote-tracking branch 'origin/released'
Conflicts:
mesalib/docs/GL3.txt
mesalib/src/glsl/linker.cpp
mesalib/src/mesa/main/depthstencil.c
mesalib/src/mesa/main/fbobject.c
mesalib/src/mesa/main/formats.c
mesalib/src/mesa/main/formats.h
mesalib/src/mesa/main/framebuffer.c
mesalib/src/mesa/main/mtypes.h
mesalib/src/mesa/main/pack.c
mesalib/src/mesa/main/readpix.c
mesalib/src/mesa/main/renderbuffer.c
mesalib/src/mesa/main/samplerobj.c
mesalib/src/mesa/main/shaderapi.c
mesalib/src/mesa/main/texenv.c
mesalib/src/mesa/main/texobj.c
mesalib/src/mesa/main/uniforms.c
mesalib/src/mesa/state_tracker/st_cb_clear.c
mesalib/src/mesa/state_tracker/st_cb_drawpixels.c
mesalib/src/mesa/state_tracker/st_cb_readpixels.c
mesalib/src/mesa/state_tracker/st_extensions.c
mesalib/src/mesa/state_tracker/st_format.c
mesalib/src/mesa/swrast/s_readpix.c
Diffstat (limited to 'mesalib/src/mesa/main/readpix.c')
-rw-r--r-- | mesalib/src/mesa/main/readpix.c | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/mesalib/src/mesa/main/readpix.c b/mesalib/src/mesa/main/readpix.c index e9f5b3c41..ecd9ba1f7 100644 --- a/mesalib/src/mesa/main/readpix.c +++ b/mesalib/src/mesa/main/readpix.c @@ -61,6 +61,14 @@ _mesa_error_check_format_type(struct gl_context *ctx, GLenum format, return GL_TRUE;
}
+ if (ctx->Extensions.ARB_depth_buffer_float
+ && type == GL_FLOAT_32_UNSIGNED_INT_24_8_REV
+ && format != GL_DEPTH_STENCIL_EXT) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "gl%sPixels(format is not GL_DEPTH_STENCIL_EXT)", readDraw);
+ return GL_TRUE;
+ }
+
/* basic combinations test */
if (!_mesa_is_legal_format_and_type(ctx, format, type)) {
_mesa_error(ctx, GL_INVALID_ENUM,
@@ -142,10 +150,23 @@ _mesa_error_check_format_type(struct gl_context *ctx, GLenum format, }
break;
case GL_DEPTH_STENCIL_EXT:
- if (!ctx->Extensions.EXT_packed_depth_stencil ||
- type != GL_UNSIGNED_INT_24_8_EXT) {
- _mesa_error(ctx, GL_INVALID_ENUM, "gl%sPixels(type)", readDraw);
- return GL_TRUE;
+ /* Check validity of the type first. */
+ switch (type) {
+ case GL_UNSIGNED_INT_24_8_EXT:
+ if (!ctx->Extensions.EXT_packed_depth_stencil) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "gl%sPixels(type)", readDraw);
+ return GL_TRUE;
+ }
+ break;
+ case GL_FLOAT_32_UNSIGNED_INT_24_8_REV:
+ if (!ctx->Extensions.ARB_depth_buffer_float) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "gl%sPixels(type)", readDraw);
+ return GL_TRUE;
+ }
+ break;
+ default:
+ _mesa_error(ctx, GL_INVALID_ENUM, "gl%sPixels(type)", readDraw);
+ return GL_TRUE;
}
if ((drawing && !_mesa_dest_buffer_exists(ctx, format)) ||
(reading && !_mesa_source_buffer_exists(ctx, format))) {
|