}
+/**
+ * Mark the given framebuffer as invalid. This will force the
+ * test for framebuffer completeness to be done before the framebuffer
+ * is used.
+ */
+static void
+invalidate_framebuffer(struct gl_framebuffer *fb)
+{
+ fb->_Status = 0; /* "indeterminate" */
+}
+
+
/**
* Given a GL_*_ATTACHMENTn token, return a pointer to the corresponding
* gl_renderbuffer_attachment object.
if (att->Texture->Image[att->CubeMapFace][att->TextureLevel]) {
ctx->Driver.RenderTexture(ctx, fb, att);
}
+
+ invalidate_framebuffer(fb);
}
_mesa_remove_attachment(ctx, att);
}
+ invalidate_framebuffer(fb);
+
_glthread_UNLOCK_MUTEX(fb->Mutex);
}
continue;
}
+ if (numSamples < 0) {
+ /* first buffer */
+ numSamples = att->Renderbuffer->NumSamples;
+ }
+
/* Error-check width, height, format, samples
*/
if (numImages == 1) {
/* save format, num samples */
if (i >= 0) {
intFormat = f;
- numSamples = att->Renderbuffer->NumSamples;
}
}
else {
}
if (att->Renderbuffer &&
att->Renderbuffer->NumSamples != numSamples) {
+ fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE;
fbo_incomplete("inconsistant number of samples", i);
return;
}
_mesa_remove_attachment(ctx, &fb->Attachment[i]);
}
}
+ invalidate_framebuffer(fb);
}
FLUSH_VERTICES(ctx, _NEW_BUFFERS);
- _mesa_test_framebuffer_completeness(ctx, buffer);
+ if (buffer->_Status != GL_FRAMEBUFFER_COMPLETE) {
+ _mesa_test_framebuffer_completeness(ctx, buffer);
+ }
+
return buffer->_Status;
}
else {
_mesa_remove_attachment(ctx, att);
}
+
+ invalidate_framebuffer(fb);
+
_glthread_UNLOCK_MUTEX(fb->Mutex);
}
/* This is a user-created framebuffer.
* Completeness only matters for user-created framebuffers.
*/
- _mesa_test_framebuffer_completeness(ctx, fb);
- _mesa_update_framebuffer_visual(fb);
+ if (fb->_Status != GL_FRAMEBUFFER_COMPLETE) {
+ _mesa_test_framebuffer_completeness(ctx, fb);
+ _mesa_update_framebuffer_visual(fb);
+ }
}
/* Strictly speaking, we don't need to update the draw-state