mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-09 13:38:00 +00:00
Add transform/WrapArraysInStructs
And replace the MSL writer's logic to do this with the transform. We need to do the same thing in HLSL, and in the future GLSL too. Partially reverts fbfde720 Change-Id: Ie280e011bc3ded8e15ccacc0aeb12da3c2407389 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/54242 Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: James Price <jrprice@google.com>
This commit is contained in:
@@ -3,8 +3,8 @@
|
||||
using namespace metal;
|
||||
struct S {
|
||||
};
|
||||
struct tint_array_wrapper_0 {
|
||||
float array[4];
|
||||
struct tint_array_wrapper {
|
||||
float arr[4];
|
||||
};
|
||||
|
||||
kernel void tint_symbol() {
|
||||
@@ -24,13 +24,13 @@ kernel void tint_symbol() {
|
||||
float4 const v4f32_let = float4();
|
||||
float2x3 m2x3_var = float2x3();
|
||||
float3x4 const m3x4_let = float3x4();
|
||||
tint_array_wrapper_0 arr_var = {};
|
||||
tint_array_wrapper_0 const arr_let = {};
|
||||
tint_array_wrapper arr_var = {.arr={}};
|
||||
tint_array_wrapper const arr_let = {.arr={}};
|
||||
S struct_var = {};
|
||||
S const struct_let = {};
|
||||
thread float* const ptr_f32 = &(f32_var);
|
||||
thread float4* const ptr_vec = &(v4f32_var);
|
||||
thread tint_array_wrapper_0* const ptr_arr = &(arr_var);
|
||||
thread tint_array_wrapper* const ptr_arr = &(arr_var);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
using namespace metal;
|
||||
struct S {
|
||||
};
|
||||
struct tint_array_wrapper_0 {
|
||||
float array[4];
|
||||
struct tint_array_wrapper {
|
||||
float arr[4];
|
||||
};
|
||||
|
||||
constant bool bool_let = bool();
|
||||
@@ -15,7 +15,7 @@ constant int2 v2i32_let = int2();
|
||||
constant uint3 v3u32_let = uint3();
|
||||
constant float4 v4f32_let = float4();
|
||||
constant float3x4 m3x4_let = float3x4();
|
||||
constant tint_array_wrapper_0 arr_let = {};
|
||||
constant tint_array_wrapper arr_let = {.arr={}};
|
||||
constant S struct_let = {};
|
||||
kernel void tint_symbol() {
|
||||
return;
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
using namespace metal;
|
||||
struct S {
|
||||
};
|
||||
struct tint_array_wrapper_0 {
|
||||
float array[4];
|
||||
struct tint_array_wrapper {
|
||||
float arr[4];
|
||||
};
|
||||
|
||||
kernel void tint_symbol() {
|
||||
@@ -16,7 +16,7 @@ kernel void tint_symbol() {
|
||||
thread uint3 tint_symbol_8 = 0u;
|
||||
thread float4 tint_symbol_9 = 0.0f;
|
||||
thread float2x3 tint_symbol_10 = float2x3(0.0f);
|
||||
thread tint_array_wrapper_0 tint_symbol_11 = {0.0f};
|
||||
thread tint_array_wrapper tint_symbol_11 = {};
|
||||
thread S tint_symbol_12 = {};
|
||||
tint_symbol_3 = bool();
|
||||
tint_symbol_4 = int();
|
||||
@@ -26,7 +26,7 @@ kernel void tint_symbol() {
|
||||
tint_symbol_8 = uint3();
|
||||
tint_symbol_9 = float4();
|
||||
tint_symbol_10 = float2x3();
|
||||
tint_array_wrapper_0 const tint_symbol_1 = {};
|
||||
tint_array_wrapper const tint_symbol_1 = {.arr={}};
|
||||
tint_symbol_11 = tint_symbol_1;
|
||||
S const tint_symbol_2 = {};
|
||||
tint_symbol_12 = tint_symbol_2;
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
using namespace metal;
|
||||
struct S {
|
||||
};
|
||||
struct tint_array_wrapper_0 {
|
||||
float array[4];
|
||||
struct tint_array_wrapper {
|
||||
float arr[4];
|
||||
};
|
||||
|
||||
kernel void tint_symbol() {
|
||||
@@ -16,7 +16,7 @@ kernel void tint_symbol() {
|
||||
thread uint3 tint_symbol_8 = uint3();
|
||||
thread float4 tint_symbol_9 = float4();
|
||||
thread float2x3 tint_symbol_10 = float2x3();
|
||||
thread tint_array_wrapper_0 tint_symbol_11 = {};
|
||||
thread tint_array_wrapper tint_symbol_11 = {.arr={}};
|
||||
thread S tint_symbol_12 = {};
|
||||
tint_symbol_3 = bool();
|
||||
tint_symbol_4 = int();
|
||||
@@ -26,7 +26,7 @@ kernel void tint_symbol() {
|
||||
tint_symbol_8 = uint3();
|
||||
tint_symbol_9 = float4();
|
||||
tint_symbol_10 = float2x3();
|
||||
tint_array_wrapper_0 const tint_symbol_1 = {};
|
||||
tint_array_wrapper const tint_symbol_1 = {.arr={}};
|
||||
tint_symbol_11 = tint_symbol_1;
|
||||
S const tint_symbol_2 = {};
|
||||
tint_symbol_12 = tint_symbol_2;
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
using namespace metal;
|
||||
struct S {
|
||||
};
|
||||
struct tint_array_wrapper_0 {
|
||||
float array[4];
|
||||
struct tint_array_wrapper {
|
||||
float arr[4];
|
||||
};
|
||||
|
||||
void foo(bool param_bool, int param_i32, uint param_u32, float param_f32, int2 param_v2i32, uint3 param_v3u32, float4 param_v4f32, float2x3 param_m2x3, tint_array_wrapper_0 const param_arr, S param_struct, thread float* const param_ptr_f32, thread float4* const param_ptr_vec, thread tint_array_wrapper_0* const param_ptr_arr) {
|
||||
void foo(bool param_bool, int param_i32, uint param_u32, float param_f32, int2 param_v2i32, uint3 param_v3u32, float4 param_v4f32, float2x3 param_m2x3, tint_array_wrapper param_arr, S param_struct, thread float* const param_ptr_f32, thread float4* const param_ptr_vec, thread tint_array_wrapper* const param_ptr_arr) {
|
||||
}
|
||||
|
||||
kernel void tint_symbol() {
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
using namespace metal;
|
||||
struct S {
|
||||
};
|
||||
struct tint_array_wrapper_0 {
|
||||
float array[4];
|
||||
struct tint_array_wrapper {
|
||||
float arr[4];
|
||||
};
|
||||
|
||||
bool ret_bool() {
|
||||
@@ -39,8 +39,8 @@ float2x3 ret_m2x3() {
|
||||
return float2x3();
|
||||
}
|
||||
|
||||
tint_array_wrapper_0 ret_arr() {
|
||||
tint_array_wrapper_0 const tint_symbol_1 = {};
|
||||
tint_array_wrapper ret_arr() {
|
||||
tint_array_wrapper const tint_symbol_1 = {.arr={}};
|
||||
return tint_symbol_1;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
using namespace metal;
|
||||
struct S_inner {
|
||||
};
|
||||
struct tint_array_wrapper_0 {
|
||||
float array[4];
|
||||
struct tint_array_wrapper {
|
||||
float arr[4];
|
||||
};
|
||||
struct S {
|
||||
bool member_bool;
|
||||
@@ -15,7 +15,7 @@ struct S {
|
||||
uint3 member_v3u32;
|
||||
float4 member_v4f32;
|
||||
float2x3 member_m2x3;
|
||||
tint_array_wrapper_0 member_arr;
|
||||
tint_array_wrapper member_arr;
|
||||
S_inner member_struct;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user