mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-16 00:17:03 +00:00
tint->dawn: Shuffle source tree in preperation of merging repos
docs/ -> docs/tint/ fuzzers/ -> src/tint/fuzzers/ samples/ -> src/tint/cmd/ src/ -> src/tint/ test/ -> test/tint/ BUG=tint:1418,tint:1433 Change-Id: Id2aa79f989aef3245b80ef4aa37a27ff16cd700b Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/80482 Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: Ben Clayton <bclayton@google.com> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
This commit is contained in:
committed by
Tint LUCI CQ
parent
38f1e9c75c
commit
dbc13af287
27
test/tint/array/assign_to_subexpr.wgsl
Normal file
27
test/tint/array/assign_to_subexpr.wgsl
Normal file
@@ -0,0 +1,27 @@
|
||||
type ArrayType = array<i32, 4>;
|
||||
|
||||
struct S {
|
||||
arr : array<i32, 4>;
|
||||
};
|
||||
|
||||
fn foo() {
|
||||
let src : ArrayType = ArrayType();
|
||||
|
||||
var dst : ArrayType;
|
||||
var dst_struct : S;
|
||||
var dst_array : array<ArrayType, 2>;
|
||||
let dst_ptr : ptr<function, ArrayType> = &dst;
|
||||
let dst_struct_ptr : ptr<function, S> = &dst_struct;
|
||||
let dst_array_ptr : ptr<function, array<ArrayType, 2>> = &dst_array;
|
||||
|
||||
// Assign to struct.member.
|
||||
dst_struct.arr = src;
|
||||
|
||||
// Assign to array[index].
|
||||
dst_array[1] = src;
|
||||
|
||||
// Assign via pointers.
|
||||
*dst_ptr = src;
|
||||
(*dst_struct_ptr).arr = src;
|
||||
(*dst_array_ptr)[0] = src;
|
||||
}
|
||||
Reference in New Issue
Block a user