meta: Use _mesa_check_framebuffer_status instead of _mesa_CheckFramebufferStatus
authorIan Romanick <ian.d.romanick@intel.com>
Fri, 13 Nov 2015 01:18:53 +0000 (17:18 -0800)
committerIan Romanick <ian.d.romanick@intel.com>
Tue, 1 Mar 2016 19:07:19 +0000 (11:07 -0800)
sed -i -e 's/_mesa_CheckFramebufferStatus(GL_DRAW_FRAMEBUFFER/_mesa_check_framebuffer_status(ctx, ctx->DrawBuffer/' \
    -e 's/_mesa_CheckFramebufferStatus(GL_FRAMEBUFFER[^)]*/_mesa_check_framebuffer_status(ctx, ctx->DrawBuffer/' \
    -e 's/_mesa_CheckFramebufferStatus(GL_READ_FRAMEBUFFER/_mesa_check_framebuffer_status(ctx, ctx->ReadBuffer/' \
    $(grep -rl _mesa_CheckFramebufferStatus src/mesa/drivers)

The second expression catches both GL_FRAMEBUFFER and GL_FRAMEBUFFER_EXT.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
src/mesa/drivers/common/meta.c
src/mesa/drivers/common/meta_copy_image.c
src/mesa/drivers/common/meta_generate_mipmap.c
src/mesa/drivers/common/meta_tex_subimage.c

index b62f0d4feef4e37de343231ec3614a9aa60ac197..c99a2203cf205f994e5d78402d21c805469f5693 100644 (file)
@@ -2821,7 +2821,7 @@ copytexsubimage_using_blit_framebuffer(struct gl_context *ctx, GLuint dims,
       _mesa_DrawBuffer(GL_COLOR_ATTACHMENT0);
    }
 
-   status = _mesa_CheckFramebufferStatus(GL_DRAW_FRAMEBUFFER);
+   status = _mesa_check_framebuffer_status(ctx, ctx->DrawBuffer);
    if (status != GL_FRAMEBUFFER_COMPLETE)
       goto out;
 
