Mesa (master): mesa: Handle updating texture state for buffer textures.

Eric Anholt anholt at kemper.freedesktop.org
Mon Apr 9 21:50:34 UTC 2012


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

Author: Eric Anholt <eric at anholt.net>
Date:   Tue Mar 27 09:51:24 2012 -0700

mesa: Handle updating texture state for buffer textures.

We have to skip some work that wants to look at texture images, since
buffer textures don't have any of that complexity.

Reviewed-by: Dave Airlie <airlied at redhat.com>
Reviewed-by: Brian Paul <brianp at vmware.com>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

---

 src/mesa/main/texobj.c   |    8 ++++++++
 src/mesa/main/texstate.c |    4 ++++
 2 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c
index 88dc3b1..d7e631e 100644
--- a/src/mesa/main/texobj.c
+++ b/src/mesa/main/texobj.c
@@ -449,6 +449,14 @@ _mesa_test_texobj_completeness( const struct gl_context *ctx,
    t->_BaseComplete = GL_TRUE;
    t->_MipmapComplete = GL_TRUE;
 
+   if (t->Target == GL_TEXTURE_BUFFER) {
+      /* Buffer textures are always considered complete.  The obvious case where
+       * they would be incomplete (no BO attached) is actually specced to be
+       * undefined rendering results.
+       */
+      return;
+   }
+
    /* Detect cases where the application set the base level to an invalid
     * value.
     */
diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c
index ee778ff..8ca9092 100644
--- a/src/mesa/main/texstate.c
+++ b/src/mesa/main/texstate.c
@@ -390,6 +390,10 @@ update_tex_combine(struct gl_context *ctx, struct gl_texture_unit *texUnit)
 {
    struct gl_tex_env_combine_state *combine;
 
+   /* No combiners will apply to this. */
+   if (texUnit->_Current->Target == GL_TEXTURE_BUFFER)
+      return;
+
    /* Set the texUnit->_CurrentCombine field to point to the user's combiner
     * state, or the combiner state which is derived from traditional texenv
     * mode.




More information about the mesa-commit mailing list