Mesa (main): u_math: Reduce fast-log2 table size from 65k entries back to 256.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Jun 4 17:56:09 UTC 2021


Module: Mesa
Branch: main
Commit: 9cd4b8b73c1c4995aa16b813dc0c6f1ce458f302
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=9cd4b8b73c1c4995aa16b813dc0c6f1ce458f302

Author: Emma Anholt <emma at anholt.net>
Date:   Thu Jun  3 12:03:36 2021 -0700

u_math: Reduce fast-log2 table size from 65k entries back to 256.

This was bumped in 7e584a70c492 ("gallium: increase table size for fast
log/pow functions") presumably to fix conformance of tgsi_exec, but we
don't need that much accuracy in the only place it's used in the tree any
more: softpipe texture sampling.

softpipe glmark2 -b texture:texture-filter=linear FPS +0.335748% +/-
0.220111% (n=20)

Reviewed-by: Erik Faye-Lund <erik.faye-lund at collabora.com>
Reviewed-by: Adam Jackson <ajax at redhat.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11173>

---

 src/util/u_math.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/util/u_math.h b/src/util/u_math.h
index ec1314ef0a0..becae90714c 100644
--- a/src/util/u_math.h
+++ b/src/util/u_math.h
@@ -93,7 +93,7 @@ util_get_float32_exponent(float x)
 }
 
 
-#define LOG2_TABLE_SIZE_LOG2 16
+#define LOG2_TABLE_SIZE_LOG2 8
 #define LOG2_TABLE_SCALE (1 << LOG2_TABLE_SIZE_LOG2)
 #define LOG2_TABLE_SIZE (LOG2_TABLE_SCALE + 1)
 extern float log2_table[LOG2_TABLE_SIZE];



More information about the mesa-commit mailing list