[Piglit] [PATCH] glsl-fs-normalmatrix: Test for accessing each element of gl_NormalMatrix.

Eric Anholt eric at anholt.net
Thu Oct 20 09:14:37 PDT 2011


Catches a bug in the matrix setup on i965.
---
 tests/shaders/glsl-fs-normalmatrix.shader_test |   34 ++++++++++++++++++++++++
 1 files changed, 34 insertions(+), 0 deletions(-)
 create mode 100644 tests/shaders/glsl-fs-normalmatrix.shader_test

diff --git a/tests/shaders/glsl-fs-normalmatrix.shader_test b/tests/shaders/glsl-fs-normalmatrix.shader_test
new file mode 100644
index 0000000..50dd8c8
--- /dev/null
+++ b/tests/shaders/glsl-fs-normalmatrix.shader_test
@@ -0,0 +1,34 @@
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+void main()
+{
+	gl_Position = gl_Vertex;
+}
+
+[fragment shader]
+uniform int i;
+void main()
+{
+	gl_FragColor = vec4(gl_NormalMatrix[i], 0.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+
+uniform int i 0
+draw rect -1 -1 0.5 2
+
+uniform int i 1
+draw rect -0.5 -1 0.5 2
+
+uniform int i 2
+draw rect 0 -1 0.5 2
+
+relative probe rgba (0.125, 0.5) (1.0, 0.0, 0.0, 0.0)
+relative probe rgba (0.375, 0.5) (0.0, 1.0, 0.0, 0.0)
+relative probe rgba (0.625, 0.5) (0.0, 0.0, 1.0, 0.0)
+
+
-- 
1.7.7



More information about the Piglit mailing list