[Piglit] [PATCH 1/8] arb_gpu_shader5: Add frexp fragment shader execution test.
Paul Berry
stereotype441 at gmail.com
Fri Aug 23 09:55:22 PDT 2013
On 23 August 2013 09:03, Ian Romanick <idr at freedesktop.org> wrote:
> On 08/22/2013 04:07 PM, Matt Turner wrote:
>
>> ---
>> .../built-in-functions/fs-**frexp.shader_test | 64
>> ++++++++++++++++++++++
>> 1 file changed, 64 insertions(+)
>> create mode 100644 tests/spec/arb_gpu_shader5/**
>> execution/built-in-functions/**fs-frexp.shader_test
>>
>> diff --git a/tests/spec/arb_gpu_shader5/**execution/built-in-functions/**fs-frexp.shader_test
>> b/tests/spec/arb_gpu_shader5/**execution/built-in-functions/**
>> fs-frexp.shader_test
>> new file mode 100644
>> index 0000000..2bef71d
>> --- /dev/null
>> +++ b/tests/spec/arb_gpu_shader5/**execution/built-in-functions/**
>> fs-frexp.shader_test
>> @@ -0,0 +1,64 @@
>> +[require]
>> +GLSL >= 1.50
>> +GL_ARB_gpu_shader5
>> +
>> +[vertex shader]
>> +in vec4 vertex;
>> +
>> +void main() {
>> + gl_Position = vertex;
>> +}
>> +
>> +[fragment shader]
>> +#extension GL_ARB_gpu_shader5 : enable
>> +
>> +out vec4 color;
>> +
>> +uniform vec4 given_float;
>> +uniform vec4 expected_mantissa;
>> +uniform ivec4 expected_exponent;
>> +
>> +void main()
>> +{
>> + /* Green if both pass. */
>> + color = vec4(0.0, 1.0, 0.0, 1.0);
>> +
>> + ivec4 exponent;
>> + vec4 mantissa;
>> +
>> + mantissa = frexp(given_float, exponent);
>> +
>> + if (mantissa != expected_mantissa) {
>> + color.r = 1.0;
>> + }
>> +
>> + if (exponent != expected_exponent) {
>> + color.b = 1.0;
>> + }
>> +}
>> +
>> +[vertex data]
>> +vertex/float/2
>> +-1.0 -1.0
>> + 1.0 -1.0
>> + 1.0 1.0
>> +-1.0 1.0
>> +
>> +[test]
>> +uniform vec4 given_float 0.0 -0.0 0.5 -0.5
>> +uniform vec4 expected_mantissa 0.0 -0.0 0.5 -0.5
>> +uniform ivec4 expected_exponent 0 0 0 0
>> +draw arrays GL_TRIANGLE_FAN 0 4
>>
>
> draw rect -1 -1 2 2
>
> ... in all the tests.
I didn't think "draw rect" worked in a core context.
I have some ideas on how to modify piglit to make it work, but I've never
found the time to do it.
>
>
> +probe all rgba 0.0 1.0 0.0 1.0
>> +
>> +uniform vec4 given_float 0.49 1.0 25.0 100
>> +uniform vec4 expected_mantissa 0.98 0.5 0.78125 0.78125
>> +uniform ivec4 expected_exponent -1 1 5 7
>> +draw arrays GL_TRIANGLE_FAN 0 4
>> +probe all rgba 0.0 1.0 0.0 1.0
>> +
>> +uniform vec4 given_float 1.1754944e-38 -1.1754944e-38 3.40282347e38
>> -3.40282347e38
>> +uniform vec4 expected_mantissa 0.5 -0.5 0.999999940 -0.999999940
>> +uniform ivec4 expected_exponent -125 -125 128 128
>> +draw arrays GL_TRIANGLE_FAN 0 4
>> +probe all rgba 0.0 1.0 0.0 1.0
>>
>>
> ______________________________**_________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> http://lists.freedesktop.org/**mailman/listinfo/piglit<http://lists.freedesktop.org/mailman/listinfo/piglit>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20130823/9086460e/attachment.html>
More information about the Piglit
mailing list