Mesa (master): cube_face_coord: Use fabsf instead of fabs since we know it's floats

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Feb 26 22:08:18 UTC 2020


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

Author: Albert Astals Cid <aacid at kde.org>
Date:   Tue Feb 25 00:36:44 2020 +0100

cube_face_coord: Use fabsf instead of fabs since we know it's floats

Reviewed-by: Kristian H. Kristensen <hoegsberg at google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3933>

---

 src/compiler/nir/nir_opcodes.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/compiler/nir/nir_opcodes.py b/src/compiler/nir/nir_opcodes.py
index f83b8300d18..9e335445a31 100644
--- a/src/compiler/nir/nir_opcodes.py
+++ b/src/compiler/nir/nir_opcodes.py
@@ -467,9 +467,9 @@ for i in range(1, 5):
 # AMD_gcn_shader extended instructions
 unop_horiz("cube_face_coord", 2, tfloat32, 3, tfloat32, """
 dst.x = dst.y = 0.0;
-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);
 
 float ma = 0.0;
 if (absX >= absY && absX >= absZ) { ma = 2 * src0.x; }



More information about the mesa-commit mailing list