[Piglit] [PATCH v2 05/17] arb_gl_spirv: add GL_ACTIVE_UNIFORMS checks

Alejandro PiƱeiro apinheiro at igalia.com
Thu Sep 27 09:54:55 UTC 2018


Right now the main reason is to check that we are expanding uniforms
for arrays and array of arrays of structs properly. This would be even
more important with UBO/SSBO tests.

The other reason is to check that hidden uniforms are really
hidden. As far as we know, current arb_gl_spirv tests doesn't use
internally any hidden uniform, at least on the i965 driver. But we
know of cases that will be send as tests in the future.
---
 tests/spec/arb_gl_spirv/execution/uniform/array.shader_test           | 2 ++
 .../spec/arb_gl_spirv/execution/uniform/arrays-of-arrays.shader_test  | 2 ++
 .../arb_gl_spirv/execution/uniform/atomic-uint-aoa-cs.shader_test     | 2 ++
 .../arb_gl_spirv/execution/uniform/atomic-uint-aoa-fs.shader_test     | 2 ++
 .../arb_gl_spirv/execution/uniform/atomic-uint-array-cs.shader_test   | 2 ++
 .../arb_gl_spirv/execution/uniform/atomic-uint-array-fs.shader_test   | 2 ++
 tests/spec/arb_gl_spirv/execution/uniform/atomic-uint-cs.shader_test  | 2 ++
 .../spec/arb_gl_spirv/execution/uniform/atomic-uint-fs.shader_runner  | 1 +
 .../uniform/atomic-uint-mixing-with-normal-uniforms.shader_test       | 2 ++
 .../execution/uniform/atomic-uint-several-slots.shader_test           | 2 ++
 .../spec/arb_gl_spirv/execution/uniform/embedded-structs.shader_test  | 2 ++
 .../arb_gl_spirv/execution/uniform/index-matches-location.shader_test | 2 ++
 .../arb_gl_spirv/execution/uniform/initializer-complex.shader_test    | 2 ++
 .../spec/arb_gl_spirv/execution/uniform/initializer-dvec4.shader_test | 3 +++
 .../arb_gl_spirv/execution/uniform/initializer-mat4x3.shader_test     | 4 ++++
 tests/spec/arb_gl_spirv/execution/uniform/initializer.shader_test     | 2 ++
 .../execution/uniform/nonsequential-locations.shader_test             | 2 ++
 .../execution/uniform/sampler2d-binding-array.shader_test             | 2 ++
 .../spec/arb_gl_spirv/execution/uniform/sampler2d-binding.shader_test | 2 ++
 .../execution/uniform/sampler2d-nonconst-nested-array.shader_test     | 2 ++
 .../spec/arb_gl_spirv/execution/uniform/sampler2d-struct.shader_test  | 2 ++
 tests/spec/arb_gl_spirv/execution/uniform/sampler2d.shader_test       | 2 ++
 .../arb_gl_spirv/execution/uniform/simple-without-names.shader_test   | 2 ++
 tests/spec/arb_gl_spirv/execution/uniform/simple.shader_test          | 2 ++
 tests/spec/arb_gl_spirv/execution/uniform/struct-array.shader_test    | 2 ++
 tests/spec/arb_gl_spirv/execution/uniform/struct.shader_test          | 2 ++
 tests/spec/arb_gl_spirv/execution/uniform/two-uniforms.shader_test    | 2 ++
 27 files changed, 56 insertions(+)

diff --git a/tests/spec/arb_gl_spirv/execution/uniform/array.shader_test b/tests/spec/arb_gl_spirv/execution/uniform/array.shader_test
index 54ac66b42..18ae3ca09 100644
--- a/tests/spec/arb_gl_spirv/execution/uniform/array.shader_test
+++ b/tests/spec/arb_gl_spirv/execution/uniform/array.shader_test
@@ -133,5 +133,7 @@ clear
 uniform vec4 0 0.2 0.1 0.1 1.6
 uniform vec4 1 0.5 2.0 3.0 0.25
 
+verify program_query GL_ACTIVE_UNIFORMS 1
+
 draw rect -1 -1 2 2
 probe all rgba 0.1 0.2 0.3 0.4
