]> git.tdb.fi Git - libs/gl.git/blobdiff - tests/glsl/function_override.glsl
Add GLSL keywords for overriding functions
[libs/gl.git] / tests / glsl / function_override.glsl
diff --git a/tests/glsl/function_override.glsl b/tests/glsl/function_override.glsl
new file mode 100644 (file)
index 0000000..c7e64d5
--- /dev/null
@@ -0,0 +1,22 @@
+#pragma MSP stage(vertex)
+layout(location=0) in vec4 position;
+virtual float get_scale()
+{
+       return 1.0;
+}
+int main()
+{
+       gl_Position = position*get_scale();
+}
+float get_scale() override
+{
+       return 2.0;
+}
+
+/* Expected output: vertex
+layout(location=0) in vec4 position;
+int main()
+{
+       gl_Position = position*2.0;
+}
+*/