meta/decompress: Track renderbuffer using gl_renderbuffer instead of GL API object...
authorIan Romanick <ian.d.romanick@intel.com>
Thu, 12 Nov 2015 17:26:41 +0000 (09:26 -0800)
committerIan Romanick <ian.d.romanick@intel.com>
Wed, 10 Feb 2016 18:59:50 +0000 (10:59 -0800)
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
src/mesa/drivers/common/meta.c
src/mesa/drivers/common/meta.h

index b42a3cf16aec28e2be4b3d9a9aeeec5556e0e372..217d376281f39640d3d9bd2f4c18c9230f6bed0f 100644 (file)
@@ -2962,7 +2962,7 @@ meta_decompress_fbo_cleanup(struct decompress_fbo_state *decompress_fbo)
 {
    if (decompress_fbo->FBO != 0) {
       _mesa_DeleteFramebuffers(1, &decompress_fbo->FBO);
-      _mesa_DeleteRenderbuffers(1, &decompress_fbo->RBO);
+      _mesa_DeleteRenderbuffers(1, &decompress_fbo->rb->Name);
    }
 
    memset(decompress_fbo, 0, sizeof(*decompress_fbo));
@@ -3065,14 +3065,19 @@ decompress_texture_image(struct gl_context *ctx,
 
    /* Create/bind FBO/renderbuffer */
    if (decompress_fbo->FBO == 0) {
-      _mesa_CreateRenderbuffers(1, &decompress_fbo->RBO);
+      GLuint RBO;
+
+      _mesa_CreateRenderbuffers(1, &RBO);
+
+      decompress_fbo->rb = _mesa_lookup_renderbuffer(ctx, RBO);
+      assert(decompress_fbo->rb != NULL && decompress_fbo->rb->Name == RBO);
 
       _mesa_GenFramebuffers(1, &decompress_fbo->FBO);
       _mesa_BindFramebuffer(GL_FRAMEBUFFER_EXT, decompress_fbo->FBO);
       _mesa_FramebufferRenderbuffer(GL_FRAMEBUFFER_EXT,
                                        GL_COLOR_ATTACHMENT0_EXT,
                                        GL_RENDERBUFFER_EXT,
-                                       decompress_fbo->RBO);
+                                       decompress_fbo->rb->Name);
    }
    else {
       _mesa_BindFramebuffer(GL_FRAMEBUFFER_EXT, decompress_fbo->FBO);
@@ -3080,7 +3085,7 @@ decompress_texture_image(struct gl_context *ctx,
 
    /* alloc dest surface */
    if (width > decompress_fbo->Width || height > decompress_fbo->Height) {
-      _mesa_NamedRenderbufferStorage(decompress_fbo->RBO, rbFormat,
+      _mesa_NamedRenderbufferStorage(decompress_fbo->rb->Name, rbFormat,
                                      width, height);
       status = _mesa_CheckFramebufferStatus(GL_DRAW_FRAMEBUFFER);
       if (status != GL_FRAMEBUFFER_COMPLETE) {
index 3ff0fdddb59a4bd4a9c96acd1280435ab01caf3a..7a120b6c44bf34b4d297d8655b3beeb4acc09de5 100644 (file)
@@ -380,7 +380,8 @@ struct gen_mipmap_state
  */
 struct decompress_fbo_state
 {
-   GLuint FBO, RBO;
+   struct gl_renderbuffer *rb;
+   GLuint FBO;
    GLint Width, Height;
 };