From: Keith Whitwell Date: Sun, 23 Aug 2009 22:50:27 +0000 (+0100) Subject: mesa/swrast: use one fewer divide in swrast's choose_cube_face also X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=67d4a5b15cfd8583c19a5776b0ec1564b60239eb;p=mesa.git mesa/swrast: use one fewer divide in swrast's choose_cube_face also Same change as for softpipe --- 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]; }