aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2011-04-04 14:37:16 -0600
committerBrian Paul <[email protected]>2011-04-04 14:37:28 -0600
commitfdb04c0384838d983ccd1bc239dcce2b37ee77f8 (patch)
tree391a37b53acdb5945da398ba82679ccf4acd26e0 /src/mesa/main
parent32a11e5324dcad267d21188ae21bdc8f0b0f29a1 (diff)
mesa: work around failed assertion for GL_RGBA16_SNORM accum buffer
We use this format to represent the accum buffer. No snorm texture sampling or rendering takes place. Fixes failed assertion with swrast and any app using the accum buffer (and glxinfo).
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/renderbuffer.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/mesa/main/renderbuffer.c b/src/mesa/main/renderbuffer.c
index 67ee589d776..e6d5fe4bff1 100644
--- a/src/mesa/main/renderbuffer.c
+++ b/src/mesa/main/renderbuffer.c
@@ -1122,7 +1122,20 @@ _mesa_soft_renderbuffer_storage(struct gl_context *ctx, struct gl_renderbuffer *
rb->Width = width;
rb->Height = height;
rb->_BaseFormat = _mesa_base_fbo_format(ctx, internalFormat);
- ASSERT(rb->_BaseFormat);
+
+ if (rb->Name == 0 &&
+ internalFormat == GL_RGBA16_SNORM &&
+ rb->_BaseFormat == 0) {
+ /* NOTE: This is a special case just for accumulation buffers.
+ * This is a very limited use case- there's no snorm texturing or
+ * rendering going on.
+ */
+ rb->_BaseFormat = GL_RGBA;
+ }
+ else {
+ /* the internalFormat should have been error checked long ago */
+ ASSERT(rb->_BaseFormat);
+ }
return GL_TRUE;
}