From 1e4265edd4ec4c44e3d8f209fca802727076aa46 Mon Sep 17 00:00:00 2001 From: Julius Ikkala Date: Thu, 9 Oct 2025 02:13:27 +0300 Subject: Allow 1D SV_DispatchThreadID in CPU targets (#8612) The varying param legalization pass didn't deal with this 1D form of SV_DispatchThreadID for CPU targets: ```slang void computeMain(int i : SV_DispatchThreadID) ``` Instead, it just overrode the type of `i` with a `uint3`, breaking lots of code that attempted to use `i` for something, like a `switch` statement for example. I ran across this when going through `language-feature` tests for the LLVM target, which will also use this legalization pass. I'm separately submitting this now because this also fixes the existing CPU target. The test I enable in this PR is one that was previously generating broken code on CPU. (somewhat related issue: #7468) --- tests/language-feature/enums/enum-switch-2.slang | 1 + 1 file changed, 1 insertion(+) (limited to 'tests/language-feature/enums') diff --git a/tests/language-feature/enums/enum-switch-2.slang b/tests/language-feature/enums/enum-switch-2.slang index f5266f35d..de4a4757b 100644 --- a/tests/language-feature/enums/enum-switch-2.slang +++ b/tests/language-feature/enums/enum-switch-2.slang @@ -1,4 +1,5 @@ //TEST(compute):COMPARE_COMPUTE_EX(filecheck-buffer=CHECK):-slang -compute -shaderobj -output-using-type +//TEST(compute):COMPARE_COMPUTE_EX(filecheck-buffer=CHECK):-cpu -compute -shaderobj -output-using-type //TEST(compute, vulkan):COMPARE_COMPUTE_EX(filecheck-buffer=CHECK):-vk -compute -shaderobj -output-using-type enum class E : uint32_t -- cgit v1.2.3