*/
static void
intel_bind_framebuffer(GLcontext * ctx, GLenum target,
- struct gl_framebuffer *fb)
+ struct gl_framebuffer *fb, struct gl_framebuffer *fbread)
{
if (target == GL_FRAMEBUFFER_EXT || target == GL_DRAW_FRAMEBUFFER_EXT) {
intel_draw_buffer(ctx, fb);
}
static void
-nouveauBindFramebuffer(GLcontext *ctx, GLenum target, struct gl_framebuffer *fb)
+nouveauBindFramebuffer(GLcontext *ctx, GLenum target,
+ struct gl_framebuffer *fb, struct gl_framebuffer *fbread)
{
- nouveau_build_framebuffer(ctx, fb);
+ if (target == GL_FRAMEBUFFER_EXT || target == GL_DRAW_FRAMEBUFFER_EXT) {
+ nouveau_build_framebuffer(ctx, fb);
+ }
}
static void
struct gl_framebuffer * (*NewFramebuffer)(GLcontext *ctx, GLuint name);
struct gl_renderbuffer * (*NewRenderbuffer)(GLcontext *ctx, GLuint name);
void (*BindFramebuffer)(GLcontext *ctx, GLenum target,
- struct gl_framebuffer *fb);
+ struct gl_framebuffer *fb, struct gl_framebuffer *fbread);
void (*FramebufferRenderbuffer)(GLcontext *ctx,
struct gl_framebuffer *fb,
GLenum attachment,
void GLAPIENTRY
_mesa_BindFramebufferEXT(GLenum target, GLuint framebuffer)
{
- struct gl_framebuffer *newFb;
+ struct gl_framebuffer *newFb, *newFbread;
GLboolean bindReadBuf, bindDrawBuf;
GET_CURRENT_CONTEXT(ctx);
}
_mesa_HashInsert(ctx->Shared->FrameBuffers, framebuffer, newFb);
}
+ newFbread = newFb;
}
else {
/* Binding the window system framebuffer (which was originally set
* with MakeCurrent).
*/
newFb = ctx->WinSysDrawBuffer;
+ newFbread = ctx->WinSysReadBuffer;
}
ASSERT(newFb);
*/
if (bindReadBuf) {
- _mesa_reference_framebuffer(&ctx->ReadBuffer, newFb);
+ _mesa_reference_framebuffer(&ctx->ReadBuffer, newFbread);
}
if (bindDrawBuf) {
}
if (ctx->Driver.BindFramebuffer) {
- ctx->Driver.BindFramebuffer(ctx, target, newFb);
+ ctx->Driver.BindFramebuffer(ctx, target, newFb, newFbread);
}
}