diff options
author | Brian Paul <[email protected]> | 2009-11-02 15:29:03 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2009-11-03 09:52:25 -0700 |
commit | 18af75e5011cc31b52d62befba2cacfd353ce638 (patch) | |
tree | 2e4df73fcea3ef080289f0ceacce7e43c806b4fa /src/mesa/main/fbobject.c | |
parent | c7048f9d9f91ef8c3ef35e31976adbf686349c41 (diff) |
mesa: avoid extraneous _NEW_BUFFER changes in _mesa_BindFramebufferEXT()
Diffstat (limited to 'src/mesa/main/fbobject.c')
-rw-r--r-- | src/mesa/main/fbobject.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index 4c6528bcf78..4229ede8c00 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -1228,8 +1228,6 @@ _mesa_BindFramebufferEXT(GLenum target, GLuint framebuffer) return; } - FLUSH_CURRENT(ctx, _NEW_BUFFERS); - if (framebuffer) { /* Binding a user-created framebuffer object */ newFb = _mesa_lookup_framebuffer(ctx, framebuffer); @@ -1268,12 +1266,14 @@ _mesa_BindFramebufferEXT(GLenum target, GLuint framebuffer) /* * OK, now bind the new Draw/Read framebuffers, if they're changing. */ - if (bindReadBuf) { - if (ctx->ReadBuffer == newFbread) + if (ctx->ReadBuffer == newFbread) { bindReadBuf = GL_FALSE; /* no change */ - else + } + else { + FLUSH_VERTICES(ctx, _NEW_BUFFERS); _mesa_reference_framebuffer(&ctx->ReadBuffer, newFbread); + } } if (bindDrawBuf) { @@ -1282,10 +1282,13 @@ _mesa_BindFramebufferEXT(GLenum target, GLuint framebuffer) check_end_texture_render(ctx, ctx->DrawBuffer); } - if (ctx->DrawBuffer == newFb) + if (ctx->DrawBuffer == newFb) { bindDrawBuf = GL_FALSE; /* no change */ - else + } + else { + FLUSH_VERTICES(ctx, _NEW_BUFFERS); _mesa_reference_framebuffer(&ctx->DrawBuffer, newFb); + } if (newFb->Name != 0) { /* check if newly bound framebuffer has any texture attachments */ |