[Piglit] [PATCH] tests/spec/glsl-1.30: add tests for integer sign() function
Brian Paul
brianp at vmware.com
Fri May 23 10:37:30 PDT 2014
Yeah, I missed those. Thanks.
-Brian
On 05/23/2014 11:23 AM, Ilia Mirkin wrote:
> What's wrong with
>
> generated_tests/spec/glsl-1.30/execution/built-in-functions/fs-sign-ivec4.shader_test
>
> [fragment shader]
> uniform ivec4 arg0;
> uniform ivec4 expected;
>
> void main()
> {
> ivec4 result = sign(arg0);
> gl_FragColor = result == expected ? vec4(0.0, 1.0, 0.0, 1.0) :
> vec4(1.0, 0.0, 0.0, 1.0);
> }
>
>
> On Fri, May 23, 2014 at 1:18 PM, Brian Paul <brianp at vmware.com> wrote:
>> ---
>> .../glsl-1.30/execution/fs-sign-int4.shader_test | 24 +++++++++++++++++
>> .../glsl-1.30/execution/vs-sign-int4.shader_test | 27 ++++++++++++++++++++
>> 2 files changed, 51 insertions(+)
>> create mode 100644 tests/spec/glsl-1.30/execution/fs-sign-int4.shader_test
>> create mode 100644 tests/spec/glsl-1.30/execution/vs-sign-int4.shader_test
>>
>> diff --git a/tests/spec/glsl-1.30/execution/fs-sign-int4.shader_test b/tests/spec/glsl-1.30/execution/fs-sign-int4.shader_test
>> new file mode 100644
>> index 0000000..423d098
>> --- /dev/null
>> +++ b/tests/spec/glsl-1.30/execution/fs-sign-int4.shader_test
>> @@ -0,0 +1,24 @@
>> +[require]
>> +GLSL >= 1.30
>> +
>> +[vertex shader]
>> +#version 130
>> +void main()
>> +{
>> + gl_Position = gl_Vertex;
>> +}
>> +
>> +[fragment shader]
>> +#version 130
>> +uniform ivec4 arg0;
>> +void main()
>> +{
>> + ivec4 r = sign(arg0);
>> + // convert -1, 0, 1 to 0.0, 0.5, 1.0
>> + gl_FragColor = vec4(r) * 0.5 + 0.5;
>> +}
>> +
>> +[test]
>> +uniform ivec4 arg0 -5 5 0 3
>> +draw rect -1 -1 2 2
>> +probe rgb 1 1 0 1 0.5 0
>> diff --git a/tests/spec/glsl-1.30/execution/vs-sign-int4.shader_test b/tests/spec/glsl-1.30/execution/vs-sign-int4.shader_test
>> new file mode 100644
>> index 0000000..4fe7702
>> --- /dev/null
>> +++ b/tests/spec/glsl-1.30/execution/vs-sign-int4.shader_test
>> @@ -0,0 +1,27 @@
>> +[require]
>> +GLSL >= 1.30
>> +
>> +[vertex shader]
>> +#version 130
>> +uniform ivec4 arg0;
>> +out vec4 color;
>> +void main()
>> +{
>> + ivec4 r = sign(arg0);
>> + // convert -1, 0, 1 to 0.0, 0.5, 1.0
>> + color = vec4(r) * 0.5 + 0.5;
>> + gl_Position = gl_Vertex;
>> +}
>> +
>> +[fragment shader]
>> +#version 130
>> +in vec4 color;
>> +void main()
>> +{
>> + gl_FragColor = color;
>> +}
>> +
>> +[test]
>> +uniform ivec4 arg0 0 55 -13 2
>> +draw rect -1 -1 2 2
>> +probe rgb 1 1 0.5 1.0 0.0 1.0
>> --
>> 1.7.10.4
>>
>> _______________________________________________
>> Piglit mailing list
>> Piglit at lists.freedesktop.org
>> https://urldefense.proofpoint.com/v1/url?u=http://lists.freedesktop.org/mailman/listinfo/piglit&k=oIvRg1%2BdGAgOoM1BIlLLqw%3D%3D%0A&r=lGQMzzTgII0I7jefp2FHq7WtZ%2BTLs8wadB%2BiIj9xpBY%3D%0A&m=1iBdpLyGXr0J5OTVFKL6haklNCV4xgojLargUYMR5Dg%3D%0A&s=ce2ab4ff660a4225302758df57020d74e19269543a850941c56f06828867c78d
More information about the Piglit
mailing list