[Piglit] [PATCH 1/3 v2] arb_shader_subroutine: Compile a shader that calls a subroutine with a parameter
Ian Romanick
idr at freedesktop.org
Tue Jan 19 11:34:12 PST 2016
On 01/14/2016 11:27 PM, Dave Airlie wrote:
> On 15 January 2016 at 10:57, Ian Romanick <idr at freedesktop.org> wrote:
>> From: Ian Romanick <ian.d.romanick at intel.com>
>>
>> NOTE: This test segfaults on Mesa.
>
> btw does
>
> http://cgit.freedesktop.org/~airlied/mesa/commit/?h=arb_gpu_shader_fp64-fixes&id=a183d4f5d0dd191f4c11a6f30c8850f2dbf11df3
>
> help with it? I've had it sitting in my tree for ages, just haven't
> been motivated to send it yet.
Yes. That makes this test pass.
For the sake of avoiding code duplication, I think it's better to make a
new overload of ir_call::clone that takes the callee parameter. Then
implement the existing clone() as this->clone(mem_ctx, ht, this->callee).
> Dave.
>
>> v2: Fix bad assignment to piglit_fragcolor that would have cause the
>> shader to not compile... if it didn't already segfault. Noticed by
>> Ilia. Also fix the type of func_type to match the functions and make
>> the test .frag (as originally intended).
>>
>> Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
>> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93722
>> Reviewed-by: Ilia Mirkin <imirkin at alum.mit.edu> [v1]
>> Cc: Dave Airlie <airlied at redhat.com>
>> Cc: Nicolas Koch <nioko1337 at googlemail.com>
>> ---
>> .../compiler/call-param-match.frag | 29 ++++++++++++++++++++++
>> 1 file changed, 29 insertions(+)
>> create mode 100644 tests/spec/arb_shader_subroutine/compiler/call-param-match.frag
>>
>> diff --git a/tests/spec/arb_shader_subroutine/compiler/call-param-match.frag b/tests/spec/arb_shader_subroutine/compiler/call-param-match.frag
>> new file mode 100644
>> index 0000000..a698d61
>> --- /dev/null
>> +++ b/tests/spec/arb_shader_subroutine/compiler/call-param-match.frag
>> @@ -0,0 +1,29 @@
>> +// [config]
>> +// expect_result: pass
>> +// glsl_version: 1.50
>> +// require_extensions: GL_ARB_shader_subroutine
>> +// [end config]
>> +
>> +#version 150
>> +#extension GL_ARB_shader_subroutine: require
>> +
>> +uniform vec4 u;
>> +out vec4 piglit_fragcolor;
>> +subroutine float func_type(vec4 color);
>> +
>> +subroutine uniform func_type f;
>> +
>> +subroutine(func_type) float R(vec4 p)
>> +{
>> + return p.r;
>> +}
>> +
>> +subroutine(func_type) float G(vec4 p)
>> +{
>> + return p.g;
>> +}
>> +
>> +void main()
>> +{
>> + piglit_fragcolor = vec4(f(u));
>> +}
>> --
>> 2.5.0
>>
>> _______________________________________________
>> Piglit mailing list
>> Piglit at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/piglit
>
More information about the Piglit
mailing list