[Piglit] [PATCH 1/2] glsl-1.10: Don't set array members that are not used

Ian Romanick idr at freedesktop.org
Fri Nov 4 16:56:38 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>
---
 .../fs-uniform-array-mat2-col-rd.shader_test       |    1 -
 .../fs-uniform-array-mat2-col-row-rd.shader_test   |    1 -
 .../fs-uniform-array-mat2-rd.shader_test           |    1 -
 .../fs-uniform-array-mat2-row-rd.shader_test       |    1 -
 .../fs-uniform-array-mat3-col-rd.shader_test       |    1 -
 .../fs-uniform-array-mat3-col-row-rd.shader_test   |    1 -
 .../fs-uniform-array-mat3-rd.shader_test           |    1 -
 .../fs-uniform-array-mat3-row-rd.shader_test       |    1 -
 .../fs-uniform-array-mat4-col-rd.shader_test       |    1 -
 .../fs-uniform-array-mat4-col-row-rd.shader_test   |    1 -
 .../fs-uniform-array-mat4-rd.shader_test           |    1 -
 .../fs-uniform-array-mat4-row-rd.shader_test       |    1 -
 .../vs-uniform-array-mat2-col-rd.shader_test       |    1 -
 .../vs-uniform-array-mat2-col-row-rd.shader_test   |    1 -
 .../vs-uniform-array-mat2-rd.shader_test           |    1 -
 .../vs-uniform-array-mat2-row-rd.shader_test       |    1 -
 .../vs-uniform-array-mat3-col-rd.shader_test       |    1 -
 .../vs-uniform-array-mat3-col-row-rd.shader_test   |    1 -
 .../vs-uniform-array-mat3-rd.shader_test           |    1 -
 .../vs-uniform-array-mat3-row-rd.shader_test       |    1 -
 .../vs-uniform-array-mat4-col-rd.shader_test       |    1 -
 .../vs-uniform-array-mat4-col-row-rd.shader_test   |    1 -
 .../vs-uniform-array-mat4-rd.shader_test           |    1 -
 .../vs-uniform-array-mat4-row-rd.shader_test       |    1 -
 tests/spec/glsl-1.10/variable-index-read.sh        |    9 ++++++++-
 25 files changed, 8 insertions(+), 25 deletions(-)

diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat2-col-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat2-col-rd.shader_test
index 97eb1ea..dc81d67 100644
--- a/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat2-col-rd.shader_test
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat2-col-rd.shader_test
@@ -36,7 +36,6 @@ ortho
 
 uniform mat2x2 m[0] 1.0 2.0 3.0 4.0
 uniform mat2x2 m[1] 5.0 6.0 7.0 8.0
-uniform mat2x2 m[2] 9.0 10.0 11.0 12.0
 uniform int col 0
 uniform vec2 expect 5 6
 draw rect 45 5 10 10
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat2-col-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat2-col-row-rd.shader_test
index 325b9b0..eb5495a 100644
--- a/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat2-col-row-rd.shader_test
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat2-col-row-rd.shader_test
@@ -38,7 +38,6 @@ ortho
 
 uniform mat2x2 m[0] 1.0 2.0 3.0 4.0
 uniform mat2x2 m[1] 5.0 6.0 7.0 8.0
-uniform mat2x2 m[2] 9.0 10.0 11.0 12.0
 uniform int col 0
 uniform int row 0
 uniform float expect 5
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat2-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat2-rd.shader_test
index 504d66d..f099e2e 100644
--- a/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat2-rd.shader_test
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat2-rd.shader_test
@@ -34,7 +34,6 @@ ortho
 
 uniform mat2x2 m[0] 1.0 2.0 3.0 4.0
 uniform mat2x2 m[1] 5.0 6.0 7.0 8.0
-uniform mat2x2 m[2] 9.0 10.0 11.0 12.0
 uniform vec2 expect 7 8
 draw rect 60 5 10 10
 probe rgb 65 10 0.0 1.0 0.0
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat2-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat2-row-rd.shader_test
index c96e55c..8208f6f 100644
--- a/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat2-row-rd.shader_test
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat2-row-rd.shader_test
@@ -36,7 +36,6 @@ ortho
 
 uniform mat2x2 m[0] 1.0 2.0 3.0 4.0
 uniform mat2x2 m[1] 5.0 6.0 7.0 8.0