diff --git a/tests/spec/arb_gl_spirv/execution/uniform/arrays-of-arrays.shader_test b/tests/spec/arb_gl_spirv/execution/uniform/arrays-of-arrays.shader_test
index 07e32560b..5c9b97fed 100644
--- a/tests/spec/arb_gl_spirv/execution/uniform/arrays-of-arrays.shader_test
+++ b/tests/spec/arb_gl_spirv/execution/uniform/arrays-of-arrays.shader_test
@@ -73,5 +73,7 @@ uniform vec4 11 0.4 0.5 0.6 0.7
 uniform vec4 12 0.8 0.9 1.0 1.1
 uniform vec4 13 0.1 0.2 0.3 0.4
 
+verify program_query GL_ACTIVE_UNIFORMS 2
+
 draw rect -1 -1 1 1
 relative probe rect rgb (0.0, 0.0, 0.5, 0.5) (0.1, 0.3, 0.5)
diff --git a/tests/spec/arb_gl_spirv/execution/uniform/atomic-uint-aoa-cs.shader_test b/tests/spec/arb_gl_spirv/execution/uniform/atomic-uint-aoa-cs.shader_test
index 5bc3850bf..eafc6e2e2 100644
--- a/tests/spec/arb_gl_spirv/execution/uniform/atomic-uint-aoa-cs.shader_test
+++ b/tests/spec/arb_gl_spirv/execution/uniform/atomic-uint-aoa-cs.shader_test
@@ -216,6 +216,8 @@ uniform uint 11 14  # a01_expected[5]
 
 uniform uint 12 30  # a12_expected
 
+verify program_query GL_ACTIVE_UNIFORMS 8
+
 # Check original values for the atomic counters
 
 probe atomic counter buffer 0 0 == 0
diff --git a/tests/spec/arb_gl_spirv/execution/uniform/atomic-uint-aoa-fs.shader_test b/tests/spec/arb_gl_spirv/execution/uniform/atomic-uint-aoa-fs.shader_test
index f259d3c0f..f24dd8659 100644
--- a/tests/spec/arb_gl_spirv/execution/uniform/atomic-uint-aoa-fs.shader_test
+++ b/tests/spec/arb_gl_spirv/execution/uniform/atomic-uint-aoa-fs.shader_test
@@ -197,6 +197,8 @@ uniform uint 0 3
 uniform uint 1 15
 uniform uint 2 17
 
+verify program_query GL_ACTIVE_UNIFORMS 5
+
 # Check original values for the atomic counters
 
 probe atomic counter buffer 0 0 == 0   # outside array (offset qualifier was 4)
diff --git a/tests/spec/arb_gl_spirv/execution/uniform/atomic-uint-array-cs.shader_test b/tests/spec/arb_gl_spirv/execution/uniform/atomic-uint-array-cs.shader_test
index a9f831dbd..0f76c03c9 100644
--- a/tests/spec/arb_gl_spirv/execution/uniform/atomic-uint-array-cs.shader_test
+++ b/tests/spec/arb_gl_spirv/execution/uniform/atomic-uint-array-cs.shader_test
@@ -212,6 +212,8 @@ uniform uint 11 14  # a1_expected[5]
 
 uniform uint 12 30  # a2_expected
 
+verify program_query GL_ACTIVE_UNIFORMS 7
+
 # Check original values for the atomic counters
 
 probe atomic counter buffer 0 0 == 0
diff --git a/tests/spec/arb_gl_spirv/execution/uniform/atomic-uint-array-fs.shader_test b/tests/spec/arb_gl_spirv/execution/uniform/atomic-uint-array-fs.shader_test
index 444d0aaa9..b8ee606c8 100644
--- a/tests/spec/arb_gl_spirv/execution/uniform/atomic-uint-array-fs.shader_test
+++ b/tests/spec/arb_gl_spirv/execution/uniform/atomic-uint-array-fs.shader_test
@@ -192,6 +192,8 @@ uniform uint 0 3
 uniform uint 1 9
 uniform uint 2 14
 
+verify program_query GL_ACTIVE_UNIFORMS 4
+
 # Check original values for the atomic counters
 
 probe atomic counter buffer 0 0 == 2
