check if _Current == NULL for TXB

This commit is contained in:
Brian
2007-01-08 16:49:43 -07:00
parent 8cad795a80
commit 41a4e828d9

View File

@@ -1358,6 +1358,8 @@ execute_program( GLcontext *ctx,
case OPCODE_TXB: /* GL_ARB_fragment_program only */ case OPCODE_TXB: /* GL_ARB_fragment_program only */
/* Texel lookup with LOD bias */ /* Texel lookup with LOD bias */
{ {
const struct gl_texture_unit *texUnit
= &ctx->Texture.Unit[inst->TexSrcUnit];
GLfloat coord[4], color[4], lambda, bias; GLfloat coord[4], color[4], lambda, bias;
if (inst->SrcReg[0].File == PROGRAM_INPUT && if (inst->SrcReg[0].File == PROGRAM_INPUT &&
inst->SrcReg[0].Index == FRAG_ATTRIB_TEX0+inst->TexSrcUnit) inst->SrcReg[0].Index == FRAG_ATTRIB_TEX0+inst->TexSrcUnit)
@@ -1366,9 +1368,9 @@ execute_program( GLcontext *ctx,
lambda = 0.0; lambda = 0.0;
fetch_vector4(ctx, &inst->SrcReg[0], machine, program, coord); fetch_vector4(ctx, &inst->SrcReg[0], machine, program, coord);
/* coord[3] is the bias to add to lambda */ /* coord[3] is the bias to add to lambda */
bias = ctx->Texture.Unit[inst->TexSrcUnit].LodBias bias = texUnit->LodBias + coord[3];
+ ctx->Texture.Unit[inst->TexSrcUnit]._Current->LodBias if (texUnit->_Current)
+ coord[3]; bias += texUnit->_Current->LodBias;
fetch_texel(ctx, coord, lambda + bias, inst->TexSrcUnit, color); fetch_texel(ctx, coord, lambda + bias, inst->TexSrcUnit, color);
store_vector4( inst, machine, color ); store_vector4( inst, machine, color );
} }