summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrii Simiklit <andrii.simiklit@globallogic.com>2018-10-24 15:52:08 +0300
committerMarek Olšák <marek.olsak@amd.com>2018-11-05 16:02:06 -0500
commit8fc34a6e875566c1cd2a0ca71971b595b1da6125 (patch)
tree6560b9bcbcd39a5f5528a0dbf547a75178b221bf
parent670ae3af45cb676ff799f751d68999903e61605d (diff)
glsl/frexp: fix the incorrect expected values
I guess that this test has the incorrect expected values. For instance the test expects that exponent for a value 2 will be 1 But it contradicts to spec because in this case the value of 'significand' must be 1.0: 2.0 = 1.0 * 2 ^ 1 GLSL spec says (about 'frexp'): "Splits x into a floating-point significand in the range [0.5, 1.0) and an integral exponent of two, such that: x = significand * 2 ^ exponent The significand is returned by the function and the exponent is returned in the parameter exp. For a floating-point value of zero, the significant and exponent are both zero. For a floating-point value that is an infinity or is not a number, the results are undefined. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108537 Signed-off-by: Andrii Simiklit <andrii.simiklit@globallogic.com> Signed-off-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
-rw-r--r--tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/fs-frexp-dvec4-only-exponent.shader_test13
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/fs-frexp-dvec4-only-exponent.shader_test b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/fs-frexp-dvec4-only-exponent.shader_test
index d7dc64032..c4a7555ff 100644
--- a/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/fs-frexp-dvec4-only-exponent.shader_test
+++ b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/fs-frexp-dvec4-only-exponent.shader_test
@@ -31,7 +31,18 @@ clear color 0 0 0 1
clear
uniform dvec4 u_in 2 3 4 9
-uniform ivec4 u_exponent 1 1 2 3
+
+# The function frexp() splits each single-precision floating-point number in
+# <x> into a binary significand, a floating-point number in the range [0.5,
+# 1.0), and an integral exponent of two, such that:
+#
+# x = significand * 2 ^ exponent
+#
+# 2 = 0.5 * 2^2
+# 3 = 0.75 * 2^2
+# 4 = 0.5 * 2^3
+# 9 = 0.5625 * 2^4
+uniform ivec4 u_exponent 2 2 3 4
draw rect -1 -1 2 2
probe all rgba 0 1 0 1