[Piglit] [PATCH v4] unsized_array_member: It should expect link success instead of link error

Ian Romanick idr at freedesktop.org
Tue Jun 26 03:06:07 UTC 2018


On 06/25/2018 08:57 AM, Dylan Baker wrote:
> Quoting Eleni Maria Stea (2018-06-23 01:43:52)
>> Modified the unsized_array_member.shader_test to expect successful
>> linking instead of linker error.
>>
>> Section 4.2 (Scoping) of the OpenGL Shading Language Specification says:
>> "An array implicitly sized in one shader can be explicitly sized by
>> another shader in the same stage. If no shader in a stage has an explicit
>> size for the array, the largest implicit size (one more than the largest
>> index used) in that stage is used. There is no cross-stage array sizing.
>> If there is no static access to an implicitly sized array within the stage
>> declaring it, then the array is given a size of 1, which is relevant when
>> the array is declared within an interface block that is shared with other
>> stages or the application (other unused arrays might be eliminated by the
>> optimizer)."
>>
>> This means that the unused array s of the following shader block in the
>> unsized_array_member.shader_test:
>> buffer a {
>>         vec4 s[];
>>         vec4 a[];
>> } b;
>> should be an array of size 1 and not an unsized array, and so no linker
>> error should be generated.
>>
>> Ref: https://bugs.freedesktop.org/show_bug.cgi?id=106915
>>
>> v2:
>>   - replaces the comment at the top with the relevant part of the spec
>> v3:
>>   - fixes in the quoted part of the spec (Ian Romanick)
>> v4:
>>   - updates the commit message accordingly (Dylan Baker)
>> ---
>>  .../linker/unsized_array_member.shader_test   | 20 ++++++++++---------
>>  1 file changed, 11 insertions(+), 9 deletions(-)
>>
>> diff --git a/tests/spec/arb_shader_storage_buffer_object/linker/unsized_array_member.shader_test b/tests/spec/arb_shader_storage_buffer_object/linker/unsized_array_member.shader_test
>> index 47d0483ac..946bf1cb2 100644
>> --- a/tests/spec/arb_shader_storage_buffer_object/linker/unsized_array_member.shader_test
>> +++ b/tests/spec/arb_shader_storage_buffer_object/linker/unsized_array_member.shader_test
>> @@ -1,12 +1,14 @@
>> -# From ARB_program_interface_query spec:
>> +# Section 4.2 (Scoping) of the OpenGL Shading Language Specification says:
>>  #
>> -#    "For the property of BUFFER_DATA_SIZE, then the implementation-dependent
>> -#    minimum total buffer object size, in basic machine units, required to
>> -#    hold all active variables associated with an active uniform block, shader
>> -#    storage block, or atomic counter buffer is written to <params>.  If the
>> -#    final member of an active shader storage block is array with no declared
>> -#    size, the minimum buffer size is computed assuming the array was declared
>> -#    as an array with one element."
>> +#    "An array implicitly sized in one shader can be explicitly sized by
>> +#    another shader in the same stage. If no shader in a stage has an
>> +#    explicit size for the array, the largest implicit size (one more than
>> +#    the largest index used) in that stage is used. There is no cross-stage
>> +#    array sizing. If there is no static access to an implicitly sized array
>> +#    within the stage declaring it, then the array is given a size of 1,
>> +#    which is relevant when the array is declared within an interface block
>> +#    that is shared with other stages or the application (other unused arrays
>> +#    might be eliminated by the optimizer)."
>>  
>>  [require]
>>  GLSL >= 1.50
>> @@ -31,4 +33,4 @@ void main(void) {
>>  }
>>  
>>  [test]
>> -link error
>> +link success
>> -- 
>> 2.17.1
>>
> 
> This looks good to me, Ian?

Not until we get clarity on the issue from Khronos.  I'll update the bug
as soon as I know anything.  Hopefully I can bring it up in the meeting
this week.

> Dylan

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/piglit/attachments/20180625/f07c6145/attachment.sig>


More information about the Piglit mailing list