diff options
author | Marek Olšák <[email protected]> | 2012-06-15 02:00:36 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2012-06-16 14:20:27 +0200 |
commit | c760283159dbf3607b0f072b0d1ff50859feb3f4 (patch) | |
tree | 4393f07b44e03e4730db91d00f4fafa29f7e7ee5 /src/mesa/state_tracker | |
parent | e4b2e6b5270644c267892fae07d919b494cc4397 (diff) |
st/mesa: make unsupported renderbuffer formats always fail as FBO incomplete
instead of failing to allocate a renderbuffer.
This also fixes piglit/get-renderbuffer-internalformat with non-renderable
formats.
Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r-- | src/mesa/state_tracker/st_cb_fbo.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c index 01269998453..88c6fa2da96 100644 --- a/src/mesa/state_tracker/st_cb_fbo.c +++ b/src/mesa/state_tracker/st_cb_fbo.c @@ -81,10 +81,13 @@ st_renderbuffer_alloc_sw_storage(struct gl_context * ctx, } else { format = st_choose_renderbuffer_format(screen, internalFormat, 0); - } - if (format == PIPE_FORMAT_NONE) { - return FALSE; + /* Not setting gl_renderbuffer::Format here will cause + * FRAMEBUFFER_UNSUPPORTED and ValidateFramebuffer will not be called. + */ + if (format == PIPE_FORMAT_NONE) { + return GL_TRUE; + } } strb->Base.Format = st_pipe_format_to_mesa_format(format); @@ -133,8 +136,11 @@ st_renderbuffer_alloc_storage(struct gl_context * ctx, format = st_choose_renderbuffer_format(screen, internalFormat, rb->NumSamples); + /* Not setting gl_renderbuffer::Format here will cause + * FRAMEBUFFER_UNSUPPORTED and ValidateFramebuffer will not be called. + */ if (format == PIPE_FORMAT_NONE) { - return FALSE; + return GL_TRUE; } strb->Base.Format = st_pipe_format_to_mesa_format(format); |