[Mesa-dev] [PATCH] nir: fix packing components with arrays

Timothy Arceri tarceri at itsqueeze.com
Mon Apr 15 08:55:25 UTC 2019


On 15/4/19 5:53 pm, Samuel Pitoiset wrote:
> Shouldn't we also apply that fix in gather_varying_component_info() ?
> 

No because we don't enter that code path for arrays because we don't try 
to pack arrays into other slots/components. But we do pack scalar 
components with "unmovable" arrays when there is space. Hopefully that 
makes sense.

> On 4/15/19 7:00 AM, Timothy Arceri wrote:
>> When gathering info for unmovable types we need to handle arrays.
>> While we dont support packing/moving arrays we do support packing
>> scalar components with these arrays.
>>
>> Fixes piglit:
>> tests/spec/arb_enhanced_layouts/execution/component-layout/vs-fs-array-interleave-range.shader_test 
>>
>>
>> Fixes: 5eb17506e159 ("nir: do not pack varying with different types")
>> ---
>>   src/compiler/nir/nir_linking_helpers.c | 3 ++-
>>   1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/src/compiler/nir/nir_linking_helpers.c 
>> b/src/compiler/nir/nir_linking_helpers.c
>> index 7594728e25e..f4494c78f98 100644
>> --- a/src/compiler/nir/nir_linking_helpers.c
>> +++ b/src/compiler/nir/nir_linking_helpers.c
>> @@ -309,7 +309,8 @@ get_unmoveable_components_masks(struct exec_list 
>> *var_list,
>>               comps[location + i].interp_type =
>>                  get_interp_type(var, type, default_to_smooth_interp);
>>               comps[location + i].interp_loc = get_interp_loc(var);
>> -            comps[location + i].is_32bit = glsl_type_is_32bit(type);
>> +            comps[location + i].is_32bit =
>> +               glsl_type_is_32bit(glsl_without_array(type));
>>            }
>>         }
>>      }


More information about the mesa-dev mailing list