aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2015-11-13 17:21:38 -0800
committerIan Romanick <[email protected]>2016-03-01 11:07:20 -0800
commit91e5825b8af38109b3a58a0be28749859d2516a3 (patch)
tree89366dd3a6900309625cc0bfab90e847f7b6ff31
parent3ed44fab1811a2112d3b10233640b5aa369b2d21 (diff)
meta/decompress: Track framebuffer using gl_framebuffer instead of GL API object handle
Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Topi Pohjolainen <[email protected]>
-rw-r--r--src/mesa/drivers/common/meta.c17
-rw-r--r--src/mesa/drivers/common/meta.h2
2 files changed, 12 insertions, 7 deletions
diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
index 6a133c9b5e6..bf03563954e 100644
--- a/src/mesa/drivers/common/meta.c
+++ b/src/mesa/drivers/common/meta.c
@@ -2945,8 +2945,8 @@ _mesa_meta_CopyTexSubImage(struct gl_context *ctx, GLuint dims,
static void
meta_decompress_fbo_cleanup(struct decompress_fbo_state *decompress_fbo)
{
- if (decompress_fbo->FBO != 0) {
- _mesa_DeleteFramebuffers(1, &decompress_fbo->FBO);
+ if (decompress_fbo->fb != NULL) {
+ _mesa_DeleteFramebuffers(1, &decompress_fbo->fb->Name);
_mesa_reference_renderbuffer(&decompress_fbo->rb, NULL);
}
@@ -3049,7 +3049,9 @@ decompress_texture_image(struct gl_context *ctx,
ctx->Texture.Unit[ctx->Texture.CurrentUnit].Sampler);
/* Create/bind FBO/renderbuffer */
- if (decompress_fbo->FBO == 0) {
+ if (decompress_fbo->fb == NULL) {
+ GLuint FBO;
+
decompress_fbo->rb = ctx->Driver.NewRenderbuffer(ctx, 0xDEADBEEF);
if (decompress_fbo->rb == NULL) {
_mesa_meta_end(ctx);
@@ -3058,13 +3060,16 @@ decompress_texture_image(struct gl_context *ctx,
decompress_fbo->rb->RefCount = 1;
- _mesa_CreateFramebuffers(1, &decompress_fbo->FBO);
- _mesa_BindFramebuffer(GL_FRAMEBUFFER_EXT, decompress_fbo->FBO);
+ _mesa_CreateFramebuffers(1, &FBO);
+ decompress_fbo->fb = _mesa_lookup_framebuffer(ctx, FBO);
+ assert(decompress_fbo->fb != NULL && decompress_fbo->fb->Name == FBO);
+
+ _mesa_bind_framebuffers(ctx, decompress_fbo->fb, decompress_fbo->fb);
_mesa_framebuffer_renderbuffer(ctx, ctx->DrawBuffer, GL_COLOR_ATTACHMENT0,
decompress_fbo->rb);
}
else {
- _mesa_BindFramebuffer(GL_FRAMEBUFFER_EXT, decompress_fbo->FBO);
+ _mesa_bind_framebuffers(ctx, decompress_fbo->fb, decompress_fbo->fb);
}
/* alloc dest surface */
diff --git a/src/mesa/drivers/common/meta.h b/src/mesa/drivers/common/meta.h
index b2c550f89de..60ae5f7577f 100644
--- a/src/mesa/drivers/common/meta.h
+++ b/src/mesa/drivers/common/meta.h
@@ -382,7 +382,7 @@ struct gen_mipmap_state
struct decompress_fbo_state
{
struct gl_renderbuffer *rb;
- GLuint FBO;
+ struct gl_framebuffer *fb;
GLint Width, Height;
};