summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDaniel Wolbach <daniel.wolbach@mailo.com>2020-10-07 17:11:26 +0200
committerDavid Peter <sharkdp@users.noreply.github.com>2020-10-07 17:58:33 +0200
commit8832a96e82cb7a1135d6188972f9634f21e83a4c (patch)
tree2ca5f8d50e4411c8af4731ff1a3f60d8a320f2c2 /tests
parent09631ed119d94504f6701326b2321569890160c6 (diff)
add GLSL syntax highlighting test
Diffstat (limited to 'tests')
-rw-r--r--tests/syntax-tests/highlighted/GLSL/test.glsl42
-rw-r--r--tests/syntax-tests/source/GLSL/test.glsl42
2 files changed, 84 insertions, 0 deletions
diff --git a/tests/syntax-tests/highlighted/GLSL/test.glsl b/tests/syntax-tests/highlighted/GLSL/test.glsl
new file mode 100644
index 00000000..1233c312
--- /dev/null
+++ b/tests/syntax-tests/highlighted/GLSL/test.glsl
@@ -0,0 +1,42 @@
+#version 330 core
+
+#ifdef TEST
+layout (location = 0) in vec4 vertex;
+#else
+layout (location = 6) in vec4 vertex;
+#endif
+
+out vec2 p_textureVertex;
+
+/*
+ * This stores offsets
+ */
+struct Data
+{
+ double offsetX;
+ double offsetY;
+}
+
+uniform mat4 projectionMatrix;
+uniform bool test;
+uniform Data data;
+
+double calc()
+{
+ if (test)
+ {
+ return 1.0;
+ }
+ else
+ {
+ return 0.0;
+ }
+}
+
+void main()
+{
+ // This GLSL code serves the purpose of bat syntax highlighting tests
+ double x = data.offsetX + calc();
+ gl_Position = projectionMatrix * vec4(vertex.xy, data.offsetX, data.offsetY);
+ p_textureVertex = vertex.zw;
+}
diff --git a/tests/syntax-tests/source/GLSL/test.glsl b/tests/syntax-tests/source/GLSL/test.glsl
new file mode 100644
index 00000000..c0dda705
--- /dev/null
+++ b/tests/syntax-tests/source/GLSL/test.glsl
@@ -0,0 +1,42 @@
+#version 330 core
+
+#ifdef TEST
+layout (location = 0) in vec4 vertex;
+#else
+layout (location = 6) in vec4 vertex;
+#endif
+
+out vec2 p_textureVertex;
+
+/*
+ * This stores offsets
+ */
+struct Data
+{
+ double offsetX;
+ double offsetY;
+}
+
+uniform mat4 projectionMatrix;
+uniform bool test;
+uniform Data data;
+
+double calc()
+{
+ if (test)
+ {
+ return 1.0;
+ }
+ else
+ {
+ return 0.0;
+ }
+}
+
+void main()
+{
+ // This GLSL code serves the purpose of bat syntax highlighting tests
+ double x = data.offsetX + calc();
+ gl_Position = projectionMatrix * vec4(vertex.xy, data.offsetX, data.offsetY);
+ p_textureVertex = vertex.zw;
+}