From: Brian Paul Date: Sat, 13 Sep 2008 21:21:58 +0000 (-0600) Subject: gallium: add another value check to util_fast_pow() X-Git-Tag: 062012170305~17580^2~496^2~711 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=809e81c0b424839cb742ff2502b1010c0258b368;p=profile%2Fivi%2Fmesa.git gallium: add another value check to util_fast_pow() Fixes glitches seen in morph3d demo. --- diff --git a/src/gallium/auxiliary/util/u_math.h b/src/gallium/auxiliary/util/u_math.h index 9b4ca39..0b10622 100644 --- a/src/gallium/auxiliary/util/u_math.h +++ b/src/gallium/auxiliary/util/u_math.h @@ -272,8 +272,10 @@ util_fast_log2(float val) static INLINE float util_fast_pow(float x, float y) { - /* XXX this test may need adjustment */ - if (y >= 3.0 && -0.02f <= x && x <= 0.02f) + /* XXX these tests may need adjustment */ + if (y >= 3.0f && (-0.02f <= x && x <= 0.02f)) + return 0.0f; + if (y >= 50.0f && (-0.9f <= x && x <= 0.9f)) return 0.0f; return util_fast_exp2(util_fast_log2(x) * y); }