mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-01 06:50:22 +01:00
gallium: add another value check to util_fast_pow()
Fixes glitches seen in morph3d demo.
This commit is contained in:
parent
44e53b37a0
commit
75c19eb5a1
1 changed files with 4 additions and 2 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue