Mesa (master): llvmpipe: Use single precision divide for one over area computation.

Jose Fonseca jrfonseca at kemper.freedesktop.org
Wed Aug 11 14:23:13 UTC 2010


Module: Mesa
Branch: master
Commit: 3deca2e284f0709e94bec5267febc7ccb34c17b8
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=3deca2e284f0709e94bec5267febc7ccb34c17b8

Author: José Fonseca <jfonseca at vmware.com>
Date:   Wed Aug 11 15:09:54 2010 +0100

llvmpipe: Use single precision divide for one over area computation.

---

 src/gallium/drivers/llvmpipe/lp_setup_tri.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/gallium/drivers/llvmpipe/lp_setup_tri.c b/src/gallium/drivers/llvmpipe/lp_setup_tri.c
index 7e43250..44696c7 100644
--- a/src/gallium/drivers/llvmpipe/lp_setup_tri.c
+++ b/src/gallium/drivers/llvmpipe/lp_setup_tri.c
@@ -525,7 +525,7 @@ do_triangle_ccw(struct lp_setup_context *setup,
    info.dx20 = info.v2[0][0] - info.v0[0][0];
    info.dy01 = info.v0[0][1] - info.v1[0][1];
    info.dy20 = info.v2[0][1] - info.v0[0][1];
-   info.oneoverarea = 1.0 / (info.dx01 * info.dy20 - info.dx20 * info.dy01);
+   info.oneoverarea = 1.0f / (info.dx01 * info.dy20 - info.dx20 * info.dy01);
    info.frontfacing = frontfacing;
 
    /* Setup parameter interpolants:




More information about the mesa-commit mailing list