diff options
author | Albert Astals Cid <[email protected]> | 2020-02-26 19:33:47 +0100 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-02-26 21:47:01 +0000 |
commit | d98806117226b64001a1e99387431419e174ad4b (patch) | |
tree | d77b08b4769e1c3dbeb02e2f31ef613e631a4dd6 /src/compiler | |
parent | 6db7467b59932fd11e828d7a99de0f23f49aecb9 (diff) |
cube_face_index: Use fabsf instead of fabs since we know it's floats
Reviewed-by: Kristian H. Kristensen <[email protected]>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3933>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3933>
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/nir/nir_opcodes.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/compiler/nir/nir_opcodes.py b/src/compiler/nir/nir_opcodes.py index 9e335445a31..d116578d1c0 100644 --- a/src/compiler/nir/nir_opcodes.py +++ b/src/compiler/nir/nir_opcodes.py @@ -488,9 +488,9 @@ dst.y = dst.y / ma + 0.5; """) unop_horiz("cube_face_index", 1, tfloat32, 3, tfloat32, """ -float absX = fabs(src0.x); -float absY = fabs(src0.y); -float absZ = fabs(src0.z); +float absX = fabsf(src0.x); +float absY = fabsf(src0.y); +float absZ = fabsf(src0.z); if (src0.x >= 0 && absX >= absY && absX >= absZ) dst.x = 0; if (src0.x < 0 && absX >= absY && absX >= absZ) dst.x = 1; if (src0.y >= 0 && absY >= absX && absY >= absZ) dst.x = 2; |