[Mesa-dev] [PATCH 05/12] nir: Make deref_has_indirect public

Jason Ekstrand jason at jlekstrand.net
Mon Jul 2 18:10:57 UTC 2018


On July 2, 2018 12:58:47 Caio Marcelo de Oliveira Filho 
<caio.oliveira at intel.com> wrote:

>> diff --git a/src/compiler/nir/nir_lower_io_arrays_to_elements.c 
>> b/src/compiler/nir/nir_lower_io_arrays_to_elements.c
>> index 9a5eec8f870..7753f85824d 100644
>> --- a/src/compiler/nir/nir_lower_io_arrays_to_elements.c
>> +++ b/src/compiler/nir/nir_lower_io_arrays_to_elements.c
>> @@ -194,12 +194,13 @@ lower_array(nir_builder *b, nir_intrinsic_instr 
>> *intr, nir_variable *var,
>> nir_instr_remove(&intr->instr);
>> }
>>
>> -static bool
>> -deref_has_indirect(nir_builder *b, nir_variable *var, nir_deref_var *deref)
>> +bool
>> +nir_deref_has_indirect(gl_shader_stage stage, nir_deref_var *deref)
>> {
>> +   const nir_variable *const var = deref->var;
>> nir_deref *tail = &deref->deref;
>>
>> -   if (nir_is_per_vertex_io(var, b->shader->info.stage)) {
>> +   if (nir_is_per_vertex_io(var, stage)) {
>> tail = tail->child;
>> }
>
> I somewhat feel this name is more general than what the function does
> (there's a skipping of certain variables going on).
>
> Not directly appliable, but see also from Jason Friday's series:
>
> [PATCH v2 2/9] nir: Add a deref_instr_has_indirect helper

Yeah, the helpers in nir_lower_io are not as generically applicable as they 
look.  I think we should eventually make general helpers that nir_lower_io 
and friends can use but it's going to take some care.

--Jason





More information about the mesa-dev mailing list