[Mesa-dev] [PATCH] mesa: allow unlimited temporaries

Luca Barbieri luca at luca-barbieri.com
Mon Sep 6 08:05:39 PDT 2010


>>> Unfortunately, some GLSL shaders such as an SSAO fragment
>>> post-processing shader in Unigine Tropics, go over this limit at
>>> least before program optimizations are applied.
>
> By the time we generate Mesa IR all the optimizations should be done.

Are you sure?

As far as I could tell, ir_to_mesa doesn't attempt to reuse
temporaries, leaving the task to prog_optimize.c
This means that a huge number of temporaries must be represented in Mesa IR.

If that's not the case, something in that SSAO shader makes ir_to_mesa
do a terrible job allocating registers.

Anyway, modern hardware definitely can support an arbitrary number of
temps in the final program, since DirectX 11 cards at least can spill
to VRAM.

>> Can you implement* an INDEXABLE_TEMPORARY file instead so we can use
>> TGSI_FILE_TEMPORARY_ARRAY so that I can finally support this in nv50
>> without having to spill my whole GPR file to memory because I don't
>> know what part of TEMP can be accessed by the indirect load/store ?
>
> This is the right way to go. It should be handled at a higher level IR. It
> will be a lot easier to do this before generating the low-level Mesa IR.

Yes, sure, but again it's unrelated to this change.


More information about the mesa-dev mailing list