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

@@ -1,18 +1,12 @@
#version 310 es
precision mediump float;
struct tint_symbol_2 {
vec2 vUV;
};
struct tint_symbol_3 {
vec4 value;
};
layout(location = 0) in vec2 vUV_1;
layout(location = 0) out vec4 value;
uniform highp sampler2D randomTexture_Sampler;
uniform highp sampler2D depthTexture_Sampler;
vec4 tint_symbol_inner(vec2 vUV) {
vec4 tint_symbol(vec2 vUV) {
vec3 random = texture(randomTexture_Sampler, vUV).rgb;
int i = 0;
while (true) {
@@ -43,20 +37,8 @@ vec4 tint_symbol_inner(vec2 vUV) {
return vec4(1.0f);
}
tint_symbol_3 tint_symbol(tint_symbol_2 tint_symbol_1) {
vec4 inner_result = tint_symbol_inner(tint_symbol_1.vUV);
tint_symbol_3 wrapper_result = tint_symbol_3(vec4(0.0f, 0.0f, 0.0f, 0.0f));
wrapper_result.value = inner_result;
return wrapper_result;
}
layout(location = 0) in vec2 vUV;
layout(location = 0) out vec4 value;
void main() {
tint_symbol_2 inputs;
inputs.vUV = vUV;
tint_symbol_3 outputs;
outputs = tint_symbol(inputs);
value = outputs.value;
vec4 inner_result = tint_symbol(vUV_1);
value = inner_result;
return;
}