[Mesa-dev] [PATCH 06/12] glsl: fix subroutine uniform .length().

Dave Airlie airlied at gmail.com
Mon May 23 02:20:22 UTC 2016


On 23 May 2016 at 12:19, Chris Forbes <chrisf at ijw.co.nz> wrote:
>
>
> On Mon, May 23, 2016 at 12:52 PM, Dave Airlie <airlied at gmail.com> wrote:
>>
>> From: Dave Airlie <airlied at redhat.com>
>>
>> This fixes .length() on subroutine uniform arrays, if
>> we don't find the identifier normally, we look up the corresponding
>> subroutine identifier instead.
>>
>> Fixes:
>> GL45-CTS.shader_subroutine.arrays_of_arrays_of_uniforms
>> GL45-CTS.shader_subroutine.arrayed_subroutine_uniforms
>>
>> Signed-off-by: Dave Airlie <airlied at redhat.com>
>> ---
>>  src/compiler/glsl/ast_to_hir.cpp | 8 ++++++++
>>  1 file changed, 8 insertions(+)
>>
>> diff --git a/src/compiler/glsl/ast_to_hir.cpp
>> b/src/compiler/glsl/ast_to_hir.cpp
>> index 434734d..ecd1327 100644
>> --- a/src/compiler/glsl/ast_to_hir.cpp
>> +++ b/src/compiler/glsl/ast_to_hir.cpp
>> @@ -1917,6 +1917,14 @@ ast_expression::do_hir(exec_list *instructions,
>>        ir_variable *var =
>>
>> state->symbols->get_variable(this->primary_expression.identifier);
>>
>> +      if (var == NULL) {
>> +         /* the identifier might be a subroutine name */
>
>
> Being pedantic, but `subroutine uniform name`, right?

Indeed will fix that locally.

Dave.


More information about the mesa-dev mailing list