GLSL: move entry point handling to CanonicalizeEntryPointIO transform.

Move builtin_to_string() and builtin_type() to
the CanonicalizeEntryPointIO transform. Use the former to
rename entry point IO variables to the gl_ names, and the latter
to cast values to the correct type.

Change-Id: Iddfad574ddd660ff1bfd89a399a001b967b6b67e
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/78380
Reviewed-by: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
This commit is contained in:
Stephen White
2022-01-28 22:36:58 +00:00
committed by Tint LUCI CQ
parent f34038b1a0
commit 0b39270e01
1735 changed files with 9397 additions and 30642 deletions

View File

@@ -16,17 +16,16 @@ void foo() {
}
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol() {
{
for(int i = 0; (i < 2); i = (i + 1)) {
foo();
}
}
return;
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() {
tint_symbol();
return;
}

View File

@@ -13,17 +13,16 @@ void foo() {
v2b[i] = true;
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol() {
{
for(int i = 0; (i < 2); i = (i + 1)) {
foo();
}
}
return;
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() {
tint_symbol();
return;
}

View File

@@ -1,7 +1,6 @@
#version 310 es
precision mediump float;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol() {
vec2 v2f = vec2(0.0f, 0.0f);
vec3 v3f = vec3(0.0f, 0.0f, 0.0f);
@@ -31,10 +30,10 @@ void tint_symbol() {
v4b[i] = true;
}
}
return;
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() {
tint_symbol();
return;
}

View File

@@ -1,7 +1,6 @@
#version 310 es
precision mediump float;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol() {
vec2 v2f = vec2(0.0f, 0.0f);
vec2 v2f_2 = vec2(0.0f, 0.0f);
@@ -23,10 +22,10 @@ void tint_symbol() {
v2b_2[i] = true;
}
}
return;
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() {
tint_symbol();
return;
}

View File

@@ -1,7 +1,6 @@
#version 310 es
precision mediump float;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol() {
vec2 v2f = vec2(0.0f, 0.0f);
vec3 v3f = vec3(0.0f, 0.0f, 0.0f);
@@ -32,10 +31,10 @@ void tint_symbol() {
v4u[i] = 1u;
v3b[i] = true;
v4b[i] = true;
return;
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() {
tint_symbol();
return;
}

View File

@@ -1,7 +1,6 @@
#version 310 es
precision mediump float;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol() {
vec2 v2f = vec2(0.0f, 0.0f);
vec3 v3f = vec3(0.0f, 0.0f, 0.0f);
@@ -28,10 +27,10 @@ void tint_symbol() {
v2b[i] = true;
v3b[i] = true;
v4b[i] = true;
return;
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() {
tint_symbol();
return;
}