[Piglit] [PATCH] arb_gpu_shader_fp64: add simple explicit location execution test

Timothy Arceri timothy.arceri at collabora.com
Tue May 31 06:47:58 UTC 2016


On Tue, 2016-05-31 at 08:22 +0200, Samuel Iglesias Gonsálvez wrote:
> It is failing in current i965 Mesa driver. This tests checks
> VS, GS and FS stages.
> 
> Signed-off-by: Samuel Iglesias Gonsálvez <siglesias at igalia.com>
> ---
>  .../explicit-location-gs-fs-vs-double.shader_test  | 74 

Nit pick but you don't really need to add double to the filename since
this in in the arb_gpu_shader_fp64 directory.


> ++++++++++++++++++++++
>  1 file changed, 74 insertions(+)
>  create mode 100644
> tests/spec/arb_gpu_shader_fp64/execution/explicit-location-gs-fs-vs-
> double.shader_test
> 
> diff --git a/tests/spec/arb_gpu_shader_fp64/execution/explicit-
> location-gs-fs-vs-double.shader_test
> b/tests/spec/arb_gpu_shader_fp64/execution/explicit-location-gs-fs-
> vs-double.shader_test
> new file mode 100644
> index 0000000..42a6994
> --- /dev/null
> +++ b/tests/spec/arb_gpu_shader_fp64/execution/explicit-location-gs-
> fs-vs-double.shader_test
> @@ -0,0 +1,74 @@
> +# test truncating a double holds precision using explicit locations.
> +[require]
> +GLSL >= 4.20
> +GL_ARB_gpu_shader_fp64

Any reason for using 4.2? You should be able to just do

#version 150
#extension GL_ARB_gpu_shader_fp64 : require
#extension GL_ARB_separate_shader_objects : require

Otherwise Reviewed-by: Timothy Arceri <timothy.arceri at collabora.com>

Thanks for the test :)

> +
> +[vertex shader]
> +#version 420
> +#extension GL_ARB_gpu_shader_fp64 : require
> +
> +uniform dvec4 arg0;
> +
> +in vec4 vertex;
> +layout(location = 0) out vec4 vertex_to_gs;
> +layout(location = 1) out dvec4 dout1_to_gs;
> +
> +void main()
> +{
> +	vertex_to_gs = vertex;
> +	dout1_to_gs = arg0;
> +}
> +
> +[geometry shader]
> +#version 420
> +#extension GL_ARB_gpu_shader_fp64 : require
> +
> +layout(triangles) in;
> +layout(triangle_strip, max_vertices = 3) out;
> +
> +layout(location = 0) in vec4 vertex_to_gs[3];
> +layout(location = 1) in dvec4 dout1_to_gs[3];
> +layout(location = 3) flat out dvec4 out_to_fs;
> +
> +void main()
> +{
> +	for (int i = 0; i < 3; i++) {
> +		gl_Position = vertex_to_gs[i];
> +		out_to_fs = dout1_to_gs[i];
> +		EmitVertex();
> +	}
> +}
> +
> +[fragment shader]
> +#version 420
> +#extension GL_ARB_gpu_shader_fp64 : require
> +
> +uniform double tolerance;
> +uniform dvec4 expected;
> +
> +layout(location = 3) flat in dvec4 out_to_fs;
> +out vec4 color;
> +
> +void main()
> +{
> +	dvec4 result = trunc(out_to_fs);
> +	color = distance(result, dvec4(expected)) <= tolerance
> +		? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0,
> 1.0);
> +}
> +
> +[vertex data]
> +vertex/float/2
> +-1.0 -1.0
> + 1.0 -1.0
> + 1.0  1.0
> +-1.0  1.0
> +
> +[test]
> +clear color 0.0 0.0 0.0 0.0
> +
> +clear
> +uniform dvec4 arg0 1.7976931348623157E+308 1.5 -1.5 -0.5
> +uniform dvec4 expected 1.7976931348623157E+308 1.0 -1.0 0.0
> +uniform double tolerance 2.0000000000000002e-05
> +draw arrays GL_TRIANGLE_FAN 0 4
> +probe rgba 0 0 0.0 1.0 0.0 1.0


More information about the Piglit mailing list