[Mesa-dev] [PATCH] mesa/st: glsl_to_tgsi: Dissolve arrays who's elements are only accessed directly

Gert Wollny gw.fossdev at gmail.com
Tue Nov 28 13:54:50 UTC 2017


Am Dienstag, den 28.11.2017, 08:45 +1100 schrieb Timothy Arceri:
> 
> 
> > 
> > If I understand the comments in opt_array_splitting, arrays of
> > arrays are not properly handled there. Curretly, I don't see how I
> > can fix this, because I simply didn't look at any code there
> > before.
> 
> There is more to it than that. We don't even split varyings at all 
> currently.
> 
> "This skips uniform/varying arrays, which would need careful
> handling  due to their ir->location fields tying them to the GL API
> and other 
> shader stages."
> 
> This is enforced in get_variable_entry() via:
> 
>     if (var->data.mode != ir_var_auto &&
>         var->data.mode != ir_var_temporary)
>        return NULL;
> 
> As per my previous email I don't think there is much value in putting
> a bunch of work into this pass.

For me this raises the question whether it would make sense to push the
patch that I sent (probably changing the name of the method to
"split_arrays") and that addresses the problem in the glsl->tgsi stage
(I can't push it anyway) and is currently useful at least for r600? 

Since I think about another improvement in this stage(*) that would
further reduce the register pression, I wonder whether it is worth to
put effort in this or whether this change you talked about switch to
nir->tgsi can be expected to replace glsl->tgsi anytime soon? 


(*) The idea is to also implement array merging and interleaving,
because with r600 the number of registers is quite limited, and arrays
really cut into that, especially if the arrays use only one component.

many thanks, 
Gert 



 

> 
> > 
> > Best,
> > Gert
> > 


More information about the mesa-dev mailing list