diff options
| author | ArielG-NV <159081215+ArielG-NV@users.noreply.github.com> | 2024-08-14 13:05:57 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-08-14 10:05:57 -0700 |
| commit | 45b76418f9da2248b069f2058c6a1d52b05a8c74 (patch) | |
| tree | 1757276c7a2fe295d2b130cd74a42c9b8db8783b /tests/language-feature/shared-memory-initializer-error.slang | |
| parent | d8f63e70719c96044b8f497f7dddb264a7edd560 (diff) | |
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 <yonghe@outlook.com>
Diffstat (limited to 'tests/language-feature/shared-memory-initializer-error.slang')
| -rw-r--r-- | tests/language-feature/shared-memory-initializer-error.slang | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/language-feature/shared-memory-initializer-error.slang b/tests/language-feature/shared-memory-initializer-error.slang new file mode 100644 index 000000000..ceb361176 --- /dev/null +++ b/tests/language-feature/shared-memory-initializer-error.slang @@ -0,0 +1,14 @@ +//TEST:SIMPLE(filecheck=HLSL): -target hlsl -stage compute -entry computeMain +//TEST:SIMPLE(filecheck=GLSL): -target glsl -stage compute -entry computeMain + +RWStructuredBuffer<uint> outputBuffer; + +// GLSL: error 30623 +// HLSL: error 30623 +groupshared uint globalMem = 1; + +[numthreads(1, 1, 1)] +void computeMain(int3 dispatchThreadID: SV_DispatchThreadID) +{ + outputBuffer[0] = globalMem ; +} |
