mesa: compute _IntegerColor field in _mesa_test_framebuffer_completeness()
authorBrian Paul <brianp@vmware.com>
Sat, 23 Oct 2010 15:38:45 +0000 (09:38 -0600)
committerBrian Paul <brianp@vmware.com>
Sat, 23 Oct 2010 16:19:30 +0000 (10:19 -0600)
src/mesa/main/fbobject.c

index 0425fb619c0b9f32aa5de95cfe685a10d9cd2228..5826d2d2192d987021e3265fc3806ff2e032dde4 100644 (file)
@@ -617,6 +617,7 @@ _mesa_test_framebuffer_completeness(struct gl_context *ctx,
    for (i = -2; i < (GLint) ctx->Const.MaxColorAttachments; i++) {
       struct gl_renderbuffer_attachment *att;
       GLenum f;
+      gl_format mesaFormat;
 
       /*
        * XXX for ARB_fbo, only check color buffers that are named by
@@ -663,6 +664,7 @@ _mesa_test_framebuffer_completeness(struct gl_context *ctx,
          minHeight = MIN2(minHeight, texImg->Height);
          maxHeight = MAX2(maxHeight, texImg->Height);
          f = texImg->_BaseFormat;
+         mesaFormat = texImg->TexFormat;
          numImages++;
          if (!is_legal_color_format(ctx, f) &&
              !is_legal_depth_format(ctx, f)) {
@@ -677,6 +679,7 @@ _mesa_test_framebuffer_completeness(struct gl_context *ctx,
          minHeight = MIN2(minHeight, att->Renderbuffer->Height);
          maxHeight = MAX2(minHeight, att->Renderbuffer->Height);
          f = att->Renderbuffer->InternalFormat;
+         mesaFormat = att->Renderbuffer->Format;
          numImages++;
       }
       else {
@@ -689,6 +692,9 @@ _mesa_test_framebuffer_completeness(struct gl_context *ctx,
          numSamples = att->Renderbuffer->NumSamples;
       }
 
+      /* check if integer color */
+      fb->_IntegerColor = _mesa_is_format_integer(mesaFormat);
+
       /* Error-check width, height, format, samples
        */
       if (numImages == 1) {