[Mesa-dev] [PATCH] Add (un)packHalf tests which don't fail on GCN

Roland Scheidegger sroland at vmware.com
Thu Feb 4 21:49:13 UTC 2016


Would probably make more sense on the piglit ml...
That said, the existing unpack works on llvmpipe just fine even if you
enable that half cap bit (unpack is always exact). The only potential
gotcha I see is with denorms - the result of course is never a fp32
denorm but I suppose depending on your flags the fp16 input denorm might
get flushed to zero (this is what will happen with softpipe too).
And you probably really need to use a different generator, rather than
this one including a wall of random looking numbers.
(fwiw I was actually thinking if it would make sense to use a uniform
buffer containing all the values and indexing them based on position,
that way you could use a single draw and know which number failed based
on position, but looked like a lot of work...)

Roland


Am 04.02.2016 um 19:50 schrieb Marek Olšák:
> From: Marek Olšák <marek.olsak at amd.com>
> 
> This is a subset of the generated tests which are known to fail
> on everything except CPU emulation (AFAIK).
> ---
>  .../execution/fs-packHalf2x16.shader_test          | 6579 ++++++++++++++++++++
>  .../execution/fs-unpackHalf2x16.shader_test        |  915 +++
>  2 files changed, 7494 insertions(+)
>  create mode 100644 tests/spec/arb_shading_language_packing/execution/fs-packHalf2x16.shader_test
>  create mode 100644 tests/spec/arb_shading_language_packing/execution/fs-unpackHalf2x16.shader_test
> 
> diff --git a/tests/spec/arb_shading_language_packing/execution/fs-packHalf2x16.shader_test b/tests/spec/arb_shading_language_packing/execution/fs-packHalf2x16.shader_test
> new file mode 100644
> index 0000000..b36dd69
> --- /dev/null
> +++ b/tests/spec/arb_shading_language_packing/execution/fs-packHalf2x16.shader_test
> @@ -0,0 +1,6579 @@
> +[require]
> +GLSL >= 1.30
> +GL_ARB_shading_language_packing
> +
> +[vertex shader]
> +in vec4 vertex;
> +
> +void main()
> +{
> +    gl_Position = vertex;
> +}
> +
> +[fragment shader]
> +#ifndef GL_ES
> +#extension GL_ARB_shading_language_packing : require
> +#else
> +precision highp float;
> +#endif
> +
> +const vec4 red = vec4(1, 0, 0, 1);
> +const vec4 green = vec4(0, 1, 0, 1);
> +
> +uniform vec2 func_input;
> +
> +uniform highp uint expect0;
> +uniform highp uint expect1;
> +
> +out vec4 frag_color;
> +
> +void main()
> +{
> +    highp uint actual = packHalf2x16(func_input);
> +
> +    if (false
> +        || actual == expect0
> +        || actual == expect1
> +       ) {
> +        frag_color = green;
> +    } else {
> +        frag_color = red;
> +    }
> +}
> +
> +[vertex data]
> +vertex/float/2
> +-1.0 -1.0
> + 1.0 -1.0
> + 1.0  1.0
> +-1.0  1.0
> +
> +[test]
> +uniform vec2 func_input -1e+256 -1e+256
> +uniform uint expect0 4227922944u
> +uniform uint expect1 4227922944u
> +draw arrays GL_TRIANGLE_FAN 0 4
> +probe all rgba 0.0 1.0 0.0 1.0
> +

[snip]


More information about the mesa-dev mailing list