summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuca Barbieri <luca@luca-barbieri.com>2010-08-25 01:35:42 +0200
committerLuca Barbieri <luca@luca-barbieri.com>2010-09-05 18:01:36 +0200
commit123bb110852739dffadcc81ad80b005b1c4f586d (patch)
treea0cdd48b832f4b85ddac9f3037cdfa733b1bcf26
parentde26f9e47e886e176aab6e5a2c3d4481efb64362 (diff)
mesa: compute floatMode for FBOs and return it on RGBA_FLOAT_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 },