diff options
Diffstat (limited to 'src/mesa/main/framebuffer.c')
-rw-r--r-- | src/mesa/main/framebuffer.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/mesa/main/framebuffer.c b/src/mesa/main/framebuffer.c index 430e013d017..66c9bd91096 100644 --- a/src/mesa/main/framebuffer.c +++ b/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; @@ -1061,12 +1073,12 @@ _mesa_print_framebuffer(const struct gl_framebuffer *fb) for (i = 0; i < BUFFER_COUNT; i++) { const struct gl_renderbuffer_attachment *att = &fb->Attachment[i]; if (att->Type == GL_TEXTURE) { - const struct gl_texture_image *texImage; + const struct gl_texture_image *texImage = + _mesa_get_attachment_teximage_const(att); fprintf(stderr, " %2d: Texture %u, level %u, face %u, slice %u, complete %d\n", i, att->Texture->Name, att->TextureLevel, att->CubeMapFace, att->Zoffset, att->Complete); - texImage = att->Texture->Image[att->CubeMapFace][att->TextureLevel]; fprintf(stderr, " Size: %u x %u x %u Format %s\n", texImage->Width, texImage->Height, texImage->Depth, _mesa_get_format_name(texImage->TexFormat)); |