mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-06-05 06:03:34 +00:00
For structures and arrays. This behaves identically to the per-element zero-initialization, but can be significantly less verbose. Change-Id: I380ef86f16c2b3f37a9de2820e707f368955b761 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/56764 Auto-Submit: Ben Clayton <bclayton@google.com> Reviewed-by: David Neto <dneto@google.com> Kokoro: Kokoro <noreply+kokoro@google.com>
22 lines
469 B
HLSL
22 lines
469 B
HLSL
struct tint_array_wrapper {
|
|
int arr[3];
|
|
};
|
|
|
|
groupshared tint_array_wrapper v;
|
|
|
|
struct tint_symbol_1 {
|
|
uint local_invocation_index : SV_GroupIndex;
|
|
};
|
|
|
|
[numthreads(1, 1, 1)]
|
|
void main(tint_symbol_1 tint_symbol) {
|
|
const uint local_invocation_index = tint_symbol.local_invocation_index;
|
|
if ((local_invocation_index == 0u)) {
|
|
const tint_array_wrapper tint_symbol_2 = {(int[3])0};
|
|
v = tint_symbol_2;
|
|
}
|
|
GroupMemoryBarrierWithGroupSync();
|
|
v;
|
|
return;
|
|
}
|