/*======================================================================
* brw_misc_state.c
*/
-GLuint brw_get_rb_for_slice(struct brw_context *brw,
- struct intel_mipmap_tree *mt,
- unsigned level, unsigned layer, bool flat);
+struct gl_renderbuffer *brw_get_rb_for_slice(struct brw_context *brw,
+ struct intel_mipmap_tree *mt,
+ unsigned level, unsigned layer,
+ bool flat);
void brw_meta_updownsample(struct brw_context *brw,
struct intel_mipmap_tree *src,
struct intel_mipmap_tree *mt)
{
struct gl_context *ctx = &brw->ctx;
- GLuint fbo, rbo;
+ GLuint fbo;
+ struct gl_renderbuffer *rb;
struct rect rect;
brw_emit_mi_flush(brw);
_mesa_meta_begin(ctx, MESA_META_ALL);
_mesa_GenFramebuffers(1, &fbo);
- rbo = brw_get_rb_for_slice(brw, mt, 0, 0, false);
+ rb = brw_get_rb_for_slice(brw, mt, 0, 0, false);
_mesa_BindFramebuffer(GL_DRAW_FRAMEBUFFER, fbo);
_mesa_FramebufferRenderbuffer(GL_DRAW_FRAMEBUFFER,
GL_COLOR_ATTACHMENT0,
- GL_RENDERBUFFER, rbo);
+ GL_RENDERBUFFER, rb->Name);
_mesa_DrawBuffer(GL_COLOR_ATTACHMENT0);
brw_fast_clear_init(brw);
set_fast_clear_op(brw, 0);
use_rectlist(brw, false);
- _mesa_DeleteRenderbuffers(1, &rbo);
+ _mesa_DeleteRenderbuffers(1, &rb->Name);
_mesa_DeleteFramebuffers(1, &fbo);
_mesa_meta_end(ctx);
struct gl_context *ctx = &brw->ctx;
struct blit_dims dims = *orig_dims;
struct fb_tex_blit_state blit;
- GLuint prog, fbo, rbo;
+ GLuint prog, fbo;
+ struct gl_renderbuffer *rb;
GLenum target;
_mesa_meta_fb_tex_blit_begin(ctx, &blit);
_mesa_GenFramebuffers(1, &fbo);
/* Force the surface to be configured for level zero. */
- rbo = brw_get_rb_for_slice(brw, dst_mt, 0, dst_layer, true);
+ 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_FramebufferRenderbuffer(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
- GL_RENDERBUFFER, rbo);
+ GL_RENDERBUFFER, rb->Name);
_mesa_DrawBuffer(GL_COLOR_ATTACHMENT0);
ctx->DrawBuffer->_Status = GL_FRAMEBUFFER_COMPLETE;
_mesa_meta_fb_tex_blit_end(ctx, target, &blit);
_mesa_meta_end(ctx);
- _mesa_DeleteRenderbuffers(1, &rbo);
+ _mesa_DeleteRenderbuffers(1, &rb->Name);
_mesa_DeleteFramebuffers(1, &fbo);
}
.dst_x0 = 0, .dst_y0 = 0,
.dst_x1 = dst->logical_width0, .dst_y1 = dst->logical_height0,
.mirror_x = 0, .mirror_y = 0 };
- GLuint fbo, rbo;
+ GLuint fbo;
+ struct gl_renderbuffer *rb;
if (dst->stencil_mt)
dst = dst->stencil_mt;
_mesa_meta_begin(ctx, MESA_META_ALL);
_mesa_GenFramebuffers(1, &fbo);
- rbo = brw_get_rb_for_slice(brw, src, 0, 0, false);
+ rb = brw_get_rb_for_slice(brw, src, 0, 0, false);
_mesa_BindFramebuffer(GL_READ_FRAMEBUFFER, fbo);
_mesa_FramebufferRenderbuffer(GL_READ_FRAMEBUFFER, GL_STENCIL_ATTACHMENT,
- GL_RENDERBUFFER, rbo);
+ GL_RENDERBUFFER, rb->Name);
brw_meta_stencil_blit(brw, dst, 0, 0, &dims);
brw_emit_mi_flush(brw);
- _mesa_DeleteRenderbuffers(1, &rbo);
+ _mesa_DeleteRenderbuffers(1, &rb->Name);
_mesa_DeleteFramebuffers(1, &fbo);
}
*
* Clobbers the current renderbuffer binding (ctx->CurrentRenderbuffer).
*/
-GLuint
+struct gl_renderbuffer *
brw_get_rb_for_slice(struct brw_context *brw,
struct intel_mipmap_tree *mt,
unsigned level, unsigned layer, bool flat)
intel_miptree_reference(&irb->mt, mt);
- return rbo;
+ return rb;
}
/**
struct intel_mipmap_tree *dst_mt)
{
struct gl_context *ctx = &brw->ctx;
- GLuint fbos[2], src_rbo, dst_rbo, src_fbo, dst_fbo;
+ GLuint fbos[2], src_fbo, dst_fbo;
+ struct gl_renderbuffer *src_rb;
+ struct gl_renderbuffer *dst_rb;
GLenum drawbuffer;
GLbitfield attachment, blit_bit;
_mesa_meta_begin(ctx, MESA_META_ALL);
_mesa_GenFramebuffers(2, fbos);
- src_rbo = brw_get_rb_for_slice(brw, src_mt, 0, 0, false);
- dst_rbo = brw_get_rb_for_slice(brw, dst_mt, 0, 0, false);
+ 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];
_mesa_BindFramebuffer(GL_READ_FRAMEBUFFER, src_fbo);
_mesa_FramebufferRenderbuffer(GL_READ_FRAMEBUFFER, attachment,
- GL_RENDERBUFFER, src_rbo);
+ GL_RENDERBUFFER, src_rb->Name);
_mesa_ReadBuffer(drawbuffer);
_mesa_BindFramebuffer(GL_DRAW_FRAMEBUFFER, dst_fbo);
_mesa_FramebufferRenderbuffer(GL_DRAW_FRAMEBUFFER, attachment,
- GL_RENDERBUFFER, dst_rbo);
+ GL_RENDERBUFFER, dst_rb->Name);
_mesa_DrawBuffer(drawbuffer);
_mesa_BlitFramebuffer(0, 0,
dst_mt->logical_width0, dst_mt->logical_height0,
blit_bit, GL_NEAREST);
- _mesa_DeleteRenderbuffers(1, &src_rbo);
- _mesa_DeleteRenderbuffers(1, &dst_rbo);
+ _mesa_DeleteRenderbuffers(1, &src_rb->Name);
+ _mesa_DeleteRenderbuffers(1, &dst_rb->Name);
_mesa_DeleteFramebuffers(2, fbos);
_mesa_meta_end(ctx);