[Piglit] [PATCH 4/5] variable-index-read/write.sh: Emit requirements for varying floats.

Eric Anholt eric at anholt.net
Mon Jan 5 12:22:45 PST 2015


48 of the generated tests were linker-error failing on vc4 due to
trying to use too many varying components.
---
 tests/spec/glsl-1.10/variable-index-read.sh  | 8 ++++++++
 tests/spec/glsl-1.10/variable-index-write.sh | 9 +++++++++
 2 files changed, 17 insertions(+)

diff --git a/tests/spec/glsl-1.10/variable-index-read.sh b/tests/spec/glsl-1.10/variable-index-read.sh
index a64c2e9..2fdf980 100755
--- a/tests/spec/glsl-1.10/variable-index-read.sh
+++ b/tests/spec/glsl-1.10/variable-index-read.sh
@@ -376,6 +376,9 @@ function emit_fs_rd_test
     echo
     echo "[require]"
     echo "GLSL >= $version"
+    if [ "x$mode" = "xvarying" ]; then
+       echo "GL_MAX_VARYING_COMPONENTS >= $varying_comps"
+    fi
     echo
 
     emit_vs $* 0
@@ -394,6 +397,9 @@ function emit_vs_rd_test
     echo
     echo "[require]"
     echo "GLSL >= $version"
+    if [ "x$mode" = "xvarying" ]; then
+       echo "GL_MAX_VARYING_COMPONENTS >= $varying_comps"
+    fi
     echo
 
     emit_vs $* 1
@@ -422,6 +428,7 @@ for mode in temp uniform varying; do
     for array_dim in 0 3; do
 	for matrix_dim in 2 3 4; do
 	    if [ $array_dim -ne 0 ]; then
+		varying_comps=$((4 + matrix_dim * matrix_dim * array_dim))
 		arr="array-"
 		idx_txt="index-"
 
@@ -465,6 +472,7 @@ for mode in temp uniform varying; do
 		    > $name
 		echo $name
 	    else
+		varying_comps=$((4 + matrix_dim * matrix_dim))
 		arr=""
 		idx_txt=""
 	    fi
diff --git a/tests/spec/glsl-1.10/variable-index-write.sh b/tests/spec/glsl-1.10/variable-index-write.sh
index 6781239..8720374 100755
--- a/tests/spec/glsl-1.10/variable-index-write.sh
+++ b/tests/spec/glsl-1.10/variable-index-write.sh
@@ -356,6 +356,9 @@ function emit_vs_wr_test
     echo
     echo "[require]"
     echo "GLSL >= ${version}"
+    if [ "x$mode" = "xvarying" ]; then
+       echo "GL_MAX_VARYING_COMPONENTS >= $varying_comps"
+    fi
     echo
 
     echo "[vertex shader]"
@@ -419,6 +422,12 @@ for mode in temp varying; do
 	fi
 
 	for matrix_dim in 2 3 4; do
+	    if [ $array_dim -ne 0 ]; then
+		varying_comps=$((matrix_dim * matrix_dim * array_dim))
+	    else
+		varying_comps=$((matrix_dim * matrix_dim))
+	    fi
+
 	    # Fragment shaders cannot write varyings
 	    if [ "x$mode" != "xvarying" ]; then
 		name="fs-${mode}-${arr}mat${matrix_dim}-${idx_txt}col-row-wr.shader_test"
-- 
2.1.3



More information about the Piglit mailing list