summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/fbobject.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2016-10-10 11:29:14 -0600
committerBrian Paul <[email protected]>2016-10-13 17:38:49 -0600
commitff00ab745c9a9d6ef35239ea656a5db0c76de52d (patch)
tree0ea17a68c9eeafdb5d43b2ebaf8105ca1a131a92 /src/mesa/main/fbobject.c
parenta710c21ac200fc1c80a6209862e837f0a75f4cc5 (diff)
mesa: replace gl_framebuffer::_IntegerColor wih _IntegerBuffers
Use a bitmask to indicate which color buffers are integer-valued, rather than a bool. Also, the old field was mis-computed. If an integer buffer was followed by a non-integer buffer, the _IntegerColor field was wrongly set to false. This fixes the new piglit gl-3.1-mixed-int-float-fbo test. Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/mesa/main/fbobject.c')
-rw-r--r--src/mesa/main/fbobject.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index 3b55e79f4a0..9204606c670 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -970,6 +970,7 @@ _mesa_test_framebuffer_completeness(struct gl_context *ctx,
fb->_AllColorBuffersFixedPoint = GL_TRUE;
fb->_HasSNormOrFloatColorBuffer = GL_FALSE;
fb->_HasAttachments = true;
+ fb->_IntegerBuffers = 0;
/* Start at -2 to more easily loop over all attachment points.
* -2: depth buffer
@@ -1090,13 +1091,14 @@ _mesa_test_framebuffer_completeness(struct gl_context *ctx,
continue;
}
- /* check if integer color */
- fb->_IntegerColor = _mesa_is_format_integer_color(attFormat);
-
- /* Update _AllColorBuffersFixedPoint and _HasSNormOrFloatColorBuffer. */
+ /* Update flags describing color buffer datatypes */
if (i >= 0) {
GLenum type = _mesa_get_format_datatype(attFormat);
+ /* check if integer color */
+ if (_mesa_is_format_integer_color(attFormat))
+ fb->_IntegerBuffers |= (1 << i);
+
fb->_AllColorBuffersFixedPoint =
fb->_AllColorBuffersFixedPoint &&
(type == GL_UNSIGNED_NORMALIZED || type == GL_SIGNED_NORMALIZED);