summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2012-02-09 09:20:08 -0700
committerBrian Paul <[email protected]>2012-02-10 08:08:39 -0700
commitd925b0d4a72147d3bc34e7ba068d48179be93021 (patch)
treed1d6e88fc66dd5659d0dfa4cc23adaa47304cdac /src
parent3e59fb570ae82d988a90d341d1ffdd5c3ece1aa4 (diff)
mesa: fix proxy texture target initialization
The mapping from TEXTURE_x_INDEX to GL_TEXTURE_x was broken in alloc_proxy_textures() because the elements in the targets[] array were in the wrong order. This didn't actually cause any failures since we never really use the proxy texture's Target field. But let's get it right. NOTE: This is a candidate for the 8.0 branch.
Diffstat (limited to 'src')
-rw-r--r--src/mesa/main/texstate.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c
index 8e9537faefc..cc49916a92c 100644
--- a/src/mesa/main/texstate.c
+++ b/src/mesa/main/texstate.c
@@ -682,20 +682,25 @@ _mesa_update_texture( struct gl_context *ctx, GLuint new_state )
static GLboolean
alloc_proxy_textures( struct gl_context *ctx )
{
+ /* NOTE: these values must be in the same order as the TEXTURE_x_INDEX
+ * values!
+ */
static const GLenum targets[] = {
- GL_TEXTURE_1D,
- GL_TEXTURE_2D,
- GL_TEXTURE_3D,
+ GL_TEXTURE_BUFFER,
+ GL_TEXTURE_2D_ARRAY_EXT,
+ GL_TEXTURE_1D_ARRAY_EXT,
+ GL_TEXTURE_EXTERNAL_OES,
GL_TEXTURE_CUBE_MAP_ARB,
+ GL_TEXTURE_3D,
GL_TEXTURE_RECTANGLE_NV,
- GL_TEXTURE_1D_ARRAY_EXT,
- GL_TEXTURE_2D_ARRAY_EXT,
- GL_TEXTURE_BUFFER,
- GL_TEXTURE_EXTERNAL_OES
+ GL_TEXTURE_2D,
+ GL_TEXTURE_1D,
};
GLint tgt;
STATIC_ASSERT(Elements(targets) == NUM_TEXTURE_TARGETS);
+ assert(targets[TEXTURE_2D_INDEX] == GL_TEXTURE_2D);
+ assert(targets[TEXTURE_CUBE_INDEX] == GL_TEXTURE_CUBE_MAP);
for (tgt = 0; tgt < NUM_TEXTURE_TARGETS; tgt++) {
if (!(ctx->Texture.ProxyTex[tgt]