summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2010-07-17 15:55:24 +0200
committerMarek Olšák <[email protected]>2010-07-19 17:11:23 +0200
commit4fd39a8d69cade6db5c4a0295a5f5f3014110b1c (patch)
tree504a2b61100d86bb2b1fd8e5e9580dd8b108d38d /src/mesa
parent3750ebd540510324ef5ada769537ae05309adadb (diff)
st/mesa: fix FRAMEBUFFER_UNSUPPORTED with the D24S8 format
Fixes FDO bug #29116. NOTE: this is a candidate for the 7.8 branch
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/state_tracker/st_cb_fbo.c26
1 files changed, 19 insertions, 7 deletions
diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c
index 46f27ced6c3..13119ce2037 100644
--- a/src/mesa/state_tracker/st_cb_fbo.c
+++ b/src/mesa/state_tracker/st_cb_fbo.c
@@ -458,25 +458,37 @@ st_validate_framebuffer(GLcontext *ctx, struct gl_framebuffer *fb)
{
struct st_context *st = st_context(ctx);
struct pipe_screen *screen = st->pipe->screen;
- const struct gl_renderbuffer *depthRb =
- fb->Attachment[BUFFER_DEPTH].Renderbuffer;
- const struct gl_renderbuffer *stencilRb =
- fb->Attachment[BUFFER_STENCIL].Renderbuffer;
+ const struct gl_renderbuffer_attachment *depth =
+ &fb->Attachment[BUFFER_DEPTH];
+ const struct gl_renderbuffer_attachment *stencil =
+ &fb->Attachment[BUFFER_STENCIL];
GLuint i;
- if (stencilRb && depthRb && stencilRb != depthRb) {
+ if (depth->Type && stencil->Type && depth->Type != stencil->Type) {
+ fb->_Status = GL_FRAMEBUFFER_UNSUPPORTED_EXT;
+ return;
+ }
+ if (depth->Type == GL_RENDERBUFFER_EXT &&
+ stencil->Type == GL_RENDERBUFFER_EXT &&
+ depth->Renderbuffer != stencil->Renderbuffer) {
+ fb->_Status = GL_FRAMEBUFFER_UNSUPPORTED_EXT;
+ return;
+ }
+ if (depth->Type == GL_TEXTURE &&
+ stencil->Type == GL_TEXTURE &&
+ depth->Texture != stencil->Texture) {
fb->_Status = GL_FRAMEBUFFER_UNSUPPORTED_EXT;
return;
}
if (!st_validate_attachment(screen,
- &fb->Attachment[BUFFER_DEPTH],
+ depth,
PIPE_BIND_DEPTH_STENCIL)) {
fb->_Status = GL_FRAMEBUFFER_UNSUPPORTED_EXT;
return;
}
if (!st_validate_attachment(screen,
- &fb->Attachment[BUFFER_STENCIL],
+ stencil,
PIPE_BIND_DEPTH_STENCIL)) {
fb->_Status = GL_FRAMEBUFFER_UNSUPPORTED_EXT;
return;