-uniform mat2x2 m[2] 9.0 10.0 11.0 12.0
 uniform int row 0
 uniform float expect 7
 draw rect 60 5 10 10
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat3-col-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat3-col-rd.shader_test
index 02810f6..a3366d1 100644
--- a/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat3-col-rd.shader_test
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat3-col-rd.shader_test
@@ -36,7 +36,6 @@ ortho
 
 uniform mat3x3 m[0] 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0
 uniform mat3x3 m[1] 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0
-uniform mat3x3 m[2] 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.0
 uniform int col 0
 uniform vec3 expect 10 11 12
 draw rect 60 5 10 10
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat3-col-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat3-col-row-rd.shader_test
index da038be..2c64e99 100644
--- a/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat3-col-row-rd.shader_test
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat3-col-row-rd.shader_test
@@ -38,7 +38,6 @@ ortho
 
 uniform mat3x3 m[0] 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0
 uniform mat3x3 m[1] 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0
-uniform mat3x3 m[2] 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.0
 uniform int col 0
 uniform int row 0
 uniform float expect 10
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat3-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat3-rd.shader_test
index 0d631c9..49a6e45 100644
--- a/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat3-rd.shader_test
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat3-rd.shader_test
@@ -34,7 +34,6 @@ ortho
 
 uniform mat3x3 m[0] 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0
 uniform mat3x3 m[1] 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0
-uniform mat3x3 m[2] 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.0
 uniform vec3 expect 13 14 15
 draw rect 75 5 10 10
 probe rgb 80 10 0.0 1.0 0.0
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat3-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat3-row-rd.shader_test
index 0086592..bcb6a49 100644
--- a/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat3-row-rd.shader_test
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat3-row-rd.shader_test
@@ -36,7 +36,6 @@ ortho
 
 uniform mat3x3 m[0] 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0
 uniform mat3x3 m[1] 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0
-uniform mat3x3 m[2] 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.0
 uniform int row 0
 uniform float expect 13
 draw rect 75 5 10 10
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat4-col-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat4-col-rd.shader_test
index 570c990..8bf8590 100644
--- a/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat4-col-rd.shader_test
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat4-col-rd.shader_test
@@ -36,7 +36,6 @@ ortho
 
 uniform mat4x4 m[0] 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 11.0 12.0 13.0 14.0 15.0 16.0
 uniform mat4x4 m[1] 17.0 18.0 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.0 28.0 29.0 30.0 31.0 32.0
-uniform mat4x4 m[2] 33.0 34.0 35.0 36.0 37.0 38.0 39.0 40.0 41.0 42.0 43.0 44.0 45.0 46.0 47.0 48.0
 uniform int col 0
 uniform vec4 expect 17 18 19 20
 draw rect 75 5 10 10
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat4-col-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat4-col-row-rd.shader_test
index cdc1d9d..b222503 100644
--- a/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat4-col-row-rd.shader_test
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat4-col-row-rd.shader_test
@@ -38,7 +38,6 @@ ortho
 
 uniform mat4x4 m[0] 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 11.0 12.0 13.0 14.0 15.0 16.0
 uniform mat4x4 m[1] 17.0 18.0 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.0 28.0 29.0 30.0 31.0 32.0
-uniform mat4x4 m[2] 33.0 34.0 35.0 36.0 37.0 38.0 39.0 40.0 41.0 42.0 43.0 44.0 45.0 46.0 47.0 48.0
 uniform int col 0
 uniform int row 0
 uniform float expect 17
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat4-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat4-rd.shader_test
index 52f4a4f..e102384 100644
--- a/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat4-rd.shader_test
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat4-rd.shader_test
@@ -34,7 +34,6 @@ ortho
 
 uniform mat4x4 m[0] 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 11.0 12.0 13.0 14.0 15.0 16.0
 uniform mat4x4 m[1] 17.0 18.0 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.0 28.0 29.0 30.0 31.0 32.0
-uniform mat4x4 m[2] 33.0 34.0 35.0 36.0 37.0 38.0 39.0 40.0 41.0 42.0 43.0 44.0 45.0 46.0 47.0 48.0
 uniform vec4 expect 21 22 23 24
 draw rect 90 5 10 10
 probe rgb 95 10 0.0 1.0 0.0
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat4-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat4-row-rd.shader_test
index 6e01a1c..72ca820 100644
--- a/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat4-row-rd.shader_test
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/fs-uniform-array-mat4-row-rd.shader_test
@@ -36,7 +36,6 @@ ortho
 
 uniform mat4x4 m[0] 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 11.0 12.0 13.0 14.0 15.0 16.0
 uniform mat4x4 m[1] 17.0 18.0 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.0 28.0 29.0 30.0 31.0 32.0
