Mesa (10.2): meta: Add a new MESA_META_DRAW_BUFFERS bit.

Ian Romanick idr at kemper.freedesktop.org
Wed May 7 16:51:05 UTC 2014


Module: Mesa
Branch: 10.2
Commit: ffc0cc027a5cbc2e688ee1fba16e8ff12eac8486
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ffc0cc027a5cbc2e688ee1fba16e8ff12eac8486

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Mon May  5 14:03:46 2014 -0700

meta: Add a new MESA_META_DRAW_BUFFERS bit.

This will be used for saving/restoring the glDrawBuffers state.
For now, make sure that existing users of MESA_META_ALL don't get
the new bit, since they probably won't want it.

Cc: "10.2" <mesa-stable at lists.freedesktop.org>
Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat at gmail.com>
Reviewed-by: Eric Anholt <eric at anholt.net>
(cherry picked from commit e526ebf35c113d59eb0b860e492c1308d3862ee9)

---

 src/mesa/drivers/common/meta.c                 |    5 +++--
 src/mesa/drivers/common/meta.h                 |    1 +
 src/mesa/drivers/common/meta_blit.c            |    2 +-
 src/mesa/drivers/common/meta_generate_mipmap.c |    2 +-
 4 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
index 7b700c2..36150a5 100644
--- a/src/mesa/drivers/common/meta.c
+++ b/src/mesa/drivers/common/meta.c
@@ -2723,7 +2723,7 @@ copytexsubimage_using_blit_framebuffer(struct gl_context *ctx, GLuint dims,
 
    _mesa_unlock_texture(ctx, texObj);
 
-   _mesa_meta_begin(ctx, MESA_META_ALL);
+   _mesa_meta_begin(ctx, MESA_META_ALL & ~MESA_META_DRAW_BUFFERS);
 
    _mesa_GenFramebuffers(1, &fbo);
    _mesa_BindFramebuffer(GL_DRAW_FRAMEBUFFER, fbo);
@@ -2945,7 +2945,8 @@ decompress_texture_image(struct gl_context *ctx,
       break;
    }
 
-   _mesa_meta_begin(ctx, MESA_META_ALL & ~MESA_META_PIXEL_STORE);
+   _mesa_meta_begin(ctx, MESA_META_ALL & ~(MESA_META_PIXEL_STORE |
+                                           MESA_META_DRAW_BUFFERS));
 
    samplerSave = ctx->Texture.Unit[ctx->Texture.CurrentUnit].Sampler ?
          ctx->Texture.Unit[ctx->Texture.CurrentUnit].Sampler->Name : 0;
diff --git a/src/mesa/drivers/common/meta.h b/src/mesa/drivers/common/meta.h
index 0a34792..99f1123 100644
--- a/src/mesa/drivers/common/meta.h
+++ b/src/mesa/drivers/common/meta.h
@@ -58,6 +58,7 @@
 #define MESA_META_MULTISAMPLE          0x100000
 #define MESA_META_FRAMEBUFFER_SRGB     0x200000
 #define MESA_META_OCCLUSION_QUERY      0x400000
+#define MESA_META_DRAW_BUFFERS         0x800000
 /**\}*/
 
 /**
diff --git a/src/mesa/drivers/common/meta_blit.c b/src/mesa/drivers/common/meta_blit.c
index 5d72dd2..c3dc146 100644
--- a/src/mesa/drivers/common/meta_blit.c
+++ b/src/mesa/drivers/common/meta_blit.c
@@ -659,7 +659,7 @@ _mesa_meta_BlitFramebuffer(struct gl_context *ctx,
    /* Only scissor affects blit, but we're doing to set a custom scissor if
     * necessary anyway, so save/clear state.
     */
-   _mesa_meta_begin(ctx, MESA_META_ALL);
+   _mesa_meta_begin(ctx, MESA_META_ALL & ~MESA_META_DRAW_BUFFERS);
 
    /* If the clipping earlier changed the destination rect at all, then
     * enable the scissor to clip to it.
diff --git a/src/mesa/drivers/common/meta_generate_mipmap.c b/src/mesa/drivers/common/meta_generate_mipmap.c
index 3c9ac89..d12806c 100644
--- a/src/mesa/drivers/common/meta_generate_mipmap.c
+++ b/src/mesa/drivers/common/meta_generate_mipmap.c
@@ -182,7 +182,7 @@ _mesa_meta_GenerateMipmap(struct gl_context *ctx, GLenum target,
       faceTarget = target;
    }
 
-   _mesa_meta_begin(ctx, MESA_META_ALL);
+   _mesa_meta_begin(ctx, MESA_META_ALL & ~MESA_META_DRAW_BUFFERS);
 
    /* Choose between glsl version and fixed function version of
     * GenerateMipmap function.




More information about the mesa-commit mailing list