[Piglit] [PATCH] arb_gpu_shader5: Rename `signed` to `signed_`.

Chris Forbes chrisf at ijw.co.nz
Sun Mar 30 13:19:24 PDT 2014


nVIDIA's compiler considers `signed` to be a reserved word and so
refuses to compile these shaders. Whether that's sensible or not,
we'd like to see any real failures in these tests instead.

Signed-off-by: Chris Forbes <chrisf at ijw.co.nz>
---
 .../fs-bitfieldExtract.shader_test                   | 20 ++++++++++----------
 .../built-in-functions/fs-bitfieldInsert.shader_test | 18 +++++++++---------
 .../built-in-functions/fs-findMSB.shader_test        | 14 +++++++-------
 .../vs-bitfieldExtract.shader_test                   | 20 ++++++++++----------
 .../built-in-functions/vs-bitfieldInsert.shader_test | 18 +++++++++---------
 .../built-in-functions/vs-findMSB.shader_test        | 14 +++++++-------
 6 files changed, 52 insertions(+), 52 deletions(-)

diff --git a/tests/spec/arb_gpu_shader5/execution/built-in-functions/fs-bitfieldExtract.shader_test b/tests/spec/arb_gpu_shader5/execution/built-in-functions/fs-bitfieldExtract.shader_test
index 5b810ff..e3d4d24 100644
--- a/tests/spec/arb_gpu_shader5/execution/built-in-functions/fs-bitfieldExtract.shader_test
+++ b/tests/spec/arb_gpu_shader5/execution/built-in-functions/fs-bitfieldExtract.shader_test
@@ -14,7 +14,7 @@ void main() {
 
 out vec4 color;
 
-uniform bool signed;
+uniform bool signed_;
 
 uniform ivec4 iextract;
 uniform ivec4 iinput;
@@ -28,10 +28,10 @@ void main()
 	/* Green if both pass. */
 	color = vec4(0.0, 1.0, 0.0, 1.0);
 
-	if (signed && iextract != bitfieldExtract(iinput, offset, bits))
+	if (signed_ && iextract != bitfieldExtract(iinput, offset, bits))
 		/* Red if bitfieldExtract(ivec4, ...) fails. */
 		color = vec4(1.0, 0.0, 0.0, 1.0);
-	else if (!signed && uextract != bitfieldExtract(uinput, offset, bits))
+	else if (!signed_ && uextract != bitfieldExtract(uinput, offset, bits))
 		/* Blue if bitfieldExtract(uvec4, ...) fails. */
 		color = vec4(0.0, 0.0, 1.0, 1.0);
 }
@@ -48,13 +48,13 @@ vertex/float/2
 uniform int bits 0
 uniform int offset 0
 
-uniform int signed 1
+uniform int signed_ 1
 uniform ivec4 iextract 0 0 0 0
 uniform ivec4 iinput 2147483647 15 7 3
 draw arrays GL_TRIANGLE_FAN 0 4
 probe all rgba 0.0 1.0 0.0 1.0
 
-uniform int signed 0
+uniform int signed_ 0
 uniform uvec4 uextract 0 0 0 0
 uniform uvec4 uinput 0xFFFFFFFF 15 7 3
 draw arrays GL_TRIANGLE_FAN 0 4
@@ -66,14 +66,14 @@ uniform int bits 1
 uniform int offset 0
 
 # Extract a single signed "1"-bit and sign-extend it, yielding 0xFFFFFFFF (-1).
-uniform int signed 1
+uniform int signed_ 1
 uniform ivec4 iextract -1 -1 -1 -1
 uniform ivec4 iinput 1 1 1 1
 draw arrays GL_TRIANGLE_FAN 0 4
 probe all rgba 0.0 1.0 0.0 1.0
 
 # Extract a single unsigned "1"-bit and sign-extend it, yielding 0x00000001 (1).
