glsl-1.10: test for rotating a variable components in a loop

Submitted by Dave Airlie on Sept. 2, 2015, 1:02 a.m.

Details

Message ID 1441155779-25541-1-git-send-email-airlied@gmail.com
State New
Headers show

Not browsing as part of any series.

Commit Message

Dave Airlie Sept. 2, 2015, 1:02 a.m.
From: Dave Airlie <airlied@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@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

Patch hide | download patch | download mbox

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.
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+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

Comments

On Tue, Sep 1, 2015 at 9:02 PM, Dave Airlie <airlied@gmail.com> wrote:
> From: Dave Airlie <airlied@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@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.
> +[require]
> +GLSL >= 1.10

Is this allowed in GLSL 1.10? (Having a non-compile-time-resolvable loop)

> +
> +[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@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@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit
On 09/01/2015 06:31 PM, Ilia Mirkin wrote:
> On Tue, Sep 1, 2015 at 9:02 PM, Dave Airlie <airlied@gmail.com> wrote:
>> From: Dave Airlie <airlied@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@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@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@lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/piglit
> _______________________________________________
> Piglit mailing list
> Piglit@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit