on master help sign in
add GLSL syntax highlighting test
commit8832a96e82cb7a1135d6188972f9634f21e83a4c authorDaniel Wolbach <daniel.wolbach@mailo.com> dateWed 7 Oct 2020, 17:11 (6 years ago) parent09631ed
2 files changed+84
tests/syntax-tests/highlighted/GLSL/test.glsl+42 tests/syntax-tests/source/GLSL/test.glsl+42
tests/syntax-tests/highlighted/GLSL/test.glslnew file+42
@@ -0,0 +1,42 @@
1+#version 330 core
2+
3+#ifdef TEST
4+layout (location = 0) in vec4 vertex;
5+#else
6+layout (location = 6) in vec4 vertex;
7+#endif
8+
9+out vec2 p_textureVertex;
10+
11+/*
12+ * This stores offsets
13+ */
14+struct Data
15+{
16+ double offsetX;
17+ double offsetY;
18+}
19+
20+uniform mat4 projectionMatrix;
21+uniform bool test;
22+uniform Data data;
23+
24+double calc()
25+{
26+ if (test)
27+ {
28+ return 1.0;
29+ }
30+ else
31+ {
32+ return 0.0;
33+ }
34+}
35+
36+void main()
37+{
38+ // This GLSL code serves the purpose of bat syntax highlighting tests
39+ double x = data.offsetX + calc();
40+ gl_Position = projectionMatrix * vec4(vertex.xy, data.offsetX, data.offsetY);
41+ p_textureVertex = vertex.zw;
42+}
tests/syntax-tests/source/GLSL/test.glslnew file+42
@@ -0,0 +1,42 @@
1+#version 330 core
2+
3+#ifdef TEST
4+layout (location = 0) in vec4 vertex;
5+#else
6+layout (location = 6) in vec4 vertex;
7+#endif
8+
9+out vec2 p_textureVertex;
10+
11+/*
12+ * This stores offsets
13+ */
14+struct Data
15+{
16+ double offsetX;
17+ double offsetY;
18+}
19+
20+uniform mat4 projectionMatrix;
21+uniform bool test;
22+uniform Data data;
23+
24+double calc()
25+{
26+ if (test)
27+ {
28+ return 1.0;
29+ }
30+ else
31+ {
32+ return 0.0;
33+ }
34+}
35+
36+void main()
37+{
38+ // This GLSL code serves the purpose of bat syntax highlighting tests
39+ double x = data.offsetX + calc();
40+ gl_Position = projectionMatrix * vec4(vertex.xy, data.offsetX, data.offsetY);
41+ p_textureVertex = vertex.zw;
42+}