-uniform int signed 0
+uniform int signed_ 0
 uniform uvec4 uextract 1 1 1 1
 uniform uvec4 uinput 1 1 1 1
 draw arrays GL_TRIANGLE_FAN 0 4
@@ -82,7 +82,7 @@ probe all rgba 0.0 1.0 0.0 1.0
 # Extract two signed bits (01) and sign-extend it, yielding 0x00000001 (1).
 # Extract two signed bits (11) and sign-extend it, yielding 0xFFFFFFFF (1).
 uniform int bits 2
-uniform int signed 1
+uniform int signed_ 1
 uniform ivec4 iextract 1 -1 -1 1
 uniform ivec4 iinput 1 3 3 1
 draw arrays GL_TRIANGLE_FAN 0 4
@@ -92,7 +92,7 @@ probe all rgba 0.0 1.0 0.0 1.0
 uniform int bits 4
 uniform int offset 16
 
-uniform int signed 1
+uniform int signed_ 1
 uniform ivec4 iextract -1 0 1 3
 # 983040 is 0x000F0000.
 #  61440 is 0x0000F000.
@@ -102,7 +102,7 @@ uniform ivec4 iinput 983040 61440 114688 229376
 draw arrays GL_TRIANGLE_FAN 0 4
 probe all rgba 0.0 1.0 0.0 1.0
 
-uniform int signed 0
+uniform int signed_ 0
 uniform uvec4 uextract 0xF  0x0 0x1 0x3
 uniform uvec4 uinput 0x000F0000 0x0000F000 0x0001C000 0x00038000
 draw arrays GL_TRIANGLE_FAN 0 4
diff --git a/tests/spec/arb_gpu_shader5/execution/built-in-functions/fs-bitfieldInsert.shader_test b/tests/spec/arb_gpu_shader5/execution/built-in-functions/fs-bitfieldInsert.shader_test
index 3e2150a..34fdb08 100644
--- a/tests/spec/arb_gpu_shader5/execution/built-in-functions/fs-bitfieldInsert.shader_test
+++ b/tests/spec/arb_gpu_shader5/execution/built-in-functions/fs-bitfieldInsert.shader_test
@@ -14,7 +14,7 @@ void main() {
 
 out vec4 color;
 
-uniform bool signed;
+uniform bool signed_;
 
 uniform ivec4 iinsert;
 uniform ivec4 ibase;
@@ -30,10 +30,10 @@ void main()
 	/* Green if both pass. */
 	color = vec4(0.0, 1.0, 0.0, 1.0);
 
-	if (signed && iresult != bitfieldInsert(ibase, iinsert, offset, bits))
+	if (signed_ && iresult != bitfieldInsert(ibase, iinsert, offset, bits))
 		/* Red if bitfieldInsert(ivec4, ...) fails. */
 		color = vec4(1.0, 0.0, 0.0, 1.0);
-	else if (!signed && uresult != bitfieldInsert(ubase, uinsert, offset, bits))
+	else if (!signed_ && uresult != bitfieldInsert(ubase, uinsert, offset, bits))
 		/* Blue if bitfieldInsert(uvec4, ...) fails. */
 		color = vec4(0.0, 0.0, 1.0, 1.0);
 }
@@ -50,14 +50,14 @@ vertex/float/2
 uniform int bits 0
 uniform int offset 0
 
-uniform int signed 1
+uniform int signed_ 1
 uniform ivec4 iinsert 2147483647 15 7 3
 uniform ivec4 ibase 42 56 72 97
 uniform ivec4 iresult 42 56 72 97
 draw arrays GL_TRIANGLE_FAN 0 4
 probe all rgba 0.0 1.0 0.0 1.0
 
-uniform int signed 0
+uniform int signed_ 0
 uniform uvec4 uinsert 0xFFFFFFFF 15 7 3
 uniform uvec4 ubase 42 56 72 97
 uniform uvec4 uresult 42 56 72 97
@@ -68,7 +68,7 @@ probe all rgba 0.0 1.0 0.0 1.0
 uniform int bits 4
 uniform int offset 16
 
