aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/fbobject.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-03-08 08:31:07 +0000
committermarha <marha@users.sourceforge.net>2011-03-08 08:31:07 +0000
commit62f8e1becaed544f600e167508fe76bc953d647e (patch)
tree175c3d80e16613dbe92a497836bf685d1324803d /mesalib/src/mesa/main/fbobject.c
parentb1236880df6cbd13760a2adfaff9c22a89501d66 (diff)
parent8c74e7257ed453143c53086f884f6c6ff585379a (diff)
downloadvcxsrv-62f8e1becaed544f600e167508fe76bc953d647e.tar.gz
vcxsrv-62f8e1becaed544f600e167508fe76bc953d647e.tar.bz2
vcxsrv-62f8e1becaed544f600e167508fe76bc953d647e.zip
svn merge ^/branches/released .
Diffstat (limited to 'mesalib/src/mesa/main/fbobject.c')
-rw-r--r--mesalib/src/mesa/main/fbobject.c36
1 files changed, 30 insertions, 6 deletions
diff --git a/mesalib/src/mesa/main/fbobject.c b/mesalib/src/mesa/main/fbobject.c
index 7f26e0f97..0bffbcfae 100644
--- a/mesalib/src/mesa/main/fbobject.c
+++ b/mesalib/src/mesa/main/fbobject.c
@@ -384,6 +384,7 @@ _mesa_framebuffer_renderbuffer(struct gl_context *ctx,
assert(att);
_mesa_set_renderbuffer_attachment(ctx, att, rb);
}
+ rb->AttachedAnytime = GL_TRUE;
}
else {
_mesa_remove_attachment(ctx, att);
@@ -1115,6 +1116,31 @@ _mesa_base_fbo_format(struct gl_context *ctx, GLenum internalFormat)
}
+/**
+ * Invalidate a renderbuffer attachment. Called from _mesa_HashWalk().
+ */
+static void
+invalidate_rb(GLuint key, void *data, void *userData)
+{
+ struct gl_framebuffer *fb = (struct gl_framebuffer *) data;
+ struct gl_renderbuffer *rb = (struct gl_renderbuffer *) userData;
+
+ /* If this is a user-created FBO */
+ if (fb->Name) {
+ GLuint i;
+ for (i = 0; i < BUFFER_COUNT; i++) {
+ struct gl_renderbuffer_attachment *att = fb->Attachment + i;
+ if (att->Type == GL_RENDERBUFFER &&
+ att->Renderbuffer == rb) {
+ /* Mark fb status as indeterminate to force re-validation */
+ fb->_Status = 0;
+ return;
+ }
+ }
+ }
+}
+
+
/** sentinal value, see below */
#define NO_SAMPLES 1000
@@ -1207,12 +1233,10 @@ renderbuffer_storage(GLenum target, GLenum internalFormat,
rb->NumSamples = 0;
}
- /*
- test_framebuffer_completeness(ctx, fb);
- */
- /* XXX if this renderbuffer is attached anywhere, invalidate attachment
- * points???
- */
+ /* Invalidate the framebuffers the renderbuffer is attached in. */
+ if (rb->AttachedAnytime) {
+ _mesa_HashWalk(ctx->Shared->FrameBuffers, invalidate_rb, rb);
+ }
}