{
struct gl_context *ctx = &brw->ctx;
GLuint fbo;
+ struct gl_framebuffer *drawFb;
struct gl_renderbuffer *rb;
struct rect rect;
_mesa_meta_begin(ctx, MESA_META_ALL);
_mesa_CreateFramebuffers(1, &fbo);
+
+ drawFb = _mesa_lookup_framebuffer(ctx, fbo);
+ assert(drawFb != NULL && drawFb->Name == fbo);
+
rb = brw_get_rb_for_slice(brw, mt, 0, 0, false);
- _mesa_BindFramebuffer(GL_DRAW_FRAMEBUFFER, fbo);
+ _mesa_bind_framebuffers(ctx, drawFb, ctx->ReadBuffer);
_mesa_framebuffer_renderbuffer(ctx, ctx->DrawBuffer, GL_COLOR_ATTACHMENT0,
rb);
_mesa_DrawBuffer(GL_COLOR_ATTACHMENT0);
struct blit_dims dims = *orig_dims;
struct fb_tex_blit_state blit;
GLuint prog, fbo;
+ struct gl_framebuffer *drawFb;
struct gl_renderbuffer *rb;
GLenum target;
ctx->Extensions.ARB_texture_stencil8 = true;
_mesa_CreateFramebuffers(1, &fbo);
+ drawFb = _mesa_lookup_framebuffer(ctx, fbo);
+ assert(drawFb != NULL && drawFb->Name == fbo);
+
/* Force the surface to be configured for level zero. */
rb = brw_get_rb_for_slice(brw, dst_mt, 0, dst_layer, true);
adjust_msaa(&dims, dst_mt->num_samples);
adjust_tiling(&dims, dst_mt->num_samples);
- _mesa_BindFramebuffer(GL_DRAW_FRAMEBUFFER, fbo);
+ _mesa_bind_framebuffers(ctx, drawFb, ctx->ReadBuffer);
_mesa_framebuffer_renderbuffer(ctx, ctx->DrawBuffer, GL_COLOR_ATTACHMENT0,
rb);
_mesa_DrawBuffer(GL_COLOR_ATTACHMENT0);
.dst_x1 = dst->logical_width0, .dst_y1 = dst->logical_height0,
.mirror_x = 0, .mirror_y = 0 };
GLuint fbo;
+ struct gl_framebuffer *readFb;
struct gl_renderbuffer *rb;
if (dst->stencil_mt)
_mesa_meta_begin(ctx, MESA_META_ALL);
_mesa_CreateFramebuffers(1, &fbo);
+ readFb = _mesa_lookup_framebuffer(ctx, fbo);
+ assert(readFb != NULL && readFb->Name == fbo);
+
rb = brw_get_rb_for_slice(brw, src, 0, 0, false);
- _mesa_BindFramebuffer(GL_READ_FRAMEBUFFER, fbo);
+ _mesa_bind_framebuffers(ctx, ctx->DrawBuffer, readFb);
_mesa_framebuffer_renderbuffer(ctx, ctx->ReadBuffer, GL_STENCIL_ATTACHMENT,
rb);
struct intel_mipmap_tree *dst_mt)
{
struct gl_context *ctx = &brw->ctx;
- GLuint fbos[2], src_fbo, dst_fbo;
+ GLuint fbos[2];
+ struct gl_framebuffer *src_fb;
+ struct gl_framebuffer *dst_fb;
struct gl_renderbuffer *src_rb;
struct gl_renderbuffer *dst_rb;
GLenum drawbuffer;
_mesa_CreateFramebuffers(2, fbos);
src_rb = brw_get_rb_for_slice(brw, src_mt, 0, 0, false);
dst_rb = brw_get_rb_for_slice(brw, dst_mt, 0, 0, false);
- src_fbo = fbos[0];
- dst_fbo = fbos[1];
+ src_fb = _mesa_lookup_framebuffer(ctx, fbos[0]);
+ dst_fb = _mesa_lookup_framebuffer(ctx, fbos[1]);
- _mesa_BindFramebuffer(GL_READ_FRAMEBUFFER, src_fbo);
+ assert(src_fb != NULL && src_fb->Name == fbos[0]);
+ assert(dst_fb != NULL && dst_fb->Name == fbos[1]);
+
+ _mesa_bind_framebuffers(ctx, dst_fb, src_fb);
_mesa_framebuffer_renderbuffer(ctx, ctx->ReadBuffer, attachment, src_rb);
_mesa_ReadBuffer(drawbuffer);
- _mesa_BindFramebuffer(GL_DRAW_FRAMEBUFFER, dst_fbo);
_mesa_framebuffer_renderbuffer(ctx, ctx->DrawBuffer, attachment, dst_rb);
_mesa_DrawBuffer(drawbuffer);