mesa: use correct tex unit lod bias for TXB instruction
authorBrian Paul <brianp@vmware.com>
Thu, 2 Apr 2009 00:50:07 +0000 (18:50 -0600)
committerBrian Paul <brianp@vmware.com>
Thu, 2 Apr 2009 00:50:07 +0000 (18:50 -0600)
src/mesa/shader/prog_execute.c

index a60cda674bad25bf02611977ca4eb0d19bf0a7ff..0bc8d5f6a79a5f115f8c1fe5c2305c25ddf81000 100644 (file)
@@ -1540,8 +1540,8 @@ _mesa_execute_program(GLcontext * ctx,
       case OPCODE_TXB:         /* GL_ARB_fragment_program only */
          /* Texel lookup with LOD bias */
          {
-            const struct gl_texture_unit *texUnit
-               = &ctx->Texture.Unit[inst->TexSrcUnit];
+            const GLuint unit = machine->Samplers[inst->TexSrcUnit];
+            const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
             GLfloat texcoord[4], color[4], lodBias;
 
             fetch_vector4(&inst->SrcReg[0], machine, texcoord);