diff --git a/tests/spec/arb_gl_spirv/execution/uniform/atomic-uint-cs.shader_test b/tests/spec/arb_gl_spirv/execution/uniform/atomic-uint-cs.shader_test
index ad2896a8a..c606cfeca 100644
--- a/tests/spec/arb_gl_spirv/execution/uniform/atomic-uint-cs.shader_test
+++ b/tests/spec/arb_gl_spirv/execution/uniform/atomic-uint-cs.shader_test
@@ -217,6 +217,8 @@ uniform uint 11 4  # b0_expected[5]
 
 uniform uint 12 7  # c0_expected
 
+verify program_query GL_ACTIVE_UNIFORMS 9
+
 # Check original values for the atomic counters
 
 probe atomic counter buffer 3 20 == 0
diff --git a/tests/spec/arb_gl_spirv/execution/uniform/atomic-uint-fs.shader_runner b/tests/spec/arb_gl_spirv/execution/uniform/atomic-uint-fs.shader_runner
index 9cf7139d0..e4928b274 100644
--- a/tests/spec/arb_gl_spirv/execution/uniform/atomic-uint-fs.shader_runner
+++ b/tests/spec/arb_gl_spirv/execution/uniform/atomic-uint-fs.shader_runner
@@ -198,6 +198,7 @@ uniform uint 0 5
 uniform uint 1 10
 uniform uint 2 14
 
+verify program_query GL_ACTIVE_UNIFORMS 6
 # Check original values for the atomic counters
 
 probe atomic counter buffer 0 0 == 0
diff --git a/tests/spec/arb_gl_spirv/execution/uniform/atomic-uint-mixing-with-normal-uniforms.shader_test b/tests/spec/arb_gl_spirv/execution/uniform/atomic-uint-mixing-with-normal-uniforms.shader_test
index 5029dd561..1a61e2648 100644
--- a/tests/spec/arb_gl_spirv/execution/uniform/atomic-uint-mixing-with-normal-uniforms.shader_test
+++ b/tests/spec/arb_gl_spirv/execution/uniform/atomic-uint-mixing-with-normal-uniforms.shader_test
@@ -187,6 +187,8 @@ atomic counter 0 1 3
 atomic counter 0 2 5
 atomic counter 0 3 7
 
+verify program_query GL_ACTIVE_UNIFORMS 8
+
 draw rect -1 -1 2 2
 
 probe atomic counter 0 == 1
diff --git a/tests/spec/arb_gl_spirv/execution/uniform/atomic-uint-several-slots.shader_test b/tests/spec/arb_gl_spirv/execution/uniform/atomic-uint-several-slots.shader_test
index 5029dd561..1a61e2648 100644
--- a/tests/spec/arb_gl_spirv/execution/uniform/atomic-uint-several-slots.shader_test
+++ b/tests/spec/arb_gl_spirv/execution/uniform/atomic-uint-several-slots.shader_test
@@ -187,6 +187,8 @@ atomic counter 0 1 3
 atomic counter 0 2 5
 atomic counter 0 3 7
 
+verify program_query GL_ACTIVE_UNIFORMS 8
+
 draw rect -1 -1 2 2
 
 probe atomic counter 0 == 1
diff --git a/tests/spec/arb_gl_spirv/execution/uniform/embedded-structs.shader_test b/tests/spec/arb_gl_spirv/execution/uniform/embedded-structs.shader_test
index 0dd7ba486..03006c3f2 100644
--- a/tests/spec/arb_gl_spirv/execution/uniform/embedded-structs.shader_test
+++ b/tests/spec/arb_gl_spirv/execution/uniform/embedded-structs.shader_test
@@ -147,5 +147,7 @@ uniform float 9 0.2
 uniform float 10 0.22
 uniform float 11 0.24
 
+verify program_query GL_ACTIVE_UNIFORMS 12
+
 draw rect -1 -1 2 2
 probe all rgba 0.2 0.52 0.84 1.0
