tint/writer/msl: Inline constant expressions

This is required to handle materialized values, and for constant
expressions.

Bug: tint:1504
Change-Id: Ic3ac62317241fa6f7009360128f222aeb56f62e4
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/92083
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
This commit is contained in:
Ben Clayton
2022-06-01 10:08:29 +00:00
committed by Dawn LUCI CQ
parent 2e22d9285c
commit cb6ddd2aa6
1012 changed files with 1950 additions and 1852 deletions

View File

@@ -29,7 +29,7 @@ struct tint_symbol_3 {
};
float4 frag_main_inner() {
return float4(1.0f, 1.0f, 1.0f, 1.0f);
return float4(1.0f);
}
fragment tint_symbol_3 frag_main() {
@@ -69,9 +69,9 @@ void comp_main_inner(uint3 gl_GlobalInvocationID, device Particles* const tint_s
}
float2 vPos = (*(tint_symbol_4)).particles.arr[index].pos;
float2 vVel = (*(tint_symbol_4)).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);
float2 cMass = float2(0.0f);
float2 cVel = float2(0.0f);
float2 colVel = float2(0.0f);
int cMassCount = 0;
int cVelCount = 0;
float2 pos = 0.0f;

View File

@@ -9,7 +9,7 @@ struct tint_symbol_1 {
};
float4 tint_symbol_inner() {
float2 a = float2();
float2 a = float2(0.0f);
bar();
return float4(0.400000006f, 0.400000006f, 0.800000012f, 1.0f);
}

View File

@@ -2,7 +2,7 @@
using namespace metal;
void main_1(thread float4* const tint_symbol_3) {
*(tint_symbol_3) = float4(0.0f, 0.0f, 0.0f, 0.0f);
*(tint_symbol_3) = float4(0.0f);
return;
}

View File

@@ -5,7 +5,7 @@ struct tint_array_wrapper {
float2 arr[3];
};
constant tint_array_wrapper pos = {.arr={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), float2(0.5f, -0.5f)}};
struct tint_symbol {
float4 value [[position]];