[Piglit] [PATCH 2/2] Don't set array members that are not used

Ian Romanick idr at freedesktop.org
Fri Nov 4 16:56:39 PDT 2011


From: Ian Romanick <ian.d.romanick at intel.com>

Optimizing GLSL linkers may reduce the size of the uniform array if
tail elements are not accessed.  Shader runner will fail the test if
one of the set uniforms doesn't have a location.

Previously these tests would fail on AMD's closed-source driver for
this reason.  Now they pass.

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
---
 tests/shaders/glsl-fs-uniform-array-1.shader_test |    5 +++--
 tests/shaders/glsl-vs-uniform-array-1.shader_test |    5 +++--
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/tests/shaders/glsl-fs-uniform-array-1.shader_test b/tests/shaders/glsl-fs-uniform-array-1.shader_test
index b992588..3ab81d8 100644
--- a/tests/shaders/glsl-fs-uniform-array-1.shader_test
+++ b/tests/shaders/glsl-fs-uniform-array-1.shader_test
@@ -17,7 +17,8 @@ void main()
 [test]
 uniform vec4 arg[0] 1.0 0.0 0.0 0.0
 uniform vec4 arg[1] 0.0 1.0 0.0 0.0
-uniform vec4 arg[2] 0.0 0.0 1.0 0.0
-uniform vec4 arg[3] 1.0 0.0 1.0 0.0
+# The linker should optimize these members away, so don't set them.
+#uniform vec4 arg[2] 0.0 0.0 1.0 0.0
+#uniform vec4 arg[3] 1.0 0.0 1.0 0.0
 draw rect -1 -1 2 2
 probe rgb 1 1 0.0 1.0 0.0
diff --git a/tests/shaders/glsl-vs-uniform-array-1.shader_test b/tests/shaders/glsl-vs-uniform-array-1.shader_test
index 6719395..7c7bcdc 100644
--- a/tests/shaders/glsl-vs-uniform-array-1.shader_test
+++ b/tests/shaders/glsl-vs-uniform-array-1.shader_test
@@ -20,7 +20,8 @@ void main()
 [test]
 uniform vec4 arg[0] 1.0 0.0 0.0 0.0
 uniform vec4 arg[1] 0.0 1.0 0.0 0.0
-uniform vec4 arg[2] 0.0 0.0 1.0 0.0
-uniform vec4 arg[3] 1.0 0.0 1.0 0.0
+# The linker should optimize these members away, so don't set them.
+#uniform vec4 arg[2] 0.0 0.0 1.0 0.0
+#uniform vec4 arg[3] 1.0 0.0 1.0 0.0
 draw rect -1 -1 2 2
 probe rgb 1 1 0.0 1.0 0.0
-- 
1.7.6.4



More information about the Piglit mailing list