dawn-cmake/test/shader_io/shared_struct_helper_function.wgsl.expected.glsl
Stephen White ca4cfb9d6f GLSL: implement interpolation qualifiers.
Bug: tint:1399 tint:451
Change-Id: Idf02a98d2c51ab4d93847fc24a9d5a447ce3aaa3
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/78222
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2022-01-25 21:39:05 +00:00

88 lines
1.6 KiB
GLSL

#version 310 es
precision mediump float;
struct VertexOutput {
vec4 pos;
int loc0;
};
VertexOutput foo(float x) {
VertexOutput tint_symbol_2 = VertexOutput(vec4(x, x, x, 1.0f), 42);
return tint_symbol_2;
}
struct tint_symbol {
int loc0;
vec4 pos;
};
VertexOutput vert_main1_inner() {
return foo(0.5f);
}
struct tint_symbol_1 {
int loc0;
vec4 pos;
};
tint_symbol vert_main1() {
VertexOutput inner_result = vert_main1_inner();
tint_symbol wrapper_result = tint_symbol(0, vec4(0.0f, 0.0f, 0.0f, 0.0f));
wrapper_result.pos = inner_result.pos;
wrapper_result.loc0 = inner_result.loc0;
return wrapper_result;
}
layout(location = 0) flat out int loc0;
void main() {
tint_symbol outputs;
outputs = vert_main1();
loc0 = outputs.loc0;
gl_Position = outputs.pos;
gl_Position.y = -gl_Position.y;
}
#version 310 es
precision mediump float;
struct VertexOutput {
vec4 pos;
int loc0;
};
VertexOutput foo(float x) {
VertexOutput tint_symbol_2 = VertexOutput(vec4(x, x, x, 1.0f), 42);
return tint_symbol_2;
}
struct tint_symbol {
int loc0;
vec4 pos;
};
struct tint_symbol_1 {
int loc0;
vec4 pos;
};
VertexOutput vert_main2_inner() {
return foo(0.25f);
}
tint_symbol_1 vert_main2() {
VertexOutput inner_result_1 = vert_main2_inner();
tint_symbol_1 wrapper_result_1 = tint_symbol_1(0, vec4(0.0f, 0.0f, 0.0f, 0.0f));
wrapper_result_1.pos = inner_result_1.pos;
wrapper_result_1.loc0 = inner_result_1.loc0;
return wrapper_result_1;
}
layout(location = 0) flat out int loc0;
void main() {
tint_symbol_1 outputs;
outputs = vert_main2();
loc0 = outputs.loc0;
gl_Position = outputs.pos;
gl_Position.y = -gl_Position.y;
}