diff options
Diffstat (limited to 'mesalib/src/mesa/main/framebuffer.c')
-rw-r--r-- | mesalib/src/mesa/main/framebuffer.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/mesalib/src/mesa/main/framebuffer.c b/mesalib/src/mesa/main/framebuffer.c index b741c51ab..6acfa7660 100644 --- a/mesalib/src/mesa/main/framebuffer.c +++ b/mesalib/src/mesa/main/framebuffer.c @@ -551,7 +551,6 @@ _mesa_update_framebuffer_visual(struct gl_context *ctx, fb->Visual.alphaBits = _mesa_get_format_bits(fmt, GL_ALPHA_BITS);
fb->Visual.rgbBits = fb->Visual.redBits
+ fb->Visual.greenBits + fb->Visual.blueBits;
- fb->Visual.floatMode = GL_FALSE;
fb->Visual.samples = rb->NumSamples;
if (_mesa_get_format_color_encoding(fmt) == GL_SRGB)
fb->Visual.sRGBCapable = ctx->Const.sRGBCapable;
@@ -560,6 +559,19 @@ _mesa_update_framebuffer_visual(struct gl_context *ctx, }
}
+ fb->Visual.floatMode = GL_FALSE;
+ for (i = 0; i < BUFFER_COUNT; i++) {
+ if (fb->Attachment[i].Renderbuffer) {
+ const struct gl_renderbuffer *rb = fb->Attachment[i].Renderbuffer;
+ const gl_format fmt = rb->Format;
+
+ if (_mesa_get_format_datatype(fmt) == GL_FLOAT) {
+ fb->Visual.floatMode = GL_TRUE;
+ break;
+ }
+ }
+ }
+
if (fb->Attachment[BUFFER_DEPTH].Renderbuffer) {
const struct gl_renderbuffer *rb =
fb->Attachment[BUFFER_DEPTH].Renderbuffer;
|