From 2cc96907e4152291e0b6bca78a0bfbc69ddb8839 Mon Sep 17 00:00:00 2001 From: ArielG-NV <159081215+ArielG-NV@users.noreply.github.com> Date: Fri, 14 Jun 2024 01:29:35 -0400 Subject: Implement for metal `SV_GroupIndex` (#4385) * Implement for metal `SV_GroupIndex` 1. If we don't have `sv_GroupThreadId` available we create one using `SV_GroupIndex`s location data. 2. We emit code emulating `sv_GroupThreadId` from the same logic that CUDA/CPP uses. * address most review comments Addressed all but two: [1](https://github.com/shader-slang/slang/pull/4385#discussion_r1639058473) and [2](https://github.com/shader-slang/slang/pull/4385#issuecomment-2166934855) I want to enable tests and be sure there is no bugs using CI before I redesign the code so I have a working fallback. * address comment, enable tests enable now functioning tests due to `SV_GroupIndex` working with metal * syntax error with groupThreadID search did `= param` instead of `= i.param` * add `sv_groupid` for test + test fixes * disable test that won't work regardless --- tests/bugs/frexp-double.slang | 3 ++- tests/bugs/frexp.slang | 2 +- tests/bugs/gh-3980.slang | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) (limited to 'tests/bugs') diff --git a/tests/bugs/frexp-double.slang b/tests/bugs/frexp-double.slang index 40623a17b..c2b4f21c7 100644 --- a/tests/bugs/frexp-double.slang +++ b/tests/bugs/frexp-double.slang @@ -4,7 +4,8 @@ //TEST(smoke,compute):COMPARE_COMPUTE(filecheck-buffer=BUF):-vk -output-using-type -render-feature double //TEST(smoke,compute):COMPARE_COMPUTE(filecheck-buffer=BUF):-vk -emit-spirv-directly -output-using-type -render-feature double //TEST(smoke,compute):COMPARE_COMPUTE(filecheck-buffer=BUF):-cuda -output-using-type -//DISABLE_TEST(compute):COMPARE_COMPUTE:-slang -shaderobj -mtl +//metal currently does not support `double` +//DISABLE_TEST(smoke,compute):COMPARE_COMPUTE(filecheck-buffer=BUF):-slang -shaderobj -mtl -output-using-type // BUF: type: int32_t // BUF-NEXT: 1 diff --git a/tests/bugs/frexp.slang b/tests/bugs/frexp.slang index 01c345d1e..60912297c 100644 --- a/tests/bugs/frexp.slang +++ b/tests/bugs/frexp.slang @@ -4,7 +4,7 @@ //TEST(smoke,compute):COMPARE_COMPUTE(filecheck-buffer=BUF):-vk -output-using-type //TEST(smoke,compute):COMPARE_COMPUTE(filecheck-buffer=BUF):-vk -emit-spirv-directly -output-using-type //TEST(smoke,compute):COMPARE_COMPUTE(filecheck-buffer=BUF):-cuda -output-using-type -//DISABLE_TEST(compute):COMPARE_COMPUTE:-slang -shaderobj -mtl +//TEST(smoke,compute):COMPARE_COMPUTE(filecheck-buffer=BUF):-slang -shaderobj -mtl -output-using-type // BUF: type: int32_t // BUF-NEXT: 1 diff --git a/tests/bugs/gh-3980.slang b/tests/bugs/gh-3980.slang index 509212ea9..57cd28dbe 100644 --- a/tests/bugs/gh-3980.slang +++ b/tests/bugs/gh-3980.slang @@ -4,7 +4,7 @@ //TEST(compute):COMPARE_COMPUTE_EX(filecheck-buffer=BUF):-vk -compute -shaderobj -output-using-type -emit-spirv-directly //TEST(compute):COMPARE_COMPUTE_EX(filecheck-buffer=BUF):-cpu -compute -output-using-type //TEST(compute):COMPARE_COMPUTE_EX(filecheck-buffer=BUF):-cuda -compute -output-using-type -//DISABLE_TEST(compute):COMPARE_COMPUTE:-slang -shaderobj -mtl +//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=BUF):-slang -shaderobj -mtl -output-using-type // Slang removes parentheses characters for the bitwise operators when they are not needed. // DXC prints warning messages even when the expression is correct. -- cgit v1.2.3