mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-18 17:35:30 +00:00
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>
This commit is contained in:
@@ -14,10 +14,10 @@ struct tint_array_wrapper_1 {
|
||||
};
|
||||
|
||||
void foo() {
|
||||
const tint_array_wrapper src = {{0, 0, 0, 0}};
|
||||
tint_array_wrapper tint_symbol = {{0, 0, 0, 0}};
|
||||
S dst_struct = {{{0, 0, 0, 0}}};
|
||||
tint_array_wrapper_1 dst_array = {{{{0, 0, 0, 0}}, {{0, 0, 0, 0}}}};
|
||||
const tint_array_wrapper src = {(int[4])0};
|
||||
tint_array_wrapper tint_symbol = (tint_array_wrapper)0;
|
||||
S dst_struct = (S)0;
|
||||
tint_array_wrapper_1 dst_array = (tint_array_wrapper_1)0;
|
||||
dst_struct.arr = src;
|
||||
dst_array.arr[1] = src;
|
||||
tint_symbol = src;
|
||||
|
||||
Reference in New Issue
Block a user