Mesa (softpipe-opt): mesa/swrast: use one fewer divide in swrast' s choose_cube_face also
Keith Whitwell
keithw at kemper.freedesktop.org
Mon Aug 24 07:48:43 UTC 2009
Module: Mesa
Branch: softpipe-opt
Commit: 67d4a5b15cfd8583c19a5776b0ec1564b60239eb
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=67d4a5b15cfd8583c19a5776b0ec1564b60239eb
Author: Keith Whitwell <keithw at vmware.com>
Date: Sun Aug 23 23:50:27 2009 +0100
mesa/swrast: use one fewer divide in swrast's choose_cube_face also
Same change as for softpipe
---
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 6b1f934..216c107 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];
}
More information about the mesa-commit
mailing list