-uniform int signed 1
+uniform int signed_ 1
 uniform ivec4 iinsert 9 4 1 0
 # 983055 is 0x000F000F
 uniform ivec4 ibase 983055 983055 983055 983055
@@ -79,7 +79,7 @@ uniform ivec4 iresult 589839 262159 65551 15
 draw arrays GL_TRIANGLE_FAN 0 4
 probe all rgba 0.0 1.0 0.0 1.0
 
-uniform int signed 0
+uniform int signed_ 0
 uniform uvec4 uinsert 0x9 0x4 0x1 0x0
 uniform uvec4 ubase 0x000F000F 0x000F000F 0x000F000F 0x000F000F
 uniform uvec4 uresult 0x0009000F 0x0004000F 0x0001000F 0x0000000F
@@ -90,7 +90,7 @@ probe all rgba 0.0 1.0 0.0 1.0
 uniform int bits 4
 uniform int offset 16
 
-uniform int signed 1
+uniform int signed_ 1
 uniform ivec4 iinsert 14 9 4 1
 uniform ivec4 ibase 15 15 15 15
 # 917519 is 0x000E000F.
@@ -101,7 +101,7 @@ uniform ivec4 iresult 917519 589839 262159 65551
 draw arrays GL_TRIANGLE_FAN 0 4
 probe all rgba 0.0 1.0 0.0 1.0
 
-uniform int signed 0
+uniform int signed_ 0
 uniform uvec4 uinsert 0xE 0x9 0x4 0x1
 uniform uvec4 ubase 0xF 0xF 0xF 0xF
 uniform uvec4 uresult 0x000E000F 0x0009000F 0x0004000F 0x0001000F
diff --git a/tests/spec/arb_gpu_shader5/execution/built-in-functions/fs-findMSB.shader_test b/tests/spec/arb_gpu_shader5/execution/built-in-functions/fs-findMSB.shader_test
index fdac2a9..39ce67f 100644
--- a/tests/spec/arb_gpu_shader5/execution/built-in-functions/fs-findMSB.shader_test
+++ b/tests/spec/arb_gpu_shader5/execution/built-in-functions/fs-findMSB.shader_test
@@ -14,7 +14,7 @@ void main() {
 
 out vec4 color;
 
-uniform bool signed;
+uniform bool signed_;
 uniform ivec4 msb;
 uniform ivec4 iinput;
 uniform uvec4 uinput;
@@ -24,10 +24,10 @@ void main()
 	/* Green if both pass. */
 	color = vec4(0.0, 1.0, 0.0, 1.0);
 
-	if (signed && msb != findMSB(iinput))
+	if (signed_ && msb != findMSB(iinput))
 		/* Red if findMSB(ivec4) fails. */
 		color = vec4(1.0, 0.0, 0.0, 1.0);
-	else if (!signed && msb != findMSB(uinput))
+	else if (!signed_ && msb != findMSB(uinput))
 		/* Blue if findMSB(uvec4) fails. */
 		color = vec4(0.0, 0.0, 1.0, 1.0);
 }
@@ -41,20 +41,20 @@ vertex/float/2
 
 [test]
 # For a value of zero or negative one, -1 will be returned.
-uniform int signed 1
+uniform int signed_ 1
 uniform ivec4 msb -1 -1 -1 -1
 uniform ivec4 iinput 0 -1 -1 0
 draw arrays GL_TRIANGLE_FAN 0 4
 probe all rgba 0.0 1.0 0.0 1.0
 
-uniform int signed 0
+uniform int signed_ 0
 uniform ivec4 msb -1 -1 -1 -1
 uniform uvec4 uinput 0 0 0 0
 draw arrays GL_TRIANGLE_FAN 0 4
 probe all rgba 0.0 1.0 0.0 1.0
 
 # Signed inputs
-uniform int signed 1
+uniform int signed_ 1
 
 uniform ivec4 msb 0 1 1 2
 uniform ivec4 iinput 1 2 3 4
