[Piglit] [PATCH] arb_gpu_shader5: add textureSize sampler indexing tests

Ilia Mirkin imirkin at alum.mit.edu
Sun Jun 21 22:15:35 PDT 2015


Don't really have to do the checkerboard thing, but... meh. Also I
would have picked /128.0 instead of /100 so that you get nicer-looking
fractions, but again... meh. With those things either changed or not,

Reviewed-by: Ilia Mirkin <imirkin at alum.mit.edu>

On Sun, Jun 21, 2015 at 11:16 PM, Dave Airlie <airlied at gmail.com> wrote:
> From: Dave Airlie <airlied at redhat.com>
>
> softpipe takes a different path for textureSize, so test it as well
> just in case other drivers do similiar.
>
> Signed-off-by: Dave Airlie <airlied at redhat.com>
> ---
>  .../fs-simple-texture-size.shader_test             | 68 ++++++++++++++++++++++
>  1 file changed, 68 insertions(+)
>  create mode 100644 tests/spec/arb_gpu_shader5/execution/sampler_array_indexing/fs-simple-texture-size.shader_test
>
> diff --git a/tests/spec/arb_gpu_shader5/execution/sampler_array_indexing/fs-simple-texture-size.shader_test b/tests/spec/arb_gpu_shader5/execution/sampler_array_indexing/fs-simple-texture-size.shader_test
> new file mode 100644
> index 0000000..dca749f
> --- /dev/null
> +++ b/tests/spec/arb_gpu_shader5/execution/sampler_array_indexing/fs-simple-texture-size.shader_test
> @@ -0,0 +1,68 @@
> +# This test verifies that dynamically uniform indexing of sampler arrays
> +# in the fragment shader behaves correctly using textureSize
> +
> +[require]
> +GLSL >= 1.50
> +GL_ARB_gpu_shader5
> +
> +[vertex shader passthrough]
> +
> +[fragment shader]
> +#version 150
> +#extension GL_ARB_gpu_shader5: require
> +
> +uniform sampler2D s[4];
> +
> +uniform int n;
> +
> +out vec4 color;
> +
> +void main()
> +{
> +       color = vec4(textureSize(s[n], 0)/100.0, 0.0, 1.0);
> +}
> +
> +[test]
> +clear color 0.2 0.2 0.2 0.2
> +clear
> +
> +uniform int s[0] 0
> +uniform int s[1] 1
> +uniform int s[2] 2
> +uniform int s[3] 3
> +
> +texture checkerboard 0 0 (128, 128) (1.0, 0.0, 0.0, 0.0) (1.0, 0.0, 0.0, 0.0)
> +texparameter 2D min nearest
> +texparameter 2D mag nearest
> +
> +texture checkerboard 1 0 (64, 64) (0.0, 1.0, 0.0, 0.0) (0.0, 1.0, 0.0, 0.0)
> +texparameter 2D min nearest
> +texparameter 2D mag nearest
> +
> +texture checkerboard 2 0 (32, 32) (0.0, 0.0, 1.0, 0.0) (0.0, 0.0, 1.0, 0.0)
> +texparameter 2D min nearest
> +texparameter 2D mag nearest
> +
> +texture checkerboard 3 0 (16, 16) (1.0, 1.0, 1.0, 1.0) (1.0, 1.0, 1.0, 1.0)
> +texparameter 2D min nearest
> +texparameter 2D mag nearest
> +
> +uniform int n 0
> +draw rect -1 -1 1 1
> +
> +relative probe rect rgb (0.0, 0.0, 0.5, 0.5) (1.0, 1.0, 0.0)
> +
> +uniform int n 1
> +draw rect 0 -1 1 1
> +
> +relative probe rect rgb (0.5, 0.0, 0.5, 0.5) (0.64, 0.64, 0.0)
> +
> +uniform int n 2
> +draw rect -1 0 1 1
> +
> +relative probe rect rgb (0.0, 0.5, 0.5, 0.5) (0.32, 0.32, 0.0)
> +
> +uniform int n 3
> +draw rect 0 0 1 1
> +
> +relative probe rect rgb (0.5, 0.5, 0.5, 0.5) (0.16, 0.16, 0.0)
> --
> 2.4.3
>
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit


More information about the Piglit mailing list