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

@@ -4,7 +4,7 @@ using namespace metal;
kernel void f() {
float const a = 4.0f;
float3 const b = float3(1.0f, 2.0f, 3.0f);
float3 const r = (a * b);
float3 const r = (4.0f * float3(1.0f, 2.0f, 3.0f));
return;
}

View File

@@ -4,7 +4,7 @@ using namespace metal;
kernel void f() {
int const a = 4;
int3 const b = int3(1, 2, 3);
int3 const r = as_type<int3>((as_type<uint>(a) * as_type<uint3>(b)));
int3 const r = as_type<int3>((as_type<uint>(4) * as_type<uint3>(int3(1, 2, 3))));
return;
}

View File

@@ -4,7 +4,7 @@ using namespace metal;
kernel void f() {
uint const a = 4u;
uint3 const b = uint3(1u, 2u, 3u);
uint3 const r = (a * b);
uint3 const r = (4u * uint3(1u, 2u, 3u));
return;
}