From 6fbd668bd3c41e5093706b758c8dba7614511cd7 Mon Sep 17 00:00:00 2001 From: Dzmitry Malyshau Date: Thu, 2 Dec 2021 13:07:51 -0500 Subject: [PATCH] Add missing GLSL tests --- .../glsl/interpolate.frag_main.Fragment.glsl | 25 +++++++++++ .../glsl/interpolate.vert_main.Vertex.glsl | 42 +++++++++++++++++++ tests/out/glsl/quad.frag_main.Fragment.glsl | 26 ++++++++++++ tests/out/glsl/quad.vert_main.Vertex.glsl | 23 ++++++++++ 4 files changed, 116 insertions(+) create mode 100644 tests/out/glsl/interpolate.frag_main.Fragment.glsl create mode 100644 tests/out/glsl/interpolate.vert_main.Vertex.glsl create mode 100644 tests/out/glsl/quad.frag_main.Fragment.glsl create mode 100644 tests/out/glsl/quad.vert_main.Vertex.glsl diff --git a/tests/out/glsl/interpolate.frag_main.Fragment.glsl b/tests/out/glsl/interpolate.frag_main.Fragment.glsl new file mode 100644 index 0000000000..918e78b9cf --- /dev/null +++ b/tests/out/glsl/interpolate.frag_main.Fragment.glsl @@ -0,0 +1,25 @@ +#version 400 core +struct FragmentInput { + vec4 position; + uint flat_; + float linear; + vec2 linear_centroid; + vec3 linear_sample; + vec4 perspective; + float perspective_centroid; + float perspective_sample; +}; + +flat in uint _vs2fs_location0; +noperspective in float _vs2fs_location1; +noperspective centroid in vec2 _vs2fs_location2; +noperspective sample in vec3 _vs2fs_location3; +smooth in vec4 _vs2fs_location4; +smooth centroid in float _vs2fs_location5; +smooth sample in float _vs2fs_location6; + +void main() { + FragmentInput val = FragmentInput(gl_FragCoord, _vs2fs_location0, _vs2fs_location1, _vs2fs_location2, _vs2fs_location3, _vs2fs_location4, _vs2fs_location5, _vs2fs_location6); + return; +} + diff --git a/tests/out/glsl/interpolate.vert_main.Vertex.glsl b/tests/out/glsl/interpolate.vert_main.Vertex.glsl new file mode 100644 index 0000000000..40d64ccf0d --- /dev/null +++ b/tests/out/glsl/interpolate.vert_main.Vertex.glsl @@ -0,0 +1,42 @@ +#version 400 core +struct FragmentInput { + vec4 position; + uint flat_; + float linear; + vec2 linear_centroid; + vec3 linear_sample; + vec4 perspective; + float perspective_centroid; + float perspective_sample; +}; + +flat out uint _vs2fs_location0; +noperspective out float _vs2fs_location1; +noperspective centroid out vec2 _vs2fs_location2; +noperspective sample out vec3 _vs2fs_location3; +smooth out vec4 _vs2fs_location4; +smooth centroid out float _vs2fs_location5; +smooth sample out float _vs2fs_location6; + +void main() { + FragmentInput out_; + out_.position = vec4(2.0, 4.0, 5.0, 6.0); + out_.flat_ = 8u; + out_.linear = 27.0; + out_.linear_centroid = vec2(64.0, 125.0); + out_.linear_sample = vec3(216.0, 343.0, 512.0); + out_.perspective = vec4(729.0, 1000.0, 1331.0, 1728.0); + out_.perspective_centroid = 2197.0; + out_.perspective_sample = 2744.0; + FragmentInput _e30 = out_; + gl_Position = _e30.position; + _vs2fs_location0 = _e30.flat_; + _vs2fs_location1 = _e30.linear; + _vs2fs_location2 = _e30.linear_centroid; + _vs2fs_location3 = _e30.linear_sample; + _vs2fs_location4 = _e30.perspective; + _vs2fs_location5 = _e30.perspective_centroid; + _vs2fs_location6 = _e30.perspective_sample; + return; +} + diff --git a/tests/out/glsl/quad.frag_main.Fragment.glsl b/tests/out/glsl/quad.frag_main.Fragment.glsl new file mode 100644 index 0000000000..b290ed5a0e --- /dev/null +++ b/tests/out/glsl/quad.frag_main.Fragment.glsl @@ -0,0 +1,26 @@ +#version 300 es + +precision highp float; +precision highp int; + +struct VertexOutput { + vec2 uv; + vec4 position; +}; + +uniform highp sampler2D _group_0_binding_0; + +smooth in vec2 _vs2fs_location0; +layout(location = 0) out vec4 _fs2p_location0; + +void main() { + vec2 uv_1 = _vs2fs_location0; + vec4 color = texture(_group_0_binding_0, vec2(uv_1)); + if ((color.w == 0.0)) { + discard; + } + vec4 premultiplied = (color.w * color); + _fs2p_location0 = premultiplied; + return; +} + diff --git a/tests/out/glsl/quad.vert_main.Vertex.glsl b/tests/out/glsl/quad.vert_main.Vertex.glsl new file mode 100644 index 0000000000..cda43f5086 --- /dev/null +++ b/tests/out/glsl/quad.vert_main.Vertex.glsl @@ -0,0 +1,23 @@ +#version 300 es + +precision highp float; +precision highp int; + +struct VertexOutput { + vec2 uv; + vec4 position; +}; + +layout(location = 0) in vec2 _p2vs_location0; +layout(location = 1) in vec2 _p2vs_location1; +smooth out vec2 _vs2fs_location0; + +void main() { + vec2 pos = _p2vs_location0; + vec2 uv = _p2vs_location1; + VertexOutput _tmp_return = VertexOutput(uv, vec4((1.2000000476837158 * pos), 0.0, 1.0)); + _vs2fs_location0 = _tmp_return.uv; + gl_Position = _tmp_return.position; + return; +} +