@@ -78,7 +78,7 @@ draw arrays GL_TRIANGLE_FAN 0 4
 probe all rgba 0.0 1.0 0.0 1.0
 
 # Unsigned inputs
-uniform int signed 0
+uniform int signed_ 0
 
 uniform ivec4 msb 0 1 1 2
 uniform uvec4 uinput 1 2 3 4
diff --git a/tests/spec/arb_gpu_shader5/execution/built-in-functions/vs-bitfieldExtract.shader_test b/tests/spec/arb_gpu_shader5/execution/built-in-functions/vs-bitfieldExtract.shader_test
index d88882b..64f783d 100644
--- a/tests/spec/arb_gpu_shader5/execution/built-in-functions/vs-bitfieldExtract.shader_test
+++ b/tests/spec/arb_gpu_shader5/execution/built-in-functions/vs-bitfieldExtract.shader_test
@@ -8,7 +8,7 @@ GL_ARB_gpu_shader5
 in vec4 vertex;
 out vec4 color;
 
-uniform bool signed;
+uniform bool signed_;
 
 uniform ivec4 iextract;
 uniform ivec4 iinput;
@@ -23,10 +23,10 @@ void main() {
 	/* Green if both pass. */
 	color = vec4(0.0, 1.0, 0.0, 1.0);
 
-	if (signed && iextract != bitfieldExtract(iinput, offset, bits))
+	if (signed_ && iextract != bitfieldExtract(iinput, offset, bits))
 		/* Red if bitfieldExtract(ivec4, ...) fails. */
 		color = vec4(1.0, 0.0, 0.0, 1.0);
-	else if (!signed && uextract != bitfieldExtract(uinput, offset, bits))
+	else if (!signed_ && uextract != bitfieldExtract(uinput, offset, bits))
 		/* Blue if bitfieldExtract(uvec4, ...) fails. */
 		color = vec4(0.0, 0.0, 1.0, 1.0);
 }
@@ -52,13 +52,13 @@ vertex/float/2
 uniform int bits 0
 uniform int offset 0
 
-uniform int signed 1
+uniform int signed_ 1
 uniform ivec4 iextract 0 0 0 0
 uniform ivec4 iinput 2147483647 15 7 3
 draw arrays GL_TRIANGLE_FAN 0 4
 probe all rgba 0.0 1.0 0.0 1.0
 
-uniform int signed 0
+uniform int signed_ 0
 uniform uvec4 uextract 0 0 0 0
 uniform uvec4 uinput 0xFFFFFFFF 15 7 3
 draw arrays GL_TRIANGLE_FAN 0 4
@@ -70,14 +70,14 @@ uniform int bits 1
 uniform int offset 0
 
 # Extract a single signed "1"-bit and sign-extend it, yielding 0xFFFFFFFF (-1).
-uniform int signed 1
+uniform int signed_ 1
 uniform ivec4 iextract -1 -1 -1 -1
 uniform ivec4 iinput 1 1 1 1
 draw arrays GL_TRIANGLE_FAN 0 4
 probe all rgba 0.0 1.0 0.0 1.0
 
 # Extract a single unsigned "1"-bit and sign-extend it, yielding 0x00000001 (1).
-uniform int signed 0
+uniform int signed_ 0
 uniform uvec4 uextract 1 1 1 1
 uniform uvec4 uinput 1 1 1 1
 draw arrays GL_TRIANGLE_FAN 0 4
@@ -86,7 +86,7 @@ probe all rgba 0.0 1.0 0.0 1.0
 # Extract two signed bits (01) and sign-extend it, yielding 0x00000001 (1).
 # Extract two signed bits (11) and sign-extend it, yielding 0xFFFFFFFF (1).
 uniform int bits 2
-uniform int signed 1
+uniform int signed_ 1
 uniform ivec4 iextract 1 -1 -1 1
 uniform ivec4 iinput 1 3 3 1
 draw arrays GL_TRIANGLE_FAN 0 4
