summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/fbobject.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2005-06-01 00:50:23 +0000
committerBrian Paul <[email protected]>2005-06-01 00:50:23 +0000
commitc7264415b662225a5bdbad3157ecae6b2a3183e2 (patch)
tree748206aee0e4b921cc1b2551ce6663fa7e77b0ba /src/mesa/main/fbobject.c
parent1b93953fbcbeb3c88dc50004a989a3d44d7fd99b (diff)
added code to detect GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT error
Diffstat (limited to 'src/mesa/main/fbobject.c')
-rw-r--r--src/mesa/main/fbobject.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index 89eb03bab4d..6dae796620d 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -339,9 +339,6 @@ test_attachment_completeness(const GLcontext *ctx, GLenum format,
* Status field with the results.
* Also update the framebuffer's Width and Height fields if the
* framebuffer is complete.
- *
- * XXX Need to check for FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT!
- *
*/
void
_mesa_test_framebuffer_completeness(GLcontext *ctx, struct gl_framebuffer *fb)
@@ -351,6 +348,8 @@ _mesa_test_framebuffer_completeness(GLcontext *ctx, struct gl_framebuffer *fb)
GLuint w = 0, h = 0;
GLint i;
+ assert(fb->Name != 0);
+
numImages = 0;
fb->Width = 0;
fb->Height = 0;
@@ -446,6 +445,22 @@ _mesa_test_framebuffer_completeness(GLcontext *ctx, struct gl_framebuffer *fb)
}
}
+ /* Check if any renderbuffer is attached more than once */
+ for (i = 0; i < BUFFER_COUNT - 1; i++) {
+ struct gl_renderbuffer *rb_i = fb->Attachment[i].Renderbuffer;
+ if (rb_i) {
+ GLint j;
+ for (j = i + 1; j < BUFFER_COUNT; j++) {
+ struct gl_renderbuffer *rb_j = fb->Attachment[j].Renderbuffer;
+ if (rb_i == rb_j) {
+ fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT;
+ return;
+ }
+ }
+ }
+ }
+
+
if (numImages == 0) {
fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT;
return;