[Piglit] [PATCH] arb_gpu_shader5: Test corner cases of bitfieldInsert/bitfieldExtract.

Ilia Mirkin imirkin at alum.mit.edu
Thu Jan 7 19:30:10 PST 2016


I haven't double-checked that this is correct wrt the spec, but it
does pass on nouveau. So Acked-by: Ilia Mirkin <imirkin at alum.mit.edu>

On Thu, Jan 7, 2016 at 6:19 PM, Matt Turner <mattst88 at gmail.com> wrote:
> ---
> The previous submission had some things commented out by mistake, and
> incorrectly tested that for <bits> = 32, <offset> = 0 that bitfieldInsert()
> returned <base> instead of <insert>.
>
>  .../fs-bitfieldExtract.shader_test                 | 18 +++++++++++++++++-
>  .../fs-bitfieldInsert.shader_test                  | 22 ++++++++++++++++++++--
>  .../vs-bitfieldExtract.shader_test                 | 18 +++++++++++++++++-
>  .../vs-bitfieldInsert.shader_test                  | 20 +++++++++++++++++++-
>  4 files changed, 73 insertions(+), 5 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 2912a69..67d7a34 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
> @@ -46,7 +46,7 @@ vertex/float/2
>  [test]
>  # Corner case: bits == 0 -> result == 0
>  uniform int bits 0
> -uniform int offset 0
> +uniform int offset 32
>
>  uniform int test_signed 1
>  uniform ivec4 iextract 0 0 0 0
> @@ -107,3 +107,19 @@ uniform uvec4 uextract 0xF  0x0 0x1 0x3
>  uniform uvec4 uinput 0x000F0000 0x0000F000 0x0001C000 0x00038000
>  draw arrays GL_TRIANGLE_FAN 0 4
>  probe all rgba 0.0 1.0 0.0 1.0
> +
> +# Copy the whole integer
> +uniform int bits 32
> +uniform int offset 0
> +
> +uniform int test_signed 1
> +uniform ivec4 iextract 3203386110 3735928559 2343432205 3741239934
> +uniform ivec4 iinput   3203386110 3735928559 2343432205 3741239934
> +draw arrays GL_TRIANGLE_FAN 0 4
> +probe all rgba 0.0 1.0 0.0 1.0
> +
> +uniform int test_signed 0
> +uniform uvec4 uextract 0xBEEFCAFE 0xDEADBEEF 0x8BADF00D 0xDEFECA7E
> +uniform uvec4 uinput   0xBEEFCAFE 0xDEADBEEF 0x8BADF00D 0xDEFECA7E
> +draw arrays GL_TRIANGLE_FAN 0 4
> +probe all rgba 0.0 1.0 0.0 1.0
> 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 f0e7ab9..67add07 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
> @@ -48,7 +48,7 @@ vertex/float/2
>  [test]
>  # Corner case: bits == 0 -> result == base
>  uniform int bits 0
> -uniform int offset 0
> +uniform int offset 32
>
>  uniform int test_signed 1
>  uniform ivec4 iinsert 2147483647 15 7 3
> @@ -64,7 +64,7 @@ uniform uvec4 uresult 42 56 72 97
>  draw arrays GL_TRIANGLE_FAN 0 4
>  probe all rgba 0.0 1.0 0.0 1.0
>
> -# Test overwriting set bits in <base>.
> +## Test overwriting set bits in <base>.
>  uniform int bits 4
>  uniform int offset 16
>
> @@ -107,3 +107,21 @@ uniform uvec4 ubase 0xF 0xF 0xF 0xF
>  uniform uvec4 uresult 0x000E000F 0x0009000F 0x0004000F 0x0001000F
>  draw arrays GL_TRIANGLE_FAN 0 4
>  probe all rgba 0.0 1.0 0.0 1.0
> +
> +# Copy the whole integer
> +uniform int bits 32
> +uniform int offset 0
> +
> +uniform int test_signed 1
> +uniform ivec4 iinsert 3203386110 3735928559 2343432205 3741239934
> +uniform ivec4 ibase   0 0 0 0
> +uniform ivec4 iresult 3203386110 3735928559 2343432205 3741239934
> +draw arrays GL_TRIANGLE_FAN 0 4
> +probe all rgba 0.0 1.0 0.0 1.0
> +
> +uniform int test_signed 0
> +uniform uvec4 uinsert 0xBEEFCAFE 0xDEADBEEF 0x8BADF00D 0xDEFECA7E
> +uniform uvec4 ubase   0 0 0 0
> +uniform uvec4 uresult 0xBEEFCAFE 0xDEADBEEF 0x8BADF00D 0xDEFECA7E
> +draw arrays GL_TRIANGLE_FAN 0 4
> +probe all rgba 0.0 1.0 0.0 1.0
> 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 10ce5a0..35c7fc4 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
> @@ -50,7 +50,7 @@ vertex/float/2
>  [test]
>  # Corner case: bits == 0 -> result == 0
>  uniform int bits 0
> -uniform int offset 0
> +uniform int offset 32
>
>  uniform int test_signed 1
>  uniform ivec4 iextract 0 0 0 0
> @@ -111,3 +111,19 @@ uniform uvec4 uextract 0xF  0x0 0x1 0x3
>  uniform uvec4 uinput 0x000F0000 0x0000F000 0x0001C000 0x00038000
>  draw arrays GL_TRIANGLE_FAN 0 4
>  probe all rgba 0.0 1.0 0.0 1.0
> +
> +# Copy the whole integer
> +uniform int bits 32
> +uniform int offset 0
> +
> +uniform int test_signed 1
> +uniform ivec4 iextract 3203386110 3735928559 2343432205 3741239934
> +uniform ivec4 iinput   3203386110 3735928559 2343432205 3741239934
> +draw arrays GL_TRIANGLE_FAN 0 4
> +probe all rgba 0.0 1.0 0.0 1.0
> +
> +uniform int test_signed 0
> +uniform uvec4 uextract 0xBEEFCAFE 0xDEADBEEF 0x8BADF00D 0xDEFECA7E
> +uniform uvec4 uinput   0xBEEFCAFE 0xDEADBEEF 0x8BADF00D 0xDEFECA7E
> +draw arrays GL_TRIANGLE_FAN 0 4
> +probe all rgba 0.0 1.0 0.0 1.0
> 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 f4ccae6..09cf991 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
> @@ -52,7 +52,7 @@ vertex/float/2
>  [test]
>  # Corner case: bits == 0 -> result == base
>  uniform int bits 0
> -uniform int offset 0
> +uniform int offset 32
>
>  uniform int test_signed 1
>  uniform ivec4 iinsert 2147483647 15 7 3
> @@ -111,3 +111,21 @@ uniform uvec4 ubase 0xF 0xF 0xF 0xF
>  uniform uvec4 uresult 0x000E000F 0x0009000F 0x0004000F 0x0001000F
>  draw arrays GL_TRIANGLE_FAN 0 4
>  probe all rgba 0.0 1.0 0.0 1.0
> +
> +# Copy the whole integer
> +uniform int bits 32
> +uniform int offset 0
> +
> +uniform int test_signed 1
> +uniform ivec4 iinsert 3203386110 3735928559 2343432205 3741239934
> +uniform ivec4 ibase   0 0 0 0
> +uniform ivec4 iresult 3203386110 3735928559 2343432205 3741239934
> +draw arrays GL_TRIANGLE_FAN 0 4
> +probe all rgba 0.0 1.0 0.0 1.0
> +
> +uniform int test_signed 0
> +uniform uvec4 uinsert 0xBEEFCAFE 0xDEADBEEF 0x8BADF00D 0xDEFECA7E
> +uniform uvec4 ubase   0 0 0 0
> +uniform uvec4 uresult 0xBEEFCAFE 0xDEADBEEF 0x8BADF00D 0xDEFECA7E
> +draw arrays GL_TRIANGLE_FAN 0 4
> +probe all rgba 0.0 1.0 0.0 1.0
> --
> 2.4.9
>
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit


More information about the Piglit mailing list