@@ -96,7 +96,7 @@ probe all rgba 0.0 1.0 0.0 1.0
 uniform int bits 4
 uniform int offset 16
 
-uniform int signed 1
+uniform int signed_ 1
 uniform ivec4 iextract -1 0 1 3
 # 983040 is 0x000F0000.
 #  61440 is 0x0000F000.
@@ -106,7 +106,7 @@ uniform ivec4 iinput 983040 61440 114688 229376
 draw arrays GL_TRIANGLE_FAN 0 4
 probe all rgba 0.0 1.0 0.0 1.0
 
-uniform int signed 0
+uniform int signed_ 0
 uniform uvec4 uextract 0xF  0x0 0x1 0x3
 uniform uvec4 uinput 0x000F0000 0x0000F000 0x0001C000 0x00038000
 draw arrays GL_TRIANGLE_FAN 0 4
diff --git a/tests/spec/arb_gpu_shader5/execution/built-in-functions/vs-bitfieldInsert.shader_test b/tests/spec/arb_gpu_shader5/execution/built-in-functions/vs-bitfieldInsert.shader_test
index 2119291..cd1c7f6 100644
--- a/tests/spec/arb_gpu_shader5/execution/built-in-functions/vs-bitfieldInsert.shader_test
+++ b/tests/spec/arb_gpu_shader5/execution/built-in-functions/vs-bitfieldInsert.shader_test
@@ -8,7 +8,7 @@ GL_ARB_gpu_shader5
 in vec4 vertex;
 out vec4 color;
 
-uniform bool signed;
+uniform bool signed_;
 
 uniform ivec4 iinsert;
 uniform ivec4 ibase;
@@ -25,10 +25,10 @@ void main() {
 	/* Green if both pass. */
 	color = vec4(0.0, 1.0, 0.0, 1.0);
 
-	if (signed && iresult != bitfieldInsert(ibase, iinsert, offset, bits))
+	if (signed_ && iresult != bitfieldInsert(ibase, iinsert, offset, bits))
 		/* Red if bitfieldInsert(ivec4, ...) fails. */
 		color = vec4(1.0, 0.0, 0.0, 1.0);
-	else if (!signed && uresult != bitfieldInsert(ubase, uinsert, offset, bits))
+	else if (!signed_ && uresult != bitfieldInsert(ubase, uinsert, offset, bits))
 		/* Blue if bitfieldInsert(uvec4, ...) fails. */
 		color = vec4(0.0, 0.0, 1.0, 1.0);
 }
@@ -54,14 +54,14 @@ vertex/float/2
 uniform int bits 0
 uniform int offset 0
 
-uniform int signed 1
+uniform int signed_ 1
 uniform ivec4 iinsert 2147483647 15 7 3
 uniform ivec4 ibase 42 56 72 97
 uniform ivec4 iresult 42 56 72 97
 draw arrays GL_TRIANGLE_FAN 0 4
 probe all rgba 0.0 1.0 0.0 1.0
 
-uniform int signed 0
+uniform int signed_ 0
 uniform uvec4 uinsert 0xFFFFFFFF 15 7 3
 uniform uvec4 ubase 42 56 72 97
 uniform uvec4 uresult 42 56 72 97
@@ -72,7 +72,7 @@ probe all rgba 0.0 1.0 0.0 1.0
 uniform int bits 4
 uniform int offset 16
 
-uniform int signed 1
+uniform int signed_ 1
 uniform ivec4 iinsert 9 4 1 0
 # 983055 is 0x000F000F
 uniform ivec4 ibase 983055 983055 983055 983055
@@ -83,7 +83,7 @@ uniform ivec4 iresult 589839 262159 65551 15
 draw arrays GL_TRIANGLE_FAN 0 4
 probe all rgba 0.0 1.0 0.0 1.0
 
