[Mesa-dev] [PATCH] glsl/lower_distance: only set max_array_access for 1D clip dist arrays

Dave Airlie airlied at gmail.com
Mon Jun 12 00:27:59 UTC 2017


On 12 June 2017 at 10:04, Timothy Arceri <tarceri at itsqueeze.com> wrote:
> On 12/06/17 09:47, Dave Airlie wrote:
>>
>> From: Dave Airlie <airlied at redhat.com>
>>
>> The max_array_access field applies to the first dimension, which means
>> we only want to set it for the 1D clip dist arrays.
>>
>> This fixes an ir_validate assert seen with
>> KHR-GL44.cull_distance.functional
>> on nouveau and radeon with debug builds.
>>
>> Signed-off-by: Dave Airlie <airlied at redhat.com>
>> ---
>>   src/compiler/glsl/lower_distance.cpp | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/src/compiler/glsl/lower_distance.cpp
>> b/src/compiler/glsl/lower_distance.cpp
>> index 9858503..ff04e9a 100644
>> --- a/src/compiler/glsl/lower_distance.cpp
>> +++ b/src/compiler/glsl/lower_distance.cpp
>> @@ -167,7 +167,6 @@ lower_distance_visitor::visit(ir_variable *ir)
>>         /* Clone the old var so that we inherit all of its properties */
>>         *new_var = ir->clone(ralloc_parent(ir), NULL);
>>         (*new_var)->name = ralloc_strdup(*new_var, GLSL_CLIP_VAR_NAME);
>> -      (*new_var)->data.max_array_access = new_size - 1;
>>         (*new_var)->data.location = VARYING_SLOT_CLIP_DIST0;
>>           if (!ir->type->fields.array->is_array()) {
>> @@ -182,6 +181,7 @@ lower_distance_visitor::visit(ir_variable *ir)
>>                     this->shader_stage == MESA_SHADER_GEOMETRY)));
>>              assert (ir->type->fields.array == glsl_type::float_type);
>> +         (*new_var)->data.max_array_access = new_size - 1;
>
>
> Why do we need to set this at all? As far as I can tell the only user is
> update_array_sizes() which creates a new array instance type, but we are
> doing that below anyway.

I think we want to set it so validation passes, not sure any other reason.

Dave.


More information about the mesa-dev mailing list