From 45b76418f9da2248b069f2058c6a1d52b05a8c74 Mon Sep 17 00:00:00 2001 From: ArielG-NV <159081215+ArielG-NV@users.noreply.github.com> Date: Wed, 14 Aug 2024 13:05:57 -0400 Subject: Do not zero-initialize groupshared and rayquery variables (#4838) * Do not zero-initialize groupshared and rayquery variables Fixes: #4824 `-zero-initialize` option will explicitly not: 1. Set any groupshared values to defaults 2. Set any rayQuery object to a default state (currently invalid code generation) * grammer * disallow groupshared initializers disallow groupshared initializers & adjust tests accordingly * remove disallowed groupshared-init expression * do not default init if non-copyable --------- Co-authored-by: Yong He --- tests/compute/groupshared-init.slang | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100644 tests/compute/groupshared-init.slang (limited to 'tests/compute') diff --git a/tests/compute/groupshared-init.slang b/tests/compute/groupshared-init.slang deleted file mode 100644 index 5a9758826..000000000 --- a/tests/compute/groupshared-init.slang +++ /dev/null @@ -1,28 +0,0 @@ -//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type -//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -output-using-type -use-dxil -//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -output-using-type -//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -output-using-type -emit-spirv-directly - -// CHECK: type: uint32_t -// CHECK-NEXT: 1231 -// CHECK-NEXT: 1232 -// CHECK-NEXT: 1233 -// CHECK-NEXT: 1234 - -// This is a basic test for Slang compute shader. - -//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name=outputBuffer -RWStructuredBuffer outputBuffer; - -groupshared uint myGroupSharedValue = foo(); - -uint foo() -{ - return 1231; -} - -[numthreads(4, 1, 1)] -void computeMain(uint i : SV_GroupIndex) -{ - outputBuffer[i] = i + myGroupSharedValue; -} -- cgit v1.2.3