diff options
Diffstat (limited to 'src')
-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]; } |