[Piglit] [PATCH v2] arb_gpu_shader_fp64: add packDouble2x32 and unpackDouble2x32 tests for vertex shader

Juan A. Suarez Romero jasuarez at igalia.com
Wed Dec 21 11:43:07 UTC 2016


On Wed, 2016-12-21 at 12:36 +0100, Samuel Iglesias Gonsálvez wrote:

Reviewed-by: Juan A. Suarez Romero <jasuarez at igalia.com>

> Simple tests to make sure the packing is correct, along with constant
> tests.
> 
> They are based on 04d7b02a.
> 
> v2: Removed vs-const* patches.
> 
> Signed-off-by: Samuel Iglesias Gonsálvez <siglesias at igalia.com>
> ---
>  .../vs-packDouble2x32.shader_test                  | 59
> ++++++++++++++++++++++
>  .../vs-unpackDouble2x32-2.shader_test              | 57
> +++++++++++++++++++++
>  .../vs-unpackDouble2x32.shader_test                | 54
> ++++++++++++++++++++
>  3 files changed, 170 insertions(+)
>  create mode 100644 tests/spec/arb_gpu_shader_fp64/execution/built-
> in-functions/vs-packDouble2x32.shader_test
>  create mode 100644 tests/spec/arb_gpu_shader_fp64/execution/built-
> in-functions/vs-unpackDouble2x32-2.shader_test
>  create mode 100644 tests/spec/arb_gpu_shader_fp64/execution/built-
> in-functions/vs-unpackDouble2x32.shader_test
> 
> diff --git a/tests/spec/arb_gpu_shader_fp64/execution/built-in-
> functions/vs-packDouble2x32.shader_test
> b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/vs-
> packDouble2x32.shader_test
> new file mode 100644
> index 0000000..c888773
> --- /dev/null
> +++ b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/vs-
> packDouble2x32.shader_test
> @@ -0,0 +1,59 @@
> +[require]
> +GLSL >= 1.50
> +GL_ARB_gpu_shader_fp64
> +
> +[vertex shader]
> +#extension GL_ARB_gpu_shader_fp64 : enable
> +
> +in vec4 vertex;
> +out vec4 color;
> +
> +uniform double expected_doub;
> +uniform uvec2 given_uval;
> +
> +void main() {
> +	gl_Position = vertex;
> +	/* Green if both pass. */
> +	color = vec4(0.0, 1.0, 0.0, 1.0);
> +
> +	double packval;
> +
> +	packval = packDouble2x32(given_uval);
> +
> +	if (packval != expected_doub) {
> +		color.r = 1.0;
> +	}
> +}
> +
> +[fragment shader]
> +
> +in vec4 color;
> +out vec4 fs_color;
> +
> +void main()
> +{
> +	fs_color = color;
> +}
> +
> +[vertex data]
> +vertex/float/2
> +-1.0 -1.0
> + 1.0 -1.0
> + 1.0  1.0
> +-1.0  1.0
> +
> +[test]
> +uniform double expected_doub 0.0
> +uniform uvec2 given_uval 0 0
> +draw arrays GL_TRIANGLE_FAN 0 4
> +probe rgba 0 0 0.0 1.0 0.0 1.0
> +
> +uniform double expected_doub 1.5
> +uniform uvec2 given_uval 0 1073217536
> +draw arrays GL_TRIANGLE_FAN 0 4
> +probe rgba 1 0 0.0 1.0 0.0 1.0
> +
> +uniform double expected_doub 2.122e-311
> +uniform uvec2 given_uval 8519181 1000
> +draw arrays GL_TRIANGLE_FAN 0 4
> +probe rgba 2 0 0.0 1.0 0.0 1.0
> diff --git a/tests/spec/arb_gpu_shader_fp64/execution/built-in-
> functions/vs-unpackDouble2x32-2.shader_test
> b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/vs-
> unpackDouble2x32-2.shader_test
> new file mode 100644
> index 0000000..aa2a565
> --- /dev/null
> +++ b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/vs-
> unpackDouble2x32-2.shader_test
> @@ -0,0 +1,57 @@
> +# test unpack with a single channel specified
> +# to demonstrate a bug in glsl->tgsi dead-code elimination
> +[require]
> +GLSL >= 1.50
> +GL_ARB_gpu_shader_fp64
> +
> +[vertex shader]
> +#extension GL_ARB_gpu_shader_fp64 : enable
> +
> +in vec4 vertex;
> +out vec4 color;
> +
> +uniform double given_doub;
> +uniform uint expected_uval;
> +
> +void main()
> +{
> +	gl_Position = vertex;
> +	/* Green if both pass. */
> +	color = vec4(0.0, 1.0, 0.0, 1.0);
> +
> +	uint packval;
> +
> +	packval = unpackDouble2x32(abs(given_doub)).y;
> +
> +	if (packval != expected_uval) {
> +		color.r = 1.0;
> +	}
> +}
> +
> +[fragment shader]
> +
> +in vec4 color;
> +out vec4 fs_color;
> +
> +void main()
> +{
> +	fs_color = color;
> +}
> +
> +[vertex data]
> +vertex/float/2
> +-1.0 -1.0
> + 1.0 -1.0
> + 1.0  1.0
> +-1.0  1.0
> +
> +[test]
> +uniform double given_doub 0.0
> +uniform uint expected_uval 0
> +draw arrays GL_TRIANGLE_FAN 0 4
> +probe rgba 0 0 0.0 1.0 0.0 1.0
> +
> +uniform double given_doub 1.5
> +uniform uint expected_uval 1073217536
> +draw arrays GL_TRIANGLE_FAN 0 4
> +probe rgba 1 0 0.0 1.0 0.0 1.0
> diff --git a/tests/spec/arb_gpu_shader_fp64/execution/built-in-
> functions/vs-unpackDouble2x32.shader_test
> b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/vs-
> unpackDouble2x32.shader_test
> new file mode 100644
> index 0000000..f6156cf
> --- /dev/null
> +++ b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/vs-
> unpackDouble2x32.shader_test
> @@ -0,0 +1,54 @@
> +[require]
> +GLSL >= 1.50
> +GL_ARB_gpu_shader_fp64
> +
> +[vertex shader]
> +#extension GL_ARB_gpu_shader_fp64 : enable
> +in vec4 vertex;
> +
> +uniform double given_doub;
> +uniform uvec2 expected_uval;
> +
> +out vec4 color;
> +
> +void main() {
> +	gl_Position = vertex;
> +	/* Green if both pass. */
> +	color = vec4(0.0, 1.0, 0.0, 1.0);
> +
> +	uvec2 packval;
> +
> +	packval = unpackDouble2x32(given_doub);
> +
> +	if (packval != expected_uval) {
> +		color.r = 1.0;
> +	}
> +}
> +
> +[fragment shader]
> +
> +in vec4 color;
> +out vec4 fs_color;
> +
> +void main()
> +{
> +   fs_color = color;
> +}
> +
> +[vertex data]
> +vertex/float/2
> +-1.0 -1.0
> + 1.0 -1.0
> + 1.0  1.0
> +-1.0  1.0
> +
> +[test]
> +uniform double given_doub 0.0
> +uniform uvec2 expected_uval 0 0
> +draw arrays GL_TRIANGLE_FAN 0 4
> +probe rgba 0 0 0.0 1.0 0.0 1.0
> +
> +uniform double given_doub 1.5
> +uniform uvec2 expected_uval 0 1073217536
> +draw arrays GL_TRIANGLE_FAN 0 4
> +probe rgba 1 0 0.0 1.0 0.0 1.0


More information about the Piglit mailing list