From: Rhys Perry Date: Thu, 18 Jun 2020 15:41:00 +0000 (+0100) Subject: nir: slight correction to cube_face_coord constant folding X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9a389322c444846e22bd2244c8df1c120aa47706;p=mesa.git nir: slight correction to cube_face_coord constant folding ACO does the division with a rcp and then a multiplication. Signed-off-by: Rhys Perry Reviewed-by: Jason Ekstrand Part-of: --- diff --git a/src/compiler/nir/nir_opcodes.py b/src/compiler/nir/nir_opcodes.py index 6a5d025f636..f18668493b2 100644 --- a/src/compiler/nir/nir_opcodes.py +++ b/src/compiler/nir/nir_opcodes.py @@ -487,8 +487,8 @@ if (src0.y < 0 && absY >= absX && absY >= absZ) { dst.x = src0.x; dst.y = -src0. if (src0.z >= 0 && absZ >= absX && absZ >= absY) { dst.x = src0.x; dst.y = -src0.y; } if (src0.z < 0 && absZ >= absX && absZ >= absY) { dst.x = -src0.x; dst.y = -src0.y; } -dst.x = dst.x / ma + 0.5; -dst.y = dst.y / ma + 0.5; +dst.x = dst.x * (1.0f / ma) + 0.5f; +dst.y = dst.y * (1.0f / ma) + 0.5f; """) unop_horiz("cube_face_index", 1, tfloat32, 3, tfloat32, """