diff --git a/tests/spec/arb_gl_spirv/execution/uniform/index-matches-location.shader_test b/tests/spec/arb_gl_spirv/execution/uniform/index-matches-location.shader_test
index 3b2e894cf..4511135ac 100644
--- a/tests/spec/arb_gl_spirv/execution/uniform/index-matches-location.shader_test
+++ b/tests/spec/arb_gl_spirv/execution/uniform/index-matches-location.shader_test
@@ -96,5 +96,7 @@ uniform float 0 0.1
 uniform float 1 0.6
 uniform float 2 0.25
 
+verify program_query GL_ACTIVE_UNIFORMS 3
+
 draw rect -1 -1 2 2
 probe all rgba 0.0 0.95 0.0 1.0
diff --git a/tests/spec/arb_gl_spirv/execution/uniform/initializer-complex.shader_test b/tests/spec/arb_gl_spirv/execution/uniform/initializer-complex.shader_test
index 5db111b25..8d6edbad3 100644
--- a/tests/spec/arb_gl_spirv/execution/uniform/initializer-complex.shader_test
+++ b/tests/spec/arb_gl_spirv/execution/uniform/initializer-complex.shader_test
@@ -176,5 +176,7 @@ void main()
 clear color 1.0 0.0 0.0 1.0
 clear
 
+verify program_query GL_ACTIVE_UNIFORMS 17
+
 draw rect -1 -1 2 2
 probe all rgba 0.30 0.97 0.26 1.0
diff --git a/tests/spec/arb_gl_spirv/execution/uniform/initializer-dvec4.shader_test b/tests/spec/arb_gl_spirv/execution/uniform/initializer-dvec4.shader_test
index 8b9f0952d..195e5a16e 100644
--- a/tests/spec/arb_gl_spirv/execution/uniform/initializer-dvec4.shader_test
+++ b/tests/spec/arb_gl_spirv/execution/uniform/initializer-dvec4.shader_test
@@ -64,5 +64,8 @@ draw rect -1 -1 1 2
 uniform dvec4 0 0.0 0.0 1.0 0.0
 draw rect 0 -1 1 2
 uniform dvec4 0 0.0 1.0 0.0 0.0
+
+verify program_query GL_ACTIVE_UNIFORMS 1
+
 relative probe rgb (0.25, 0.5) (0.0, 1.0, 0.0)
 relative probe rgb (0.75, 0.5) (0.0, 0.0, 1.0)
diff --git a/tests/spec/arb_gl_spirv/execution/uniform/initializer-mat4x3.shader_test b/tests/spec/arb_gl_spirv/execution/uniform/initializer-mat4x3.shader_test
index 9ebacba5c..035476c8b 100644
--- a/tests/spec/arb_gl_spirv/execution/uniform/initializer-mat4x3.shader_test
+++ b/tests/spec/arb_gl_spirv/execution/uniform/initializer-mat4x3.shader_test
@@ -79,5 +79,9 @@ void main()
 
 [test]
 uniform vec4 1 1.0 0.0 0.5 0.0
+
+verify program_query GL_ACTIVE_UNIFORMS 2
+
 draw rect -1 -1 2 2
 probe all rgba 0.0 1.0 0.5 0.0
+
diff --git a/tests/spec/arb_gl_spirv/execution/uniform/initializer.shader_test b/tests/spec/arb_gl_spirv/execution/uniform/initializer.shader_test
index b46beb837..f3a88e97b 100644
--- a/tests/spec/arb_gl_spirv/execution/uniform/initializer.shader_test
+++ b/tests/spec/arb_gl_spirv/execution/uniform/initializer.shader_test
@@ -62,5 +62,7 @@ void main()
 clear color 1.0 0.0 0.0 1.0
 clear
 
+verify program_query GL_ACTIVE_UNIFORMS 1
+
 draw rect -1 -1 2 2
 probe all rgba 0.0 1.0 0.0 1.0
diff --git a/tests/spec/arb_gl_spirv/execution/uniform/nonsequential-locations.shader_test b/tests/spec/arb_gl_spirv/execution/uniform/nonsequential-locations.shader_test
index a5be8e621..93cdc8d8e 100644
--- a/tests/spec/arb_gl_spirv/execution/uniform/nonsequential-locations.shader_test
+++ b/tests/spec/arb_gl_spirv/execution/uniform/nonsequential-locations.shader_test
@@ -65,5 +65,7 @@ clear
 uniform vec4 3 0.1 0.15 0.2 0.25
 uniform vec4 5 0.3 0.35 0.4 0.45
 