-uniform mat4x4 m[2] 33.0 34.0 35.0 36.0 37.0 38.0 39.0 40.0 41.0 42.0 43.0 44.0 45.0 46.0 47.0 48.0
 uniform int row 0
 uniform float expect 21
 draw rect 90 5 10 10
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat2-col-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat2-col-rd.shader_test
index 8830f8f..c61f9d6 100644
--- a/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat2-col-rd.shader_test
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat2-col-rd.shader_test
@@ -37,7 +37,6 @@ ortho
 
 uniform mat2x2 m[0] 1.0 2.0 3.0 4.0
 uniform mat2x2 m[1] 5.0 6.0 7.0 8.0
-uniform mat2x2 m[2] 9.0 10.0 11.0 12.0
 uniform int col 0
 uniform vec2 expect 5 6
 draw rect 45 5 10 10
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat2-col-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat2-col-row-rd.shader_test
index dd2ede8..67f7544 100644
--- a/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat2-col-row-rd.shader_test
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat2-col-row-rd.shader_test
@@ -39,7 +39,6 @@ ortho
 
 uniform mat2x2 m[0] 1.0 2.0 3.0 4.0
 uniform mat2x2 m[1] 5.0 6.0 7.0 8.0
-uniform mat2x2 m[2] 9.0 10.0 11.0 12.0
 uniform int col 0
 uniform int row 0
 uniform float expect 5
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat2-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat2-rd.shader_test
index cfef3fd..561dbe8 100644
--- a/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat2-rd.shader_test
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat2-rd.shader_test
@@ -35,7 +35,6 @@ ortho
 
 uniform mat2x2 m[0] 1.0 2.0 3.0 4.0
 uniform mat2x2 m[1] 5.0 6.0 7.0 8.0
-uniform mat2x2 m[2] 9.0 10.0 11.0 12.0
 uniform vec2 expect 7 8
 draw rect 60 5 10 10
 probe rgb 65 10 0.0 1.0 0.0
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat2-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat2-row-rd.shader_test
index 6f7c533..22f7002 100644
--- a/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat2-row-rd.shader_test
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat2-row-rd.shader_test
@@ -37,7 +37,6 @@ ortho
 
 uniform mat2x2 m[0] 1.0 2.0 3.0 4.0
 uniform mat2x2 m[1] 5.0 6.0 7.0 8.0
-uniform mat2x2 m[2] 9.0 10.0 11.0 12.0
 uniform int row 0
 uniform float expect 7
 draw rect 60 5 10 10
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat3-col-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat3-col-rd.shader_test
index a32d6e5..3d6664e 100644
--- a/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat3-col-rd.shader_test
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat3-col-rd.shader_test
@@ -37,7 +37,6 @@ ortho
 
 uniform mat3x3 m[0] 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0
 uniform mat3x3 m[1] 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0
-uniform mat3x3 m[2] 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.0
 uniform int col 0
 uniform vec3 expect 10 11 12
 draw rect 60 5 10 10
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat3-col-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat3-col-row-rd.shader_test
index ca98fdd..b2bde47 100644
--- a/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat3-col-row-rd.shader_test
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat3-col-row-rd.shader_test
@@ -39,7 +39,6 @@ ortho
 
 uniform mat3x3 m[0] 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0
 uniform mat3x3 m[1] 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0
-uniform mat3x3 m[2] 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.0
 uniform int col 0
 uniform int row 0
 uniform float expect 10
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat3-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat3-rd.shader_test
index f47e412..ab4bcd7 100644
--- a/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat3-rd.shader_test
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat3-rd.shader_test
@@ -35,7 +35,6 @@ ortho
 
 uniform mat3x3 m[0] 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0
 uniform mat3x3 m[1] 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0
-uniform mat3x3 m[2] 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.0
 uniform vec3 expect 13 14 15
 draw rect 75 5 10 10
 probe rgb 80 10 0.0 1.0 0.0
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat3-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat3-row-rd.shader_test
index 3111795..c0af950 100644
--- a/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat3-row-rd.shader_test
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat3-row-rd.shader_test
@@ -37,7 +37,6 @@ ortho
 
 uniform mat3x3 m[0] 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0
 uniform mat3x3 m[1] 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0
