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/drawpix.c | |
parent | b955474093445d6e5b8c5d3cfa69e2752a01bcf8 (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.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/mesa/main/drawpix.c b/src/mesa/main/drawpix.c index 3ced2072478..de62909e7a0 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; |