+verify program_query GL_ACTIVE_UNIFORMS 2
+
 draw rect -1 -1 2 2
 probe all rgba 0.4 0.5 0.6 0.7
diff --git a/tests/spec/arb_gl_spirv/execution/uniform/sampler2d-binding-array.shader_test b/tests/spec/arb_gl_spirv/execution/uniform/sampler2d-binding-array.shader_test
index 527f1624e..fe3ca7818 100644
--- a/tests/spec/arb_gl_spirv/execution/uniform/sampler2d-binding-array.shader_test
+++ b/tests/spec/arb_gl_spirv/execution/uniform/sampler2d-binding-array.shader_test
@@ -81,5 +81,7 @@ clear
 texture checkerboard 3 0 (32, 32) (0.02, 0.04, 0.06, 0.08) (0.8, 0.0, 0.0, 1.0)
 texture checkerboard 4 0 (32, 32) (0.10, 0.92, 0.14, 0.16) (0.2, 0.0, 0.0, 1.0)
 
+verify program_query GL_ACTIVE_UNIFORMS 1
+
 draw rect -1 -1 2 2
 probe all rgba 0.12 0.96 0.20 0.24
diff --git a/tests/spec/arb_gl_spirv/execution/uniform/sampler2d-binding.shader_test b/tests/spec/arb_gl_spirv/execution/uniform/sampler2d-binding.shader_test
index e99aaebbd..aaf036b60 100644
--- a/tests/spec/arb_gl_spirv/execution/uniform/sampler2d-binding.shader_test
+++ b/tests/spec/arb_gl_spirv/execution/uniform/sampler2d-binding.shader_test
@@ -66,5 +66,7 @@ clear
 
 texture checkerboard 3 0 (32, 32) (0.0, 1.0, 0.0, 1.0) (0.8, 0.0, 0.0, 1.0)
 
+verify program_query GL_ACTIVE_UNIFORMS 1
+
 draw rect -1 -1 2 2
 probe all rgba 0.0 1.0 0.0 1.0
diff --git a/tests/spec/arb_gl_spirv/execution/uniform/sampler2d-nonconst-nested-array.shader_test b/tests/spec/arb_gl_spirv/execution/uniform/sampler2d-nonconst-nested-array.shader_test
index cf1fed17e..3c23615d9 100644
--- a/tests/spec/arb_gl_spirv/execution/uniform/sampler2d-nonconst-nested-array.shader_test
+++ b/tests/spec/arb_gl_spirv/execution/uniform/sampler2d-nonconst-nested-array.shader_test
@@ -164,6 +164,8 @@ void main()
 clear color 0.2 0.2 0.2 0.2
 clear
 
+verify program_query GL_ACTIVE_UNIFORMS 13
+
 # s.final_member[0]
 uniform int 16 1
 # s.tex[1][1]
diff --git a/tests/spec/arb_gl_spirv/execution/uniform/sampler2d-struct.shader_test b/tests/spec/arb_gl_spirv/execution/uniform/sampler2d-struct.shader_test
index 8e440543e..c2964f545 100644
--- a/tests/spec/arb_gl_spirv/execution/uniform/sampler2d-struct.shader_test
+++ b/tests/spec/arb_gl_spirv/execution/uniform/sampler2d-struct.shader_test
@@ -92,6 +92,8 @@ clear
 uniform int 0 3
 uniform float 1 0.45
 
+verify program_query GL_ACTIVE_UNIFORMS 2
+
 texture checkerboard 3 0 (32, 32) (0.0, 0.5, 0.0, 0.0) (0.8, 0.0, 0.0, 1.0)
 
 draw rect -1 -1 2 2
diff --git a/tests/spec/arb_gl_spirv/execution/uniform/sampler2d.shader_test b/tests/spec/arb_gl_spirv/execution/uniform/sampler2d.shader_test
index cb0fa50cc..25bd10f6f 100644
--- a/tests/spec/arb_gl_spirv/execution/uniform/sampler2d.shader_test
+++ b/tests/spec/arb_gl_spirv/execution/uniform/sampler2d.shader_test
@@ -63,6 +63,8 @@ texture checkerboard 0 0 (32, 32) (0.0, 1.0, 0.0, 1.0) (1.0, 0.0, 0.0, 1.0)
 texparameter 2D min nearest
 texparameter 2D mag nearest
 
