dawn-cmake/test/tint/shader_io/interpolate_integers.wgsl.expected.glsl
Stephen White 790e4c2d60 GLSL writer: emit gl_PointSize = 1 in all vertex shaders for OpenGL.
The OpenGL ES 3.1 spec says:

"The point size is taken from the shader built-in gl_PointSize written by the vertex shader, and clamped to the implementation-dependent point size range. If the value written to gl_PointSize is less than or equal to zero, or if no value is written, the point size is undefined."

ANGLE/D3D11 will emit a warning on this and abort processing, causing dawn_end2end tests to fail.

Bug: dawn:1390
Change-Id: I6a56467842ba80d8a070af7240ee07bb111089dd
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/87720
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2022-04-22 21:25:02 +00:00

58 lines
1.3 KiB
GLSL

#version 310 es
layout(location = 0) flat out int i_1;
layout(location = 1) flat out uint u_1;
layout(location = 2) flat out ivec4 vi_1;
layout(location = 3) flat out uvec4 vu_1;
struct Interface {
int i;
uint u;
ivec4 vi;
uvec4 vu;
vec4 pos;
};
Interface vert_main() {
Interface tint_symbol = Interface(0, 0u, ivec4(0, 0, 0, 0), uvec4(0u, 0u, 0u, 0u), vec4(0.0f, 0.0f, 0.0f, 0.0f));
return tint_symbol;
}
void main() {
gl_PointSize = 1.0;
Interface inner_result = vert_main();
i_1 = inner_result.i;
u_1 = inner_result.u;
vi_1 = inner_result.vi;
vu_1 = inner_result.vu;
gl_Position = inner_result.pos;
gl_Position.y = -(gl_Position.y);
gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
return;
}
#version 310 es
precision mediump float;
layout(location = 0) flat in int i_1;
layout(location = 1) flat in uint u_1;
layout(location = 2) flat in ivec4 vi_1;
layout(location = 3) flat in uvec4 vu_1;
layout(location = 0) out int value;
struct Interface {
int i;
uint u;
ivec4 vi;
uvec4 vu;
vec4 pos;
};
int frag_main(Interface inputs) {
return inputs.i;
}
void main() {
Interface tint_symbol = Interface(i_1, u_1, vi_1, vu_1, gl_FragCoord);
int inner_result = frag_main(tint_symbol);
value = inner_result;
return;
}