aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main/fbobject.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2013-03-28 01:56:01 +0100
committerMarek Olšák <[email protected]>2013-04-06 23:57:06 +0200
commit755648c37fc7a54ed0b11c868fd4c7fe28b2f861 (patch)
treeaf74440ff60de156f3f19b7ddcea229b686a063c /src/mesa/main/fbobject.c
parent21d407c1b8bf3be1eff87121d528d03c240ce207 (diff)
mesa: don't set _ClampFragmentColor to TRUE if it has no effect
This should reduce shader recompilations with drivers that emulate fragment color clamping, because we want the clamping to be enabled only if there is a signed normalized or floating-point colorbuffer. Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/main/fbobject.c')
-rw-r--r--src/mesa/main/fbobject.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index 67c116163db..fc2b2620bbf 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -785,6 +785,7 @@ _mesa_test_framebuffer_completeness(struct gl_context *ctx,
fb->Width = 0;
fb->Height = 0;
fb->_AllColorBuffersFixedPoint = GL_TRUE;
+ fb->_HasSNormOrFloatColorBuffer = GL_FALSE;
/* Start at -2 to more easily loop over all attachment points.
* -2: depth buffer
@@ -901,13 +902,17 @@ _mesa_test_framebuffer_completeness(struct gl_context *ctx,
/* check if integer color */
fb->_IntegerColor = _mesa_is_format_integer_color(attFormat);
- /* Update _AllColorBuffersFixedPoint. */
+ /* Update _AllColorBuffersFixedPoint and _HasSNormOrFloatColorBuffer. */
if (i >= 0) {
GLenum type = _mesa_get_format_datatype(attFormat);
fb->_AllColorBuffersFixedPoint =
fb->_AllColorBuffersFixedPoint &&
(type == GL_UNSIGNED_NORMALIZED || type == GL_SIGNED_NORMALIZED);
+
+ fb->_HasSNormOrFloatColorBuffer =
+ fb->_HasSNormOrFloatColorBuffer ||
+ type == GL_SIGNED_NORMALIZED || type == GL_FLOAT;
}
/* Error-check width, height, format */