From 1ab225017ed1ea8bd9e266d10ee56ab914bb28c1 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 1 Apr 2009 18:50:07 -0600 Subject: mesa: use correct tex unit lod bias for TXB instruction --- src/mesa/shader/prog_execute.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mesa/shader/prog_execute.c') diff --git a/src/mesa/shader/prog_execute.c b/src/mesa/shader/prog_execute.c index a60cda674b..0bc8d5f6a7 100644 --- a/src/mesa/shader/prog_execute.c +++ b/src/mesa/shader/prog_execute.c @@ -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); -- cgit v1.2.3 From b8a200ac9d11c09646de9b7d3f3f64a742c6abe3 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 3 Apr 2009 10:29:11 -0600 Subject: mesa: for OPCODE_LIT, use _mesa_pow() instead of exp() and log() Also, s/pow/_mesa_pow/ --- src/mesa/shader/prog_execute.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mesa/shader/prog_execute.c') diff --git a/src/mesa/shader/prog_execute.c b/src/mesa/shader/prog_execute.c index 0bc8d5f6a7..bdac1d4f8a 100644 --- a/src/mesa/shader/prog_execute.c +++ b/src/mesa/shader/prog_execute.c @@ -836,7 +836,7 @@ _mesa_execute_program(GLcontext * ctx, * result.z = result.x * APPX(result.y) * We do what the ARB extension says. */ - q[2] = (GLfloat) pow(2.0, t[0]); + q[2] = (GLfloat) _mesa_pow(2.0, t[0]); } q[1] = t[0] - floor_t0; q[3] = 1.0F; @@ -949,7 +949,7 @@ _mesa_execute_program(GLcontext * ctx, if (a[1] == 0.0 && a[3] == 0.0) result[2] = 1.0; else - result[2] = EXPF(a[3] * LOGF(a[1])); + result[2] = (GLfloat) _mesa_pow(a[1], a[3]); } else { result[2] = 0.0; -- cgit v1.2.3