From 53dd5928c35d5a5cb1f7d2a563348fd1fa87d672 Mon Sep 17 00:00:00 2001 From: kaizhangNV <149626564+kaizhangNV@users.noreply.github.com> Date: Tue, 5 Nov 2024 07:32:49 -0600 Subject: Fixing the wrong implementation of some math intrinsic (#5491) * Fixing the wrong implementation of some math intrinsic Close the issue #5282 The root cause of the issue is that log10 is not supported in wgsl. So add the implementation. Also ldexp in wgsl doesn't support float type exponent, so fix the implementation of the intrinsic. * re-enable the tests --- tests/expected-failure-github.txt | 2 -- tests/hlsl-intrinsic/scalar-float.slang | 2 +- tests/hlsl-intrinsic/vector-float.slang | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/expected-failure-github.txt b/tests/expected-failure-github.txt index b064af9ad..3c318993a 100644 --- a/tests/expected-failure-github.txt +++ b/tests/expected-failure-github.txt @@ -69,8 +69,6 @@ tests/hlsl-intrinsic/classify-float.slang.5 syn (wgpu) tests/hlsl-intrinsic/matrix-float.slang.6 syn (wgpu) tests/hlsl-intrinsic/matrix-int.slang.6 syn (wgpu) tests/hlsl-intrinsic/scalar-double-simple.slang.7 syn (wgpu) -tests/hlsl-intrinsic/scalar-float.slang.5 syn (wgpu) -tests/hlsl-intrinsic/vector-float.slang.5 syn (wgpu) tests/ir/string-literal-hash.slang.2 syn (wgpu) tests/language-feature/anonymous-struct.slang.1 syn (wgpu) tests/language-feature/constants/constexpr-loop.slang.2 syn (wgpu) diff --git a/tests/hlsl-intrinsic/scalar-float.slang b/tests/hlsl-intrinsic/scalar-float.slang index 148e1b696..a32fe8f6c 100644 --- a/tests/hlsl-intrinsic/scalar-float.slang +++ b/tests/hlsl-intrinsic/scalar-float.slang @@ -4,7 +4,7 @@ //TEST(compute, vulkan):COMPARE_COMPUTE_EX:-vk -compute -shaderobj //DISABLED_TEST(compute, vulkan):COMPARE_COMPUTE_EX:-vk -compute -shaderobj //TEST(compute, vulkan):COMPARE_COMPUTE_EX:-cuda -compute -shaderobj -//DISABLE_TEST(compute):COMPARE_COMPUTE_EX:-wgpu +//TEST(compute):COMPARE_COMPUTE_EX:-wgpu -compute -shaderobj //TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name outputBuffer RWStructuredBuffer outputBuffer; diff --git a/tests/hlsl-intrinsic/vector-float.slang b/tests/hlsl-intrinsic/vector-float.slang index de5decfec..380131a89 100644 --- a/tests/hlsl-intrinsic/vector-float.slang +++ b/tests/hlsl-intrinsic/vector-float.slang @@ -3,7 +3,7 @@ //TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -dx12 -use-dxil -output-using-type -shaderobj //TEST(compute, vulkan):COMPARE_COMPUTE_EX:-vk -compute -output-using-type -shaderobj //TEST(compute, vulkan):COMPARE_COMPUTE_EX:-cuda -compute -output-using-type -shaderobj -//DISABLE_TEST(compute):COMPARE_COMPUTE_EX:-wgpu +//TEST(compute):COMPARE_COMPUTE_EX:-wgpu -compute -output-using-type -shaderobj //TEST_INPUT:ubuffer(data=[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0], stride=4):out,name outputBuffer RWStructuredBuffer outputBuffer; -- cgit v1.2.3