+verify program_query GL_ACTIVE_UNIFORMS 1
+
 clear
 clear color 0.0 0.0 1.0 0.0
 
diff --git a/tests/spec/arb_gl_spirv/execution/uniform/simple-without-names.shader_test b/tests/spec/arb_gl_spirv/execution/uniform/simple-without-names.shader_test
index b9ccd1a40..43980ff4a 100644
--- a/tests/spec/arb_gl_spirv/execution/uniform/simple-without-names.shader_test
+++ b/tests/spec/arb_gl_spirv/execution/uniform/simple-without-names.shader_test
@@ -107,5 +107,7 @@ clear
 
 uniform vec4 0 0.0 1.0 0.0 1.0
 
+verify program_query GL_ACTIVE_UNIFORMS 1
+
 draw rect -1 -1 2 2
 probe all rgba 0.0 1.0 0.0 1.0
diff --git a/tests/spec/arb_gl_spirv/execution/uniform/simple.shader_test b/tests/spec/arb_gl_spirv/execution/uniform/simple.shader_test
index 5f2fdf293..2b73cdfe5 100644
--- a/tests/spec/arb_gl_spirv/execution/uniform/simple.shader_test
+++ b/tests/spec/arb_gl_spirv/execution/uniform/simple.shader_test
@@ -120,5 +120,7 @@ clear
 
 uniform vec4 0 0.0 1.0 0.0 1.0
 
+verify program_query GL_ACTIVE_UNIFORMS 1
+
 draw rect -1 -1 2 2
 probe all rgba 0.0 1.0 0.0 1.0
diff --git a/tests/spec/arb_gl_spirv/execution/uniform/struct-array.shader_test b/tests/spec/arb_gl_spirv/execution/uniform/struct-array.shader_test
index b237c1c77..7f1ec8ab6 100644
--- a/tests/spec/arb_gl_spirv/execution/uniform/struct-array.shader_test
+++ b/tests/spec/arb_gl_spirv/execution/uniform/struct-array.shader_test
@@ -136,5 +136,7 @@ uniform float 3 0.4
 uniform float 4 0.5
 uniform float 5 0.6
 
+verify program_query GL_ACTIVE_UNIFORMS 6
+
 draw rect -1 -1 2 2
 probe all rgba 0.5 0.7 0.9 1.0
diff --git a/tests/spec/arb_gl_spirv/execution/uniform/struct.shader_test b/tests/spec/arb_gl_spirv/execution/uniform/struct.shader_test
index f68120512..2e5a82698 100644
--- a/tests/spec/arb_gl_spirv/execution/uniform/struct.shader_test
+++ b/tests/spec/arb_gl_spirv/execution/uniform/struct.shader_test
@@ -75,5 +75,7 @@ clear
 uniform vec4 4 0.1 0.15 0.2 0.25
 uniform vec4 5 0.3 0.35 0.4 0.45
 
+verify program_query GL_ACTIVE_UNIFORMS 2
+
 draw rect -1 -1 2 2
 probe all rgba 0.4 0.5 0.6 0.7
diff --git a/tests/spec/arb_gl_spirv/execution/uniform/two-uniforms.shader_test b/tests/spec/arb_gl_spirv/execution/uniform/two-uniforms.shader_test
index 5a6b6e7c4..d86f7ff57 100644
--- a/tests/spec/arb_gl_spirv/execution/uniform/two-uniforms.shader_test
+++ b/tests/spec/arb_gl_spirv/execution/uniform/two-uniforms.shader_test
@@ -128,5 +128,7 @@ clear
 uniform vec4 0 0.2 0.1 0.1 1.6
 uniform vec4 1 0.5 2.0 3.0 0.25
 
+verify program_query GL_ACTIVE_UNIFORMS 2
+
 draw rect -1 -1 2 2
 probe all rgba 0.1 0.2 0.3 0.4
-- 
2.14.1



More information about the Piglit mailing list