mesa: Handle updating texture state for buffer textures.
authorEric Anholt <eric@anholt.net>
Tue, 27 Mar 2012 16:51:24 +0000 (09:51 -0700)
committerEric Anholt <eric@anholt.net>
Mon, 9 Apr 2012 21:34:33 +0000 (14:34 -0700)
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@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/main/texobj.c
src/mesa/main/texstate.c

index 88dc3b195e7e406781b36713477d9ac98599b8e0..d7e631efddbbaaaf69ec42990f8f646885d3a4f6 100644 (file)
@@ -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.
     */
index ee778ffd0475fcadb976d3a0ff9c1a6e427415b6..8ca9092ce010b24f26c4fc4933aeda4e8c6a13a9 100644 (file)
@@ -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.