mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-09 05:27:49 +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:
@@ -288,6 +288,7 @@ tint_unittests_source_set("tint_unittests_core_src") {
|
||||
"../src/transform/transform_test.cc",
|
||||
"../src/transform/var_for_dynamic_index_test.cc",
|
||||
"../src/transform/vertex_pulling_test.cc",
|
||||
"../src/transform/wrap_arrays_in_structs_test.cc",
|
||||
"../src/utils/enum_set_test.cc",
|
||||
"../src/utils/get_or_create_test.cc",
|
||||
"../src/utils/hash_test.cc",
|
||||
|
||||
@@ -1,28 +1,28 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
struct tint_array_wrapper_0 {
|
||||
int array[4];
|
||||
struct tint_array_wrapper {
|
||||
int arr[4];
|
||||
};
|
||||
struct S {
|
||||
tint_array_wrapper_0 arr;
|
||||
tint_array_wrapper arr;
|
||||
};
|
||||
struct tint_array_wrapper_1 {
|
||||
tint_array_wrapper_0 array[2];
|
||||
tint_array_wrapper arr[2];
|
||||
};
|
||||
|
||||
void foo() {
|
||||
tint_array_wrapper_0 const src = {};
|
||||
tint_array_wrapper_0 dst = {0};
|
||||
tint_array_wrapper const src = {.arr={}};
|
||||
tint_array_wrapper dst = {};
|
||||
S dst_struct = {};
|
||||
tint_array_wrapper_1 dst_array = {{0}};
|
||||
thread tint_array_wrapper_0* const dst_ptr = &(dst);
|
||||
tint_array_wrapper_1 dst_array = {};
|
||||
thread tint_array_wrapper* const dst_ptr = &(dst);
|
||||
thread S* const dst_struct_ptr = &(dst_struct);
|
||||
thread tint_array_wrapper_1* const dst_array_ptr = &(dst_array);
|
||||
dst_struct.arr = src;
|
||||
dst_array.array[1] = src;
|
||||
dst_array.arr[1] = src;
|
||||
*(dst_ptr) = src;
|
||||
(*(dst_struct_ptr)).arr = src;
|
||||
(*(dst_array_ptr)).array[0] = src;
|
||||
(*(dst_array_ptr)).arr[0] = src;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,32 +1,32 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
struct tint_array_wrapper_0 {
|
||||
float array[4];
|
||||
struct tint_array_wrapper {
|
||||
float arr[4];
|
||||
};
|
||||
struct tint_array_wrapper_1 {
|
||||
tint_array_wrapper_0 array[3];
|
||||
tint_array_wrapper arr[3];
|
||||
};
|
||||
struct tint_array_wrapper_2 {
|
||||
tint_array_wrapper_1 array[2];
|
||||
tint_array_wrapper_1 arr[2];
|
||||
};
|
||||
|
||||
float f1(tint_array_wrapper_0 const a) {
|
||||
return a.array[3];
|
||||
float f1(tint_array_wrapper a) {
|
||||
return a.arr[3];
|
||||
}
|
||||
|
||||
float f2(tint_array_wrapper_1 const a) {
|
||||
return a.array[2].array[3];
|
||||
float f2(tint_array_wrapper_1 a) {
|
||||
return a.arr[2].arr[3];
|
||||
}
|
||||
|
||||
float f3(tint_array_wrapper_2 const a) {
|
||||
return a.array[1].array[2].array[3];
|
||||
float f3(tint_array_wrapper_2 a) {
|
||||
return a.arr[1].arr[2].arr[3];
|
||||
}
|
||||
|
||||
kernel void tint_symbol() {
|
||||
tint_array_wrapper_0 const a1 = {};
|
||||
tint_array_wrapper_1 const a2 = {};
|
||||
tint_array_wrapper_2 const a3 = {};
|
||||
tint_array_wrapper const a1 = {.arr={}};
|
||||
tint_array_wrapper_1 const a2 = {.arr={}};
|
||||
tint_array_wrapper_2 const a3 = {.arr={}};
|
||||
float const v1 = f1(a1);
|
||||
float const v2 = f2(a2);
|
||||
float const v3 = f3(a3);
|
||||
|
||||
@@ -1,33 +1,33 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
struct tint_array_wrapper_0 {
|
||||
float array[4];
|
||||
struct tint_array_wrapper {
|
||||
float arr[4];
|
||||
};
|
||||
struct tint_array_wrapper_1 {
|
||||
tint_array_wrapper_0 array[3];
|
||||
tint_array_wrapper arr[3];
|
||||
};
|
||||
struct tint_array_wrapper_2 {
|
||||
tint_array_wrapper_1 array[2];
|
||||
tint_array_wrapper_1 arr[2];
|
||||
};
|
||||
|
||||
tint_array_wrapper_0 f1() {
|
||||
tint_array_wrapper_0 const tint_symbol_1 = {};
|
||||
tint_array_wrapper f1() {
|
||||
tint_array_wrapper const tint_symbol_1 = {.arr={}};
|
||||
return tint_symbol_1;
|
||||
}
|
||||
|
||||
tint_array_wrapper_1 f2() {
|
||||
tint_array_wrapper_1 const tint_symbol_2 = {f1(), f1(), f1()};
|
||||
tint_array_wrapper_1 const tint_symbol_2 = {.arr={f1(), f1(), f1()}};
|
||||
return tint_symbol_2;
|
||||
}
|
||||
|
||||
tint_array_wrapper_2 f3() {
|
||||
tint_array_wrapper_2 const tint_symbol_3 = {f2(), f2()};
|
||||
tint_array_wrapper_2 const tint_symbol_3 = {.arr={f2(), f2()}};
|
||||
return tint_symbol_3;
|
||||
}
|
||||
|
||||
kernel void tint_symbol() {
|
||||
tint_array_wrapper_0 const a1 = f1();
|
||||
tint_array_wrapper const a1 = f1();
|
||||
tint_array_wrapper_1 const a2 = f2();
|
||||
tint_array_wrapper_2 const a3 = f3();
|
||||
return;
|
||||
|
||||
@@ -1,53 +1,53 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
struct tint_array_wrapper_0 {
|
||||
int array[4];
|
||||
};
|
||||
struct tint_array_wrapper_1 {
|
||||
tint_array_wrapper_0 array[3];
|
||||
struct tint_array_wrapper {
|
||||
int arr[4];
|
||||
};
|
||||
struct tint_array_wrapper_2 {
|
||||
tint_array_wrapper_1 array[2];
|
||||
tint_array_wrapper arr[3];
|
||||
};
|
||||
struct tint_array_wrapper_1 {
|
||||
tint_array_wrapper_2 arr[2];
|
||||
};
|
||||
struct tint_array_wrapper_3 {
|
||||
tint_array_wrapper_0 array[2];
|
||||
tint_array_wrapper arr[2];
|
||||
};
|
||||
|
||||
kernel void tint_symbol() {
|
||||
int const x = 42;
|
||||
tint_array_wrapper_0 const empty = {};
|
||||
tint_array_wrapper_0 const nonempty = {1, 2, 3, 4};
|
||||
tint_array_wrapper_0 const nonempty_with_expr = {1, x, (x + 1), nonempty.array[3]};
|
||||
tint_array_wrapper_2 const nested_empty = {};
|
||||
tint_array_wrapper_0 const tint_symbol_1 = {1, 2, 3, 4};
|
||||
tint_array_wrapper_0 const tint_symbol_2 = {5, 6, 7, 8};
|
||||
tint_array_wrapper_0 const tint_symbol_3 = {9, 10, 11, 12};
|
||||
tint_array_wrapper_1 const tint_symbol_4 = {tint_symbol_1, tint_symbol_2, tint_symbol_3};
|
||||
tint_array_wrapper_0 const tint_symbol_5 = {13, 14, 15, 16};
|
||||
tint_array_wrapper_0 const tint_symbol_6 = {17, 18, 19, 20};
|
||||
tint_array_wrapper_0 const tint_symbol_7 = {21, 22, 23, 24};
|
||||
tint_array_wrapper_1 const tint_symbol_8 = {tint_symbol_5, tint_symbol_6, tint_symbol_7};
|
||||
tint_array_wrapper_2 const nested_nonempty = {tint_symbol_4, tint_symbol_8};
|
||||
tint_array_wrapper_0 const tint_symbol_9 = {1, 2, x, (x + 1)};
|
||||
tint_array_wrapper_0 const tint_symbol_10 = {5, 6, nonempty.array[2], (nonempty.array[3] + 1)};
|
||||
tint_array_wrapper_1 const tint_symbol_11 = {tint_symbol_9, tint_symbol_10, nonempty};
|
||||
tint_array_wrapper_2 const nested_nonempty_with_expr = {tint_symbol_11, nested_nonempty.array[1]};
|
||||
tint_array_wrapper_0 const tint_symbol_12 = {};
|
||||
int const subexpr_empty = tint_symbol_12.array[1];
|
||||
tint_array_wrapper_0 const tint_symbol_13 = {1, 2, 3, 4};
|
||||
int const subexpr_nonempty = tint_symbol_13.array[2];
|
||||
tint_array_wrapper_0 const tint_symbol_14 = {1, x, (x + 1), nonempty.array[3]};
|
||||
int const subexpr_nonempty_with_expr = tint_symbol_14.array[2];
|
||||
tint_array_wrapper_3 const tint_symbol_15 = {};
|
||||
tint_array_wrapper_0 const subexpr_nested_empty = tint_symbol_15.array[1];
|
||||
tint_array_wrapper_0 const tint_symbol_16 = {1, 2, 3, 4};
|
||||
tint_array_wrapper_0 const tint_symbol_17 = {5, 6, 7, 8};
|
||||
tint_array_wrapper_3 const tint_symbol_18 = {tint_symbol_16, tint_symbol_17};
|
||||
tint_array_wrapper_0 const subexpr_nested_nonempty = tint_symbol_18.array[1];
|
||||
tint_array_wrapper_0 const tint_symbol_19 = {1, x, (x + 1), nonempty.array[3]};
|
||||
tint_array_wrapper_3 const tint_symbol_20 = {tint_symbol_19, nested_nonempty.array[1].array[2]};
|
||||
tint_array_wrapper_0 const subexpr_nested_nonempty_with_expr = tint_symbol_20.array[1];
|
||||
tint_array_wrapper const empty = {.arr={}};
|
||||
tint_array_wrapper const nonempty = {.arr={1, 2, 3, 4}};
|
||||
tint_array_wrapper const nonempty_with_expr = {.arr={1, x, (x + 1), nonempty.arr[3]}};
|
||||
tint_array_wrapper_1 const nested_empty = {.arr={}};
|
||||
tint_array_wrapper const tint_symbol_1 = {.arr={1, 2, 3, 4}};
|
||||
tint_array_wrapper const tint_symbol_2 = {.arr={5, 6, 7, 8}};
|
||||
tint_array_wrapper const tint_symbol_3 = {.arr={9, 10, 11, 12}};
|
||||
tint_array_wrapper_2 const tint_symbol_4 = {.arr={tint_symbol_1, tint_symbol_2, tint_symbol_3}};
|
||||
tint_array_wrapper const tint_symbol_5 = {.arr={13, 14, 15, 16}};
|
||||
tint_array_wrapper const tint_symbol_6 = {.arr={17, 18, 19, 20}};
|
||||
tint_array_wrapper const tint_symbol_7 = {.arr={21, 22, 23, 24}};
|
||||
tint_array_wrapper_2 const tint_symbol_8 = {.arr={tint_symbol_5, tint_symbol_6, tint_symbol_7}};
|
||||
tint_array_wrapper_1 const nested_nonempty = {.arr={tint_symbol_4, tint_symbol_8}};
|
||||
tint_array_wrapper const tint_symbol_9 = {.arr={1, 2, x, (x + 1)}};
|
||||
tint_array_wrapper const tint_symbol_10 = {.arr={5, 6, nonempty.arr[2], (nonempty.arr[3] + 1)}};
|
||||
tint_array_wrapper_2 const tint_symbol_11 = {.arr={tint_symbol_9, tint_symbol_10, nonempty}};
|
||||
tint_array_wrapper_1 const nested_nonempty_with_expr = {.arr={tint_symbol_11, nested_nonempty.arr[1]}};
|
||||
tint_array_wrapper const tint_symbol_12 = {.arr={}};
|
||||
int const subexpr_empty = tint_symbol_12.arr[1];
|
||||
tint_array_wrapper const tint_symbol_13 = {.arr={1, 2, 3, 4}};
|
||||
int const subexpr_nonempty = tint_symbol_13.arr[2];
|
||||
tint_array_wrapper const tint_symbol_14 = {.arr={1, x, (x + 1), nonempty.arr[3]}};
|
||||
int const subexpr_nonempty_with_expr = tint_symbol_14.arr[2];
|
||||
tint_array_wrapper_3 const tint_symbol_15 = {.arr={}};
|
||||
tint_array_wrapper const subexpr_nested_empty = tint_symbol_15.arr[1];
|
||||
tint_array_wrapper const tint_symbol_16 = {.arr={1, 2, 3, 4}};
|
||||
tint_array_wrapper const tint_symbol_17 = {.arr={5, 6, 7, 8}};
|
||||
tint_array_wrapper_3 const tint_symbol_18 = {.arr={tint_symbol_16, tint_symbol_17}};
|
||||
tint_array_wrapper const subexpr_nested_nonempty = tint_symbol_18.arr[1];
|
||||
tint_array_wrapper const tint_symbol_19 = {.arr={1, x, (x + 1), nonempty.arr[3]}};
|
||||
tint_array_wrapper_3 const tint_symbol_20 = {.arr={tint_symbol_19, nested_nonempty.arr[1].arr[2]}};
|
||||
tint_array_wrapper const subexpr_nested_nonempty_with_expr = tint_symbol_20.arr[1];
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
struct tint_array_wrapper_0 {
|
||||
int array[2];
|
||||
struct tint_array_wrapper {
|
||||
int arr[2];
|
||||
};
|
||||
|
||||
void foo() {
|
||||
tint_array_wrapper_0 tint_symbol = {0};
|
||||
tint_array_wrapper_0 implict = {0};
|
||||
tint_array_wrapper tint_symbol = {};
|
||||
tint_array_wrapper implict = {};
|
||||
implict = tint_symbol;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,20 +9,20 @@ struct tint_symbol_2 {
|
||||
float4 color [[user(locn0)]];
|
||||
float4 Position [[position]];
|
||||
};
|
||||
struct tint_array_wrapper_0 {
|
||||
float2 array[4];
|
||||
struct tint_array_wrapper {
|
||||
float2 arr[4];
|
||||
};
|
||||
struct tint_array_wrapper_1 {
|
||||
float4 array[4];
|
||||
float4 arr[4];
|
||||
};
|
||||
|
||||
vertex tint_symbol_2 tint_symbol(uint VertexIndex [[vertex_id]], uint InstanceIndex [[instance_id]]) {
|
||||
tint_array_wrapper_0 const zv = {float2(0.200000003f, 0.200000003f), float2(0.300000012f, 0.300000012f), float2(-0.100000001f, -0.100000001f), float2(1.100000024f, 1.100000024f)};
|
||||
float const z = zv.array[InstanceIndex].x;
|
||||
tint_array_wrapper const zv = {.arr={float2(0.200000003f, 0.200000003f), float2(0.300000012f, 0.300000012f), float2(-0.100000001f, -0.100000001f), float2(1.100000024f, 1.100000024f)}};
|
||||
float const z = zv.arr[InstanceIndex].x;
|
||||
Output output = {};
|
||||
output.Position = float4(0.5f, 0.5f, z, 1.0f);
|
||||
tint_array_wrapper_1 const colors = {float4(1.0f, 0.0f, 0.0f, 1.0f), float4(0.0f, 1.0f, 0.0f, 1.0f), float4(0.0f, 0.0f, 1.0f, 1.0f), float4(1.0f, 1.0f, 1.0f, 1.0f)};
|
||||
output.color = colors.array[InstanceIndex];
|
||||
tint_array_wrapper_1 const colors = {.arr={float4(1.0f, 0.0f, 0.0f, 1.0f), float4(0.0f, 1.0f, 0.0f, 1.0f), float4(0.0f, 0.0f, 1.0f, 1.0f), float4(1.0f, 1.0f, 1.0f, 1.0f)}};
|
||||
output.color = colors.arr[InstanceIndex];
|
||||
tint_symbol_2 const tint_symbol_3 = {.color=output.color, .Position=output.Position};
|
||||
return tint_symbol_3;
|
||||
}
|
||||
|
||||
@@ -25,11 +25,11 @@ struct SimParams {
|
||||
/* 0x0014 */ float rule2Scale;
|
||||
/* 0x0018 */ float rule3Scale;
|
||||
};
|
||||
struct tint_array_wrapper_0 {
|
||||
Particle array[5];
|
||||
struct tint_array_wrapper {
|
||||
/* 0x0000 */ Particle arr[5];
|
||||
};
|
||||
struct Particles {
|
||||
/* 0x0000 */ tint_array_wrapper_0 particles;
|
||||
/* 0x0000 */ tint_array_wrapper particles;
|
||||
};
|
||||
|
||||
vertex tint_symbol_2 vert_main(tint_symbol_1 tint_symbol [[stage_in]]) {
|
||||
@@ -52,8 +52,8 @@ kernel void comp_main(uint3 gl_GlobalInvocationID [[thread_position_in_grid]], c
|
||||
if ((index >= 5u)) {
|
||||
return;
|
||||
}
|
||||
float2 vPos = particlesA.particles.array[index].pos;
|
||||
float2 vVel = particlesA.particles.array[index].vel;
|
||||
float2 vPos = particlesA.particles.arr[index].pos;
|
||||
float2 vVel = particlesA.particles.arr[index].vel;
|
||||
float2 cMass = float2(0.0f, 0.0f);
|
||||
float2 cVel = float2(0.0f, 0.0f);
|
||||
float2 colVel = float2(0.0f, 0.0f);
|
||||
@@ -77,8 +77,8 @@ kernel void comp_main(uint3 gl_GlobalInvocationID [[thread_position_in_grid]], c
|
||||
if ((i == index)) {
|
||||
continue;
|
||||
}
|
||||
pos = particlesA.particles.array[i].pos.xy;
|
||||
vel = particlesA.particles.array[i].vel.xy;
|
||||
pos = particlesA.particles.arr[i].pos.xy;
|
||||
vel = particlesA.particles.arr[i].vel.xy;
|
||||
if (( distance(pos, vPos) < params.rule1Distance)) {
|
||||
cMass = (cMass + pos);
|
||||
cMassCount = (cMassCount + 1);
|
||||
@@ -114,8 +114,8 @@ kernel void comp_main(uint3 gl_GlobalInvocationID [[thread_position_in_grid]], c
|
||||
if ((vPos.y > 1.0f)) {
|
||||
vPos.y = -1.0f;
|
||||
}
|
||||
particlesB.particles.array[index].pos = vPos;
|
||||
particlesB.particles.array[index].vel = vVel;
|
||||
particlesB.particles.arr[index].pos = vPos;
|
||||
particlesB.particles.arr[index].vel = vVel;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
struct tint_array_wrapper {
|
||||
float2 arr[3];
|
||||
};
|
||||
struct tint_symbol_1 {
|
||||
float4 value [[position]];
|
||||
};
|
||||
struct tint_symbol_2 {
|
||||
float4 value [[color(0)]];
|
||||
};
|
||||
struct tint_array_wrapper_0 {
|
||||
float2 array[3];
|
||||
};
|
||||
|
||||
constant tint_array_wrapper_0 pos = {float2(0.0f, 0.5f), float2(-0.5f, -0.5f), float2(0.5f, -0.5f)};
|
||||
constant tint_array_wrapper pos = {.arr={float2(0.0f, 0.5f), float2(-0.5f, -0.5f), float2(0.5f, -0.5f)}};
|
||||
vertex tint_symbol_1 vtx_main(uint VertexIndex [[vertex_id]]) {
|
||||
tint_symbol_1 const tint_symbol_3 = {.value=float4(pos.array[VertexIndex], 0.0f, 1.0f)};
|
||||
tint_symbol_1 const tint_symbol_3 = {.value=float4(pos.arr[VertexIndex], 0.0f, 1.0f)};
|
||||
return tint_symbol_3;
|
||||
}
|
||||
|
||||
|
||||
@@ -16,14 +16,14 @@ struct S3 {
|
||||
S1 h;
|
||||
S2 i;
|
||||
};
|
||||
struct tint_array_wrapper_0 {
|
||||
int array[2];
|
||||
struct tint_array_wrapper {
|
||||
int arr[2];
|
||||
};
|
||||
struct T {
|
||||
tint_array_wrapper_0 a;
|
||||
tint_array_wrapper a;
|
||||
};
|
||||
struct tint_array_wrapper_1 {
|
||||
T array[2];
|
||||
T arr[2];
|
||||
};
|
||||
|
||||
kernel void tint_symbol() {
|
||||
@@ -53,15 +53,15 @@ kernel void tint_symbol() {
|
||||
S1 const tint_symbol_12 = {.a=2, .b=x, .c=(x + 1), .d=nested_nonempty.i.f.d};
|
||||
S2 const tint_symbol_13 = {.e=1, .f=tint_symbol_12};
|
||||
S1 const subexpr_nested_nonempty_with_expr = tint_symbol_13.f;
|
||||
tint_array_wrapper_1 const aosoa_empty = {};
|
||||
tint_array_wrapper_0 const tint_symbol_14 = {1, 2};
|
||||
tint_array_wrapper_1 const aosoa_empty = {.arr={}};
|
||||
tint_array_wrapper const tint_symbol_14 = {.arr={1, 2}};
|
||||
T const tint_symbol_15 = {.a=tint_symbol_14};
|
||||
tint_array_wrapper_0 const tint_symbol_16 = {3, 4};
|
||||
tint_array_wrapper const tint_symbol_16 = {.arr={3, 4}};
|
||||
T const tint_symbol_17 = {.a=tint_symbol_16};
|
||||
tint_array_wrapper_1 const aosoa_nonempty = {tint_symbol_15, tint_symbol_17};
|
||||
tint_array_wrapper_0 const tint_symbol_18 = {1, (aosoa_nonempty.array[0].a.array[0] + 1)};
|
||||
tint_array_wrapper_1 const aosoa_nonempty = {.arr={tint_symbol_15, tint_symbol_17}};
|
||||
tint_array_wrapper const tint_symbol_18 = {.arr={1, (aosoa_nonempty.arr[0].a.arr[0] + 1)}};
|
||||
T const tint_symbol_19 = {.a=tint_symbol_18};
|
||||
tint_array_wrapper_1 const aosoa_nonempty_with_expr = {tint_symbol_19, aosoa_nonempty.array[1]};
|
||||
tint_array_wrapper_1 const aosoa_nonempty_with_expr = {.arr={tint_symbol_19, aosoa_nonempty.arr[1]}};
|
||||
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() {
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
|
||||
@@ -4,12 +4,12 @@ using namespace metal;
|
||||
struct MyStruct {
|
||||
float f1;
|
||||
};
|
||||
struct tint_array_wrapper {
|
||||
float arr[10];
|
||||
};
|
||||
struct tint_symbol_1 {
|
||||
float4 value [[color(0)]];
|
||||
};
|
||||
struct tint_array_wrapper_0 {
|
||||
float array[10];
|
||||
};
|
||||
|
||||
int ret_i32() {
|
||||
return 1;
|
||||
@@ -28,8 +28,8 @@ MyStruct ret_MyStruct() {
|
||||
return tint_symbol_2;
|
||||
}
|
||||
|
||||
tint_array_wrapper_0 ret_MyArray() {
|
||||
tint_array_wrapper_0 const tint_symbol_3 = {};
|
||||
tint_array_wrapper ret_MyArray() {
|
||||
tint_array_wrapper const tint_symbol_3 = {.arr={}};
|
||||
return tint_symbol_3;
|
||||
}
|
||||
|
||||
@@ -42,13 +42,13 @@ void let_decls() {
|
||||
float3 const v6 = float3(1.0f, 1.0f, 1.0f);
|
||||
float3x3 const v7 = float3x3(v6, v6, v6);
|
||||
MyStruct const v8 = {.f1=1.0f};
|
||||
tint_array_wrapper_0 const v9 = {};
|
||||
tint_array_wrapper const v9 = {.arr={}};
|
||||
int const v10 = ret_i32();
|
||||
uint const v11 = ret_u32();
|
||||
float const v12 = ret_f32();
|
||||
MyStruct const v13 = ret_MyStruct();
|
||||
MyStruct const v14 = ret_MyStruct();
|
||||
tint_array_wrapper_0 const v15 = ret_MyArray();
|
||||
tint_array_wrapper const v15 = ret_MyArray();
|
||||
}
|
||||
|
||||
fragment tint_symbol_1 tint_symbol() {
|
||||
|
||||
@@ -4,12 +4,12 @@ using namespace metal;
|
||||
struct MyStruct {
|
||||
float f1;
|
||||
};
|
||||
struct tint_array_wrapper {
|
||||
float arr[10];
|
||||
};
|
||||
struct tint_symbol_1 {
|
||||
float4 value [[color(0)]];
|
||||
};
|
||||
struct tint_array_wrapper_0 {
|
||||
float array[10];
|
||||
};
|
||||
|
||||
int ret_i32() {
|
||||
return 1;
|
||||
@@ -28,8 +28,8 @@ MyStruct ret_MyStruct() {
|
||||
return tint_symbol_2;
|
||||
}
|
||||
|
||||
tint_array_wrapper_0 ret_MyArray() {
|
||||
tint_array_wrapper_0 const tint_symbol_3 = {};
|
||||
tint_array_wrapper ret_MyArray() {
|
||||
tint_array_wrapper const tint_symbol_3 = {.arr={}};
|
||||
return tint_symbol_3;
|
||||
}
|
||||
|
||||
@@ -42,13 +42,13 @@ void var_decls() {
|
||||
float3 v6 = float3(1.0f, 1.0f, 1.0f);
|
||||
float3x3 v7 = float3x3(v6, v6, v6);
|
||||
MyStruct v8 = {.f1=1.0f};
|
||||
tint_array_wrapper_0 v9 = {};
|
||||
tint_array_wrapper v9 = {.arr={}};
|
||||
int v10 = ret_i32();
|
||||
uint v11 = ret_u32();
|
||||
float v12 = ret_f32();
|
||||
MyStruct v13 = ret_MyStruct();
|
||||
MyStruct v14 = ret_MyStruct();
|
||||
tint_array_wrapper_0 v15 = ret_MyArray();
|
||||
tint_array_wrapper v15 = ret_MyArray();
|
||||
}
|
||||
|
||||
fragment tint_symbol_1 tint_symbol() {
|
||||
|
||||
@@ -4,12 +4,12 @@ using namespace metal;
|
||||
struct MyStruct {
|
||||
float f1;
|
||||
};
|
||||
struct tint_array_wrapper {
|
||||
float arr[10];
|
||||
};
|
||||
struct tint_symbol_1 {
|
||||
float4 value [[color(0)]];
|
||||
};
|
||||
struct tint_array_wrapper_0 {
|
||||
float array[10];
|
||||
};
|
||||
|
||||
constant int v1 = 1;
|
||||
constant uint v2 = 1u;
|
||||
@@ -19,7 +19,7 @@ constant uint3 v5 = uint3(1u, 1u, 1u);
|
||||
constant float3 v6 = float3(1.0f, 1.0f, 1.0f);
|
||||
constant float3x3 v7 = float3x3(float3(1.0f, 1.0f, 1.0f), float3(1.0f, 1.0f, 1.0f), float3(1.0f, 1.0f, 1.0f));
|
||||
constant MyStruct v8 = {};
|
||||
constant tint_array_wrapper_0 v9 = {};
|
||||
constant tint_array_wrapper v9 = {.arr={}};
|
||||
fragment tint_symbol_1 tint_symbol() {
|
||||
tint_symbol_1 const tint_symbol_2 = {.value=float4(0.0f, 0.0f, 0.0f, 0.0f)};
|
||||
return tint_symbol_2;
|
||||
|
||||
Reference in New Issue
Block a user