summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2010-04-12 18:33:41 -0700
committerIan Romanick <ian.d.romanick@intel.com>2010-04-12 18:33:41 -0700
commit6cc75525c1cee5ad1cb41a277329f593e0dfb081 (patch)
tree2819362234f258f23f1f8af83e852440bb96d0a0
parent4e0859b707a350e99b396eb78e17b470ae7207d8 (diff)
shaders: Add generic test that replicates glsl-vs-if
-rw-r--r--tests/shaders/glsl-vs-if.shader_test28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/shaders/glsl-vs-if.shader_test b/tests/shaders/glsl-vs-if.shader_test
new file mode 100644
index 000000000..0962bfd13
--- /dev/null
+++ b/tests/shaders/glsl-vs-if.shader_test
@@ -0,0 +1,28 @@
+[require]
+GL >= 2.0
+GLSL >= 1.10
+
+[vertex shader]
+void main()
+{
+ if (gl_Vertex.x < 30.0)
+ gl_FrontColor = vec4(1.0, 0.0, 0.0, 0.0);
+ else
+ gl_FrontColor = vec4(0.0, 1.0, 0.0, 0.0);
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+}
+
+[fragment shader]
+void main()
+{
+ gl_FragColor = gl_Color;
+}
+
+[test]
+ortho
+clear color 0.5 0.5 0.5 0.5
+clear
+draw rect 10 10 10 10
+draw rect 30 10 10 10
+probe rgb 15 15 1.0 0.0 0.0
+probe rgb 35 15 0.0 1.0 0.0