mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-18 17:35:30 +00:00
writer/hlsl: Don't wrap arrays in structures
FXC has trouble dealing with these. This was originally added to handle returning arrays as structures. HLSL supports typedefs, which is a much simpiler solution, and doesn't upset FXC. Bug: tint:848 Bug: tint:904 Change-Id: Ie841c9c454461a885a35c41476fd4d05d3f34cbf Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/56774 Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: Antonio Maiorano <amaiorano@google.com> Commit-Queue: Ben Clayton <bclayton@google.com>
This commit is contained in:
committed by
Tint LUCI CQ
parent
106ac290e6
commit
4135ea55eb
@@ -3,24 +3,18 @@ void unused_entry_point() {
|
||||
return;
|
||||
}
|
||||
|
||||
struct tint_array_wrapper {
|
||||
int arr[4];
|
||||
};
|
||||
struct S {
|
||||
tint_array_wrapper arr;
|
||||
};
|
||||
struct tint_array_wrapper_1 {
|
||||
tint_array_wrapper arr[2];
|
||||
int arr[4];
|
||||
};
|
||||
|
||||
void foo() {
|
||||
const tint_array_wrapper src = {(int[4])0};
|
||||
tint_array_wrapper tint_symbol = (tint_array_wrapper)0;
|
||||
const int src[4] = (int[4])0;
|
||||
int tint_symbol[4] = (int[4])0;
|
||||
S dst_struct = (S)0;
|
||||
tint_array_wrapper_1 dst_array = (tint_array_wrapper_1)0;
|
||||
int dst_array[2][4] = (int[2][4])0;
|
||||
dst_struct.arr = src;
|
||||
dst_array.arr[1] = src;
|
||||
dst_array[1] = src;
|
||||
tint_symbol = src;
|
||||
dst_struct.arr = src;
|
||||
dst_array.arr[0] = src;
|
||||
dst_array[0] = src;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user