-uniform mat3x3 m[2] 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.0
 uniform int row 0
 uniform float expect 13
 draw rect 75 5 10 10
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat4-col-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat4-col-rd.shader_test
index ecae6a4..b69b344 100644
--- a/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat4-col-rd.shader_test
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat4-col-rd.shader_test
@@ -37,7 +37,6 @@ ortho
 
 uniform mat4x4 m[0] 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 11.0 12.0 13.0 14.0 15.0 16.0
 uniform mat4x4 m[1] 17.0 18.0 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.0 28.0 29.0 30.0 31.0 32.0
-uniform mat4x4 m[2] 33.0 34.0 35.0 36.0 37.0 38.0 39.0 40.0 41.0 42.0 43.0 44.0 45.0 46.0 47.0 48.0
 uniform int col 0
 uniform vec4 expect 17 18 19 20
 draw rect 75 5 10 10
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat4-col-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat4-col-row-rd.shader_test
index 8cb5971..be2ddc8 100644
--- a/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat4-col-row-rd.shader_test
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat4-col-row-rd.shader_test
@@ -39,7 +39,6 @@ ortho
 
 uniform mat4x4 m[0] 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 11.0 12.0 13.0 14.0 15.0 16.0
 uniform mat4x4 m[1] 17.0 18.0 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.0 28.0 29.0 30.0 31.0 32.0
-uniform mat4x4 m[2] 33.0 34.0 35.0 36.0 37.0 38.0 39.0 40.0 41.0 42.0 43.0 44.0 45.0 46.0 47.0 48.0
 uniform int col 0
 uniform int row 0
 uniform float expect 17
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat4-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat4-rd.shader_test
index 20664b1..6020714 100644
--- a/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat4-rd.shader_test
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat4-rd.shader_test
@@ -35,7 +35,6 @@ ortho
 
 uniform mat4x4 m[0] 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 11.0 12.0 13.0 14.0 15.0 16.0
 uniform mat4x4 m[1] 17.0 18.0 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.0 28.0 29.0 30.0 31.0 32.0
-uniform mat4x4 m[2] 33.0 34.0 35.0 36.0 37.0 38.0 39.0 40.0 41.0 42.0 43.0 44.0 45.0 46.0 47.0 48.0
 uniform vec4 expect 21 22 23 24
 draw rect 90 5 10 10
 probe rgb 95 10 0.0 1.0 0.0
diff --git a/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat4-row-rd.shader_test b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat4-row-rd.shader_test
index d089262..17487b9 100644
--- a/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat4-row-rd.shader_test
+++ b/tests/spec/glsl-1.10/execution/variable-indexing/vs-uniform-array-mat4-row-rd.shader_test
@@ -37,7 +37,6 @@ ortho
 
 uniform mat4x4 m[0] 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 11.0 12.0 13.0 14.0 15.0 16.0
 uniform mat4x4 m[1] 17.0 18.0 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.0 28.0 29.0 30.0 31.0 32.0
-uniform mat4x4 m[2] 33.0 34.0 35.0 36.0 37.0 38.0 39.0 40.0 41.0 42.0 43.0 44.0 45.0 46.0 47.0 48.0
 uniform int row 0
 uniform float expect 21
 draw rect 90 5 10 10
diff --git a/tests/spec/glsl-1.10/variable-index-read.sh b/tests/spec/glsl-1.10/variable-index-read.sh
index 4dc6b8d..b9f342e 100755
--- a/tests/spec/glsl-1.10/variable-index-read.sh
+++ b/tests/spec/glsl-1.10/variable-index-read.sh
@@ -272,12 +272,19 @@ EOF
 function emit_test_vectors
 {
     matrix_dim=$1
-    array_dim=$2
+    local array_dim=$2
     mode=$3
     index_value=$4
     col=$5
     expect_type=$6
 
+    # 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.
+    if [ "x$mode" = "xuniform" -a $v -le 110 -a $array_dim -ne 0 -a "x$index_value" != "xindex" ]; then
+	array_dim=$((index_value+1))
+    fi
+
     cat <<EOF
 [test]
 clear color 0.5 0.5 0.5 0.5
-- 
1.7.6.4



More information about the Piglit mailing list