dawn-cmake/test/bug/tint/870.spvasm.expected.hlsl
Ben Clayton 2bb45389b7 writer/hlsl: Zero initialize with (T) 0
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>
2021-07-02 19:27:42 +00:00

28 lines
912 B
HLSL

struct tint_array_wrapper {
int arr[6];
};
tint_array_wrapper tint_symbol_1(ByteAddressBuffer buffer, uint offset) {
const tint_array_wrapper tint_symbol_2 = {{asint(buffer.Load((offset + 0u))), asint(buffer.Load((offset + 4u))), asint(buffer.Load((offset + 8u))), asint(buffer.Load((offset + 12u))), asint(buffer.Load((offset + 16u))), asint(buffer.Load((offset + 20u)))}};
return tint_symbol_2;
}
ByteAddressBuffer sspp962805860buildInformation : register(t2, space0);
void main_1() {
tint_array_wrapper orientation = (tint_array_wrapper)0;
const tint_array_wrapper x_23 = tint_symbol_1(sspp962805860buildInformation, 36u);
orientation.arr[0] = x_23.arr[0u];
orientation.arr[1] = x_23.arr[1u];
orientation.arr[2] = x_23.arr[2u];
orientation.arr[3] = x_23.arr[3u];
orientation.arr[4] = x_23.arr[4u];
orientation.arr[5] = x_23.arr[5u];
return;
}
void main() {
main_1();
return;
}