--- /home/alex/checkouts/xserver/xorg-git/mesa/src/mesa/main/texstate.c 2009-01-05 11:04:16.000000000 -0500 +++ mesa/src/mesa/main/texstate.c 2009-01-08 13:16:40.000000000 -0500 @@ -521,6 +522,7 @@ * complete. That's the one we'll use for texturing. If we're using * a fragment program we're guaranteed that bitcount(enabledBits) <= 1. */ +#if 0 texture_override(ctx, texUnit, enableBits, texUnit->Current2DArray, TEXTURE_2D_ARRAY_BIT); texture_override(ctx, texUnit, enableBits, @@ -535,6 +537,30 @@ texUnit->Current2D, TEXTURE_2D_BIT); texture_override(ctx, texUnit, enableBits, texUnit->Current1D, TEXTURE_1D_BIT); +#endif +#define DEBUG_TEXTURE_OVERRIDE(c, tu, eb, to, type) \ +do { \ +if (to != NULL) { \ + texture_override(c, tu, eb, to, type); \ +} else { \ + _mesa_problem(c, "invalid texture object " # to);\ +} \ +} while(0) + DEBUG_TEXTURE_OVERRIDE(ctx, texUnit, enableBits, + texUnit->Current2DArray, TEXTURE_2D_ARRAY_BIT); + DEBUG_TEXTURE_OVERRIDE(ctx, texUnit, enableBits, + texUnit->Current1DArray, TEXTURE_1D_ARRAY_BIT); + DEBUG_TEXTURE_OVERRIDE(ctx, texUnit, enableBits, + texUnit->CurrentCubeMap, TEXTURE_CUBE_BIT); + DEBUG_TEXTURE_OVERRIDE(ctx, texUnit, enableBits, + texUnit->Current3D, TEXTURE_3D_BIT); + DEBUG_TEXTURE_OVERRIDE(ctx, texUnit, enableBits, + texUnit->CurrentRect, TEXTURE_RECT_BIT); + DEBUG_TEXTURE_OVERRIDE(ctx, texUnit, enableBits, + texUnit->Current2D, TEXTURE_2D_BIT); + DEBUG_TEXTURE_OVERRIDE(ctx, texUnit, enableBits, + texUnit->Current1D, TEXTURE_1D_BIT); + if (!texUnit->_ReallyEnabled) { continue;