[Piglit] [PATCH 1/2] arb_shader_subroutine: Compile a shader that calls a subroutine with a parameter

Ian Romanick idr at freedesktop.org
Thu Jan 14 16:36:40 PST 2016


On 01/14/2016 04:30 PM, Ilia Mirkin wrote:
> On Thu, Jan 14, 2016 at 7:23 PM, Ian Romanick <idr at freedesktop.org> wrote:
>> From: Ian Romanick <ian.d.romanick at intel.com>
>>
>> NOTE: This test segfaults on Mesa.
>>
>> Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
>> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93722
>> Cc: Dave Airlie <airlied at redhat.com>
>> Cc: Nicolas Koch <nioko1337 at googlemail.com>
>> ---
>>  .../compiler/call-param-match.vert                 | 29 ++++++++++++++++++++++
>>  1 file changed, 29 insertions(+)
>>  create mode 100644 tests/spec/arb_shader_subroutine/compiler/call-param-match.vert
>>
>> diff --git a/tests/spec/arb_shader_subroutine/compiler/call-param-match.vert b/tests/spec/arb_shader_subroutine/compiler/call-param-match.vert
>> new file mode 100644
>> index 0000000..fca0f83
>> --- /dev/null
>> +++ b/tests/spec/arb_shader_subroutine/compiler/call-param-match.vert
>> @@ -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 vec4 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 = f(u);
> 
> Won't this cause it to fail, or is there a float -> vec4 autoconvert?

You are correct.  I'll change it to "piglit_fragcolor = vec4(f(u));"  It
currently segfaults in spite of that.  I've fixed this locally.

>   -ilia



More information about the Piglit mailing list