[Piglit] [PATCH 4/4] glsl-1.10: Test the step built-in function

Tapani Pälli tapani.palli at intel.com
Wed Mar 18 01:18:13 PDT 2015


Hi;

Test looks good and passes fine on HSW;

Reviewed-by: Tapani Pälli <tapani.palli at intel.com>


With INTEL_DEVID_OVERRIDE (0x0046 or 0x2A42) though it does not seem to 
hit the mentioned optimization, since the comparison operation is 
ir_binop_gequal, this is on HSW desktop machine.



On 03/17/2015 11:51 PM, Ian Romanick wrote:
> From: Ian Romanick <ian.d.romanick at intel.com>
>
> This is a general step() test, but it is designed to tickle an
> optimization path in the GEN4 and GEN5 code generation in the i965
> driver.  This optimization tries to generate different code for
> expressions like 'float(expr cmp 0)'.
>
> Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
> Cc: Tapani Palli <tapani.palli at intel.com>
> ---
>   tests/spec/glsl-1.10/execution/fs-step.shader_test | 35 ++++++++++++++++++++++
>   1 file changed, 35 insertions(+)
>   create mode 100644 tests/spec/glsl-1.10/execution/fs-step.shader_test
>
> diff --git a/tests/spec/glsl-1.10/execution/fs-step.shader_test b/tests/spec/glsl-1.10/execution/fs-step.shader_test
> new file mode 100644
> index 0000000..2ea0725
> --- /dev/null
> +++ b/tests/spec/glsl-1.10/execution/fs-step.shader_test
> @@ -0,0 +1,35 @@
> +[require]
> +GLSL >= 1.10
> +
> +[vertex shader passthrough]
> +
> +[fragment shader]
> +uniform float a;
> +uniform float b;
> +uniform vec4 color0;
> +uniform vec4 color1;
> +
> +void main()
> +{
> +    /* This is a general step() test, but it is designed to tickle an
> +     * optimization path in the GEN4 and GEN5 code generation in the i965
> +     * driver.  This optimization tries to generate different code for
> +     * expressions like 'float(expr cmp 0)'.
> +     */
> +    gl_FragColor = step(0.0, a * b) * color0 + color1;
> +}
> +
> +[test]
> +uniform float a -1
> +uniform float b 1
> +uniform vec4 color0 1.0 -1.0 0.0 0.0
> +uniform vec4 color1 0.0 1.0 0.0 1.0
> +draw rect -1 -1 1 2
> +relative probe rgba (0.25, 0.5) (0.0, 1.0, 0.0, 1.0)
> +
> +uniform float a 1
> +uniform float b 1
> +uniform vec4 color0 -1.0 1.0 0.0 0.0
> +uniform vec4 color1 1.0 0.0 0.0 1.0
> +draw rect 0 -1 1 2
> +relative probe rgba (0.75, 0.5) (0.0, 1.0, 0.0, 1.0)
>


More information about the Piglit mailing list