-uniform int signed 0
+uniform int signed_ 0
 uniform uvec4 uinsert 0x9 0x4 0x1 0x0
 uniform uvec4 ubase 0x000F000F 0x000F000F 0x000F000F 0x000F000F
 uniform uvec4 uresult 0x0009000F 0x0004000F 0x0001000F 0x0000000F
@@ -94,7 +94,7 @@ probe all rgba 0.0 1.0 0.0 1.0
 uniform int bits 4
 uniform int offset 16
 
-uniform int signed 1
+uniform int signed_ 1
 uniform ivec4 iinsert 14 9 4 1
 uniform ivec4 ibase 15 15 15 15
 # 917519 is 0x000E000F.
@@ -105,7 +105,7 @@ uniform ivec4 iresult 917519 589839 262159 65551
 draw arrays GL_TRIANGLE_FAN 0 4
 probe all rgba 0.0 1.0 0.0 1.0
 
-uniform int signed 0
+uniform int signed_ 0
 uniform uvec4 uinsert 0xE 0x9 0x4 0x1
 uniform uvec4 ubase 0xF 0xF 0xF 0xF
 uniform uvec4 uresult 0x000E000F 0x0009000F 0x0004000F 0x0001000F
diff --git a/tests/spec/arb_gpu_shader5/execution/built-in-functions/vs-findMSB.shader_test b/tests/spec/arb_gpu_shader5/execution/built-in-functions/vs-findMSB.shader_test
index 67ec3c9..3485056 100644
--- a/tests/spec/arb_gpu_shader5/execution/built-in-functions/vs-findMSB.shader_test
+++ b/tests/spec/arb_gpu_shader5/execution/built-in-functions/vs-findMSB.shader_test
@@ -8,7 +8,7 @@ GL_ARB_gpu_shader5
 in vec4 vertex;
 out vec4 color;
 
-uniform bool signed;
+uniform bool signed_;
 uniform ivec4 msb;
 uniform ivec4 iinput;
 uniform uvec4 uinput;
@@ -19,10 +19,10 @@ void main() {
 	/* Green if both pass. */
 	color = vec4(0.0, 1.0, 0.0, 1.0);
 
-	if (signed && msb != findMSB(iinput))
+	if (signed_ && msb != findMSB(iinput))
 		/* Red if findMSB(ivec4) fails. */
 		color = vec4(1.0, 0.0, 0.0, 1.0);
-	else if (!signed && msb != findMSB(uinput))
+	else if (!signed_ && msb != findMSB(uinput))
 		/* Blue if findMSB(uvec4) fails. */
 		color = vec4(0.0, 0.0, 1.0, 1.0);
 }
@@ -45,20 +45,20 @@ vertex/float/2
 
 [test]
 # For a value of zero or negative one, -1 will be returned.
-uniform int signed 1
+uniform int signed_ 1
 uniform ivec4 msb -1 -1 -1 -1
 uniform ivec4 iinput 0 -1 -1 0
 draw arrays GL_TRIANGLE_FAN 0 4
 probe all rgba 0.0 1.0 0.0 1.0
 
-uniform int signed 0
+uniform int signed_ 0
 uniform ivec4 msb -1 -1 -1 -1
 uniform uvec4 uinput 0 0 0 0
 draw arrays GL_TRIANGLE_FAN 0 4
 probe all rgba 0.0 1.0 0.0 1.0
 
 # Signed inputs
-uniform int signed 1
+uniform int signed_ 1
 
 uniform ivec4 msb 0 1 1 2
 uniform ivec4 iinput 1 2 3 4
@@ -82,7 +82,7 @@ draw arrays GL_TRIANGLE_FAN 0 4
 probe all rgba 0.0 1.0 0.0 1.0
 
 # Unsigned inputs
-uniform int signed 0
+uniform int signed_ 0
 
 uniform ivec4 msb 0 1 1 2
 uniform uvec4 uinput 1 2 3 4
-- 
1.9.1



More information about the Piglit mailing list