[Piglit] [PATCH] glsl-1.10: test for rotating a variable components in a loop
Ian Romanick
idr at freedesktop.org
Wed Sep 2 16:23:02 PDT 2015
On 09/01/2015 06:31 PM, Ilia Mirkin wrote:
> On Tue, Sep 1, 2015 at 9:02 PM, Dave Airlie <airlied at gmail.com> wrote:
>> From: Dave Airlie <airlied at redhat.com>
>>
>> This test fails on r600 with sb enabled, it does something
>> similiar to what a lot of the CTS test cases do.
>>
>> Signed-off-by: Dave Airlie <airlied at redhat.com>
>> ---
>> .../fs-while-loop-rotate-value.shader_test | 32 ++++++++++++++++++++++
>> 1 file changed, 32 insertions(+)
>> create mode 100644 tests/spec/glsl-1.10/execution/fs-while-loop-rotate-value.shader_test
>>
>> diff --git a/tests/spec/glsl-1.10/execution/fs-while-loop-rotate-value.shader_test b/tests/spec/glsl-1.10/execution/fs-while-loop-rotate-value.shader_test
>> new file mode 100644
>> index 0000000..cb08b0f
>> --- /dev/null
>> +++ b/tests/spec/glsl-1.10/execution/fs-while-loop-rotate-value.shader_test
>> @@ -0,0 +1,32 @@
>> +# test to check a bug in r600 sb backend
>> +# it miscompiles this due to the 1.0
>> +# at the end wierdly.
weirdly
>> +[require]
>> +GLSL >= 1.10
>
> Is this allowed in GLSL 1.10? (Having a non-compile-time-resolvable loop)
Yes. Only GLSL ES 1.00 has such restrictions.
>> +
>> +[vertex shader]
>
> [vertex shader passthrough]
>
>> +void main()
>> +{
>> + gl_Position = gl_Vertex;
>> +}
>> +
>> +[fragment shader]
>> +uniform int count;
>> +uniform vec4 init_val;
>> +
>> +void main()
>> +{
>> + vec4 out_val = init_val;
>> + int i = 0;
>> + while (i++ < count) {
>> + out_val = out_val.yzwx;
>> + }
>> + gl_FragColor = vec4(out_val.xyz, 1.0);
>> +}
>> +
>> +[test]
>> +uniform int count 3
>> +uniform vec4 init_val 0.25 0.5 0.75 1.0
>> +
>> +draw rect -1 -1 2 2
>> +probe all rgba 1.0 0.25 0.5 1.0
>
> Reviewed-by: Ilia Mirkin <imirkin at alum.mit.edu>
>
> BTW, there's also a tests/shaders/ssa if you prefer to place it in
> there... IIRC it has a similar test, but I guess this one's different
> enough.
>
>> --
>> 2.4.3
>>
>> _______________________________________________
>> Piglit mailing list
>> Piglit at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/piglit
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit
More information about the Piglit
mailing list