summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mesa/main/framebuffer.c13
-rw-r--r--src/mesa/main/get.c3
2 files changed, 15 insertions, 1 deletions
diff --git a/src/mesa/main/framebuffer.c b/src/mesa/main/framebuffer.c
index a98c09cfbf..efae9fed5d 100644
--- a/src/mesa/main/framebuffer.c
+++ b/src/mesa/main/framebuffer.c
@@ -551,13 +551,24 @@ _mesa_update_framebuffer_visual(struct gl_framebuffer *fb)
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;
break;
}
}
}
+ 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 GLenum baseFormat = _mesa_get_format_base_format(rb->Format);
+ const gl_format fmt = rb->Format;
+
+ if(_mesa_get_format_datatype(fmt) == GL_FLOAT)
+ fb->Visual.floatMode = GL_TRUE;
+ }
+ }
+
if (fb->Attachment[BUFFER_DEPTH].Renderbuffer) {
const struct gl_renderbuffer *rb =
fb->Attachment[BUFFER_DEPTH].Renderbuffer;
diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index 5dc71159e3..0786f80f86 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -1247,6 +1247,9 @@ static const struct value_desc values[] = {
CONTEXT_INT(Const.GeometryProgram.MaxVertexVaryingComponents),
extra_ARB_geometry_shader4 },
+ /* GL_ARB_color_buffer_float */
+ { GL_RGBA_FLOAT_MODE_ARB, BUFFER_FIELD(Visual.floatMode, TYPE_BOOLEAN), 0 },
+
/* GL 3.0 */
{ GL_NUM_EXTENSIONS, LOC_CUSTOM, TYPE_INT, 0, extra_version_30 },
{ GL_MAJOR_VERSION, CONTEXT_INT(VersionMajor), extra_version_30 },