@@ -3068,7 +3068,7 @@ decompress_texture_image(struct gl_context *ctx,
    if (width > decompress_fbo->Width || height > decompress_fbo->Height) {
       _mesa_renderbuffer_storage(ctx, decompress_fbo->rb, rbFormat,
                                  width, height, 0);
-      status = _mesa_CheckFramebufferStatus(GL_DRAW_FRAMEBUFFER);
+      status = _mesa_check_framebuffer_status(ctx, ctx->DrawBuffer);
       if (status != GL_FRAMEBUFFER_COMPLETE) {
          /* If the framebuffer isn't complete then we'll leave
           * decompress_fbo->Width as zero so that it will fail again next time
@@ -3419,7 +3419,7 @@ cleartexsubimage_color(struct gl_context *ctx,
                                         GL_COLOR_ATTACHMENT0,
                                         texImage, zoffset);
 
-   status = _mesa_CheckFramebufferStatus(GL_DRAW_FRAMEBUFFER);
+   status = _mesa_check_framebuffer_status(ctx, ctx->DrawBuffer);
    if (status != GL_FRAMEBUFFER_COMPLETE)
       return false;
 
@@ -3472,7 +3472,7 @@ cleartexsubimage_depth_stencil(struct gl_context *ctx,
                                            GL_STENCIL_ATTACHMENT,
                                            texImage, zoffset);
 
-   status = _mesa_CheckFramebufferStatus(GL_DRAW_FRAMEBUFFER);
+   status = _mesa_check_framebuffer_status(ctx, ctx->DrawBuffer);
    if (status != GL_FRAMEBUFFER_COMPLETE)
       return false;
 
index 67fd283a86c108032d27a368733a47620782e412..02963dc4f7dd3bf0740ee9bd00db5d3b242e947c 100644 (file)
@@ -245,7 +245,7 @@ _mesa_meta_CopyImageSubData_uncompressed(struct gl_context *ctx,
                                      src_renderbuffer);
    }
 
-   status = _mesa_CheckFramebufferStatus(GL_READ_FRAMEBUFFER);
+   status = _mesa_check_framebuffer_status(ctx, ctx->ReadBuffer);
    if (status != GL_FRAMEBUFFER_COMPLETE)
       goto meta_end;
 
@@ -257,7 +257,7 @@ _mesa_meta_CopyImageSubData_uncompressed(struct gl_context *ctx,
                                            dst_tex_image, dst_z);
    }
 
-   status = _mesa_CheckFramebufferStatus(GL_DRAW_FRAMEBUFFER);
+   status = _mesa_check_framebuffer_status(ctx, ctx->DrawBuffer);
    if (status != GL_FRAMEBUFFER_COMPLETE)
       goto meta_end;
 
index d7db0909573a7296e6655530ef6d83af65409a02..9369e845c178f4b9b08a39b7a06b0f354d408421 100644 (file)
@@ -116,7 +116,7 @@ fallback_required(struct gl_context *ctx, GLenum target,
    _mesa_meta_framebuffer_texture_image(ctx, ctx->DrawBuffer,
                                         GL_COLOR_ATTACHMENT0, baseImage, 0);
 
-   status = _mesa_CheckFramebufferStatus(fbo_target);
+   status = _mesa_check_framebuffer_status(ctx, ctx->DrawBuffer);
 
    _mesa_BindFramebuffer(fbo_target, fboSave);
 
@@ -360,7 +360,7 @@ _mesa_meta_GenerateMipmap(struct gl_context *ctx, GLenum target,
                                               layer);
 
          /* sanity check */
-         if (_mesa_CheckFramebufferStatus(GL_FRAMEBUFFER) !=
+         if (_mesa_check_framebuffer_status(ctx, ctx->DrawBuffer) !=
              GL_FRAMEBUFFER_COMPLETE) {
             _mesa_problem(ctx, "Unexpected incomplete framebuffer in "
                           "_mesa_meta_GenerateMipmap()");
index 9e8210dedc4fc44fb521c236d52b38482dac026d..01c0152c551397bbaa96676d9639e8d986ed54f2 100644 (file)
@@ -243,7 +243,7 @@ _mesa_meta_pbo_TexSubImage(struct gl_context *ctx, GLuint dims,
                                         GL_COLOR_ATTACHMENT0,
                                         pbo_tex_image, 0);
    /* If this passes on the first layer it should pass on the others */
-   status = _mesa_CheckFramebufferStatus(GL_READ_FRAMEBUFFER);
+   status = _mesa_check_framebuffer_status(ctx, ctx->ReadBuffer);
    if (status != GL_FRAMEBUFFER_COMPLETE)
       goto fail;
 
@@ -251,7 +251,7 @@ _mesa_meta_pbo_TexSubImage(struct gl_context *ctx, GLuint dims,
                                         GL_COLOR_ATTACHMENT0,
                                         tex_image, zoffset);
    /* If this passes on the first layer it should pass on the others */
-   status = _mesa_CheckFramebufferStatus(GL_DRAW_FRAMEBUFFER);
+   status = _mesa_check_framebuffer_status(ctx, ctx->DrawBuffer);
    if (status != GL_FRAMEBUFFER_COMPLETE)
       goto fail;
 
@@ -385,7 +385,7 @@ _mesa_meta_pbo_GetTexSubImage(struct gl_context *ctx, GLuint dims,
                                            GL_COLOR_ATTACHMENT0,
                                            tex_image, zoffset);
       /* If this passes on the first layer it should pass on the others */
-      status = _mesa_CheckFramebufferStatus(GL_READ_FRAMEBUFFER);
+      status = _mesa_check_framebuffer_status(ctx, ctx->ReadBuffer);
       if (status != GL_FRAMEBUFFER_COMPLETE)
          goto fail;
    } else {
@@ -397,7 +397,7 @@ _mesa_meta_pbo_GetTexSubImage(struct gl_context *ctx, GLuint dims,
                                         GL_COLOR_ATTACHMENT0,
                                         pbo_tex_image, 0);
    /* If this passes on the first layer it should pass on the others */
-   status = _mesa_CheckFramebufferStatus(GL_DRAW_FRAMEBUFFER);
+   status = _mesa_check_framebuffer_status(ctx, ctx->DrawBuffer);
    if (status != GL_FRAMEBUFFER_COMPLETE)
       goto fail;