diff options
author | Brian Paul <brianp@vmware.com> | 2009-09-24 10:52:15 -0600 |
---|---|---|
committer | Brian Paul <brianp@vmware.com> | 2009-09-24 10:52:15 -0600 |
commit | 7549a8397b310acf672f97a08c8e7d866cdf492c (patch) | |
tree | 98166a8670ad275f1149dc24bf027cd46e03d32f /src/mesa/swrast | |
parent | a64d4516a0d6219dec0b5b0622215918469faecc (diff) | |
parent | 2acd5de22651a3461c0576107c8e8fab1f01469a (diff) |
Merge branch 'mesa_7_5_branch' into mesa_7_6_branch
Diffstat (limited to 'src/mesa/swrast')
-rw-r--r-- | src/mesa/swrast/s_fragprog.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/mesa/swrast/s_fragprog.c b/src/mesa/swrast/s_fragprog.c index 613a91b0ec..77a77f0bcb 100644 --- a/src/mesa/swrast/s_fragprog.c +++ b/src/mesa/swrast/s_fragprog.c @@ -89,6 +89,8 @@ fetch_texel_lod( GLcontext *ctx, const GLfloat texcoord[4], GLfloat lambda, * Fetch a texel with the given partial derivatives to compute a level * of detail in the mipmap. * Called via machine->FetchTexelDeriv() + * \param lodBias the lod bias which may be specified by a TXB instruction, + * otherwise zero. */ static void fetch_texel_deriv( GLcontext *ctx, const GLfloat texcoord[4], @@ -96,7 +98,8 @@ fetch_texel_deriv( GLcontext *ctx, const GLfloat texcoord[4], GLfloat lodBias, GLuint unit, GLfloat color[4] ) { SWcontext *swrast = SWRAST_CONTEXT(ctx); - const struct gl_texture_object *texObj = ctx->Texture.Unit[unit]._Current; + const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; + const struct gl_texture_object *texObj = texUnit->_Current; if (texObj) { const struct gl_texture_image *texImg = @@ -108,10 +111,12 @@ fetch_texel_deriv( GLcontext *ctx, const GLfloat texcoord[4], lambda = _swrast_compute_lambda(texdx[0], texdy[0], /* ds/dx, ds/dy */ texdx[1], texdy[1], /* dt/dx, dt/dy */ - texdx[3], texdy[2], /* dq/dx, dq/dy */ + texdx[3], texdy[3], /* dq/dx, dq/dy */ texW, texH, texcoord[0], texcoord[1], texcoord[3], - 1.0F / texcoord[3]) + lodBias; + 1.0F / texcoord[3]); + + lambda += lodBias + texUnit->LodBias + texObj->LodBias; lambda = CLAMP(lambda, texObj->MinLod, texObj->MaxLod); |