summaryrefslogtreecommitdiffstats
path: root/src/mesa/swrast
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2009-08-23 23:50:27 +0100
committerKeith Whitwell <[email protected]>2009-08-24 08:26:33 +0100
commit67d4a5b15cfd8583c19a5776b0ec1564b60239eb (patch)
tree0ad76404cfa78c0b4842674b21092e15295020f9 /src/mesa/swrast
parentfd19e8adcd82e88d0fc8d187360b528100fed244 (diff)
mesa/swrast: use one fewer divide in swrast's choose_cube_face also
Same change as for softpipe
Diffstat (limited to 'src/mesa/swrast')
-rw-r--r--src/mesa/swrast/s_texfilter.c8
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];
}