diff options
author | Keith Whitwell <[email protected]> | 2009-08-23 23:50:27 +0100 |
---|---|---|
committer | Keith Whitwell <[email protected]> | 2009-08-24 08:26:33 +0100 |
commit | 67d4a5b15cfd8583c19a5776b0ec1564b60239eb (patch) | |
tree | 0ad76404cfa78c0b4842674b21092e15295020f9 /src/mesa | |
parent | fd19e8adcd82e88d0fc8d187360b528100fed244 (diff) |
mesa/swrast: use one fewer divide in swrast's choose_cube_face also
Same change as for softpipe
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/swrast/s_texfilter.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/mesa/swrast/s_texfilter.c b/src/mesa/swrast/s_texfilter.c index 6b1f9346475..216c107e3f3 100644 --- a/src/mesa/swrast/s_texfilter.c +++ b/src/mesa/swrast/s_texfilter.c @@ -1905,8 +1905,12 @@ choose_cube_face(const struct gl_texture_object *texObj, } } - newCoord[0] = ( sc / ma + 1.0F ) * 0.5F; - newCoord[1] = ( tc / ma + 1.0F ) * 0.5F; + { + const float ima = 1.0F / ma; + newCoord[0] = ( sc * ima + 1.0F ) * 0.5F; + newCoord[1] = ( tc * ima + 1.0F ) * 0.5F; + } + return (const struct gl_texture_image **) texObj->Image[face]; } |