diff options
author | Brian Paul <[email protected]> | 2009-08-05 13:44:59 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2009-08-05 13:44:59 -0600 |
commit | dcebe220f430221821a10944fbdb639a9252bfef (patch) | |
tree | 5806aa764f04e4c86697371b3494b738bd3ec617 /src/mesa/main | |
parent | f792137593b16b850a8a95dbb4859d49effb9f7c (diff) |
mesa: generate GL_INVALID_OPERATION for missing z/stencil when blitting
If glBlitFramebuffer() is called with GL_DEPTH_BUFFER_BIT or
GL_STENCIL_BUFFER_BIT and the src/dst depth/stencil buffers are absent,
report an error.
Diffstat (limited to 'src/mesa/main')
-rw-r--r-- | src/mesa/main/fbobject.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index 83301f1e621..ab91fbc4de9 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -2038,7 +2038,9 @@ _mesa_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, if (mask & GL_STENCIL_BUFFER_BIT) { struct gl_renderbuffer *readRb = readFb->_StencilBuffer; struct gl_renderbuffer *drawRb = drawFb->_StencilBuffer; - if (readRb->StencilBits != drawRb->StencilBits) { + if (!readRb || + !drawRb || + readRb->StencilBits != drawRb->StencilBits) { _mesa_error(ctx, GL_INVALID_OPERATION, "glBlitFramebufferEXT(stencil buffer size mismatch"); return; @@ -2048,7 +2050,9 @@ _mesa_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, if (mask & GL_DEPTH_BUFFER_BIT) { struct gl_renderbuffer *readRb = readFb->_DepthBuffer; struct gl_renderbuffer *drawRb = drawFb->_DepthBuffer; - if (readRb->DepthBits != drawRb->DepthBits) { + if (!readRb || + !drawRb || + readRb->DepthBits != drawRb->DepthBits) { _mesa_error(ctx, GL_INVALID_OPERATION, "glBlitFramebufferEXT(depth buffer size mismatch"); return; |