mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-16 16:37:08 +00:00
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:
committed by
Dawn LUCI CQ
parent
2e22d9285c
commit
cb6ddd2aa6
@@ -4,7 +4,7 @@ using namespace metal;
|
||||
kernel void f() {
|
||||
float const a = 1.0f;
|
||||
float const b = 2.0f;
|
||||
float const r = (a / b);
|
||||
float const r = (1.0f / 2.0f);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ using namespace metal;
|
||||
kernel void f() {
|
||||
int const a = 1;
|
||||
int const b = 2;
|
||||
int const r = (a / b);
|
||||
int const r = (1 / 2);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ using namespace metal;
|
||||
kernel void f() {
|
||||
uint const a = 1u;
|
||||
uint const b = 2u;
|
||||
uint const r = (a / b);
|
||||
uint const r = (1u / 2u);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ using namespace metal;
|
||||
kernel void f() {
|
||||
int const a = 4;
|
||||
int3 const b = int3(1, 2, 3);
|
||||
int3 const r = (a / b);
|
||||
int3 const r = (4 / int3(1, 2, 3));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ using namespace metal;
|
||||
kernel void f() {
|
||||
float3 const a = float3(1.0f, 2.0f, 3.0f);
|
||||
float const b = 4.0f;
|
||||
float3 const r = (a / b);
|
||||
float3 const r = (float3(1.0f, 2.0f, 3.0f) / 4.0f);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ using namespace metal;
|
||||
kernel void f() {
|
||||
int3 const a = int3(1, 2, 3);
|
||||
int const b = 4;
|
||||
int3 const r = (a / b);
|
||||
int3 const r = (int3(1, 2, 3) / 4);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ using namespace metal;
|
||||
kernel void f() {
|
||||
uint3 const a = uint3(1u, 2u, 3u);
|
||||
uint const b = 4u;
|
||||
uint3 const r = (a / b);
|
||||
uint3 const r = (uint3(1u, 2u, 3u) / 4u);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ using namespace metal;
|
||||
kernel void f() {
|
||||
float3 const a = float3(1.0f, 2.0f, 3.0f);
|
||||
float3 const b = float3(4.0f, 5.0f, 6.0f);
|
||||
float3 const r = (a / b);
|
||||
float3 const r = (float3(1.0f, 2.0f, 3.0f) / float3(4.0f, 5.0f, 6.0f));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ using namespace metal;
|
||||
kernel void f() {
|
||||
int3 const a = int3(1, 2, 3);
|
||||
int3 const b = int3(4, 5, 6);
|
||||
int3 const r = (a / b);
|
||||
int3 const r = (int3(1, 2, 3) / int3(4, 5, 6));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ using namespace metal;
|
||||
kernel void f() {
|
||||
uint3 const a = uint3(1u, 2u, 3u);
|
||||
uint3 const b = uint3(4u, 5u, 6u);
|
||||
uint3 const r = (a / b);
|
||||
uint3 const r = (uint3(1u, 2u, 3u) / uint3(4u, 5u, 6u));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user