summaryrefslogtreecommitdiff
path: root/src/mesa/main/drawpix.c
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2005-09-28 02:29:50 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2005-09-28 02:29:50 +0000
commit1ad7b99925e044f82e635f746c1ef2df77f69ac9 (patch)
tree7fa22cf8b21a35350191399dcab96db8c0d1e363 /src/mesa/main/drawpix.c
parentb955474093445d6e5b8c5d3cfa69e2752a01bcf8 (diff)
Initial work for GL_EXT_packed_depth_stencil extension.
glReadPixels done, glDrawPixels mostly done.
Diffstat (limited to 'src/mesa/main/drawpix.c')
-rw-r--r--src/mesa/main/drawpix.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/mesa/main/drawpix.c b/src/mesa/main/drawpix.c
index 3ced207247..de62909e7a 100644
--- a/src/mesa/main/drawpix.c
+++ b/src/mesa/main/drawpix.c
@@ -91,12 +91,34 @@ error_check_format_type(GLcontext *ctx, GLenum format, GLenum type,
return GL_TRUE;
}
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;
+ }
+ if (ctx->DrawBuffer->Visual.depthBits == 0 ||
+ ctx->ReadBuffer->Visual.depthBits == 0 ||
+ ctx->DrawBuffer->Visual.stencilBits == 0 ||
+ ctx->ReadBuffer->Visual.stencilBits == 0) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "gl%sPixels(no depth or stencil buffer)", readDraw);
+ return GL_TRUE;
+ }
+ break;
default:
/* this should have been caught in _mesa_is_legal_format_type() */
_mesa_problem(ctx, "unexpected format in _mesa_%sPixels", readDraw);
return GL_TRUE;
}
+ /* XXX might have to move this to the top of the function */
+ if (type == GL_UNSIGNED_INT_24_8_EXT && format != GL_DEPTH_STENCIL_EXT) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "gl%sPixels(format is not GL_DEPTH_STENCIL_EXT)", readDraw);
+ return GL_TRUE;
+ }
+
/* no errors */
return GL_FALSE;
}
@@ -201,6 +223,20 @@ _mesa_CopyPixels( GLint srcx, GLint srcy, GLsizei width, GLsizei height,
return;
}
break;
+ case GL_DEPTH_STENCIL_EXT:
+ if (!ctx->Extensions.EXT_packed_depth_stencil) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glCopyPixels");
+ return;
+ }
+ if (ctx->DrawBuffer->Visual.depthBits == 0 ||
+ ctx->ReadBuffer->Visual.depthBits == 0 ||
+ ctx->DrawBuffer->Visual.stencilBits == 0 ||
+ ctx->ReadBuffer->Visual.stencilBits == 0) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glCopyPixels(no depth or stencil buffer)");
+ return;
+ }
+ break;
default:
_mesa_error(ctx, GL_INVALID_ENUM, "glCopyPixels");
return;