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

Timothy Arceri tarceri at itsqueeze.com
Mon Nov 27 02:43:19 UTC 2017


On 27/11/17 13:01, Eric Anholt wrote:
> Gert Wollny <gw.fossdev at gmail.com> writes:
> 
>> Array who's elements are only accessed directly are replaced by the
>> according number of temporary registers. By doing so the otherwise
>> reserved register range becomes subject to further optimizations like
>> copy propagation and register merging.
>>
>> Thanks to the resulting reduced register pressure this patch makes
>> the piglits
>>
>>    spec/glsl-1.50/execution -
>>        variable-indexing/vs-output-array-vec3-index-wr-before-gs
>>        geometry/max-input-components
>>
>> pass on r600 (barts) where they would fail before with a "GPR limit exceeded"
>> error.
>>
>> Signed-off-by: Gert Wollny <gw.fossdev at gmail.com>
>> ---
>> No further changes are observed with the piglit shader subset.
>>
>> PS: Submitter has no write access to mesa-git
> 
> This looks like something that should be done with (at most) a small
> change to opt_array_splitting.cpp, rather than reimplementing it here.

Not sure how much it matters since I also have a NIR version of this 
waiting review on the list, so a GLSL IR version is probably not going 
to help with much. Either way there will be duplication.

Ultimately it would be nice to see the following, although I feel its 
probably unlikely:
1. The ARB_gl_spriv work result partial support for a NIR based GLSL linker.
2. Remaining (non spriv) NIR GLSL linker support added.
3. Gallium drivers switch to nir->tgsi (probably solves the soft fp64 
r600 support issues).
4. i915 gets a NIR backend.
5. Drop any unrequired GLSL IR linker support and now obsolete GLSL IR opts.


More information about the mesa-dev mailing list