[Mesa-dev] [PATCH 1/9] tgsi/scan: add a new pass that analyzes tess factor writes

Marek Olšák maraeo at gmail.com
Thu Sep 7 14:16:05 UTC 2017


On Thu, Sep 7, 2017 at 2:24 PM, Nicolai Hähnle <nhaehnle at gmail.com> wrote:
> On 07.09.2017 14:23, Nicolai Hähnle wrote:
>>
>> On 07.09.2017 12:55, Marek Olšák wrote:
>>>
>>> We can also say if gl_TessLevel* is written multiple times, then one
>>> these must be true:
>>> - there must not be a barrier between the writes
>>> - gl_TessLevel* writes aren't inside conditional blocks
>>>
>>> I see that these games use a barrier in TCS:
>>> - Hitman
>>> - Grid Autosport
>>> - Tomb Raider
>>>
>>> All constraints are true for those games. If we do this, it should be
>>> enough: "there must not be a barrier between the writes"
>>
>>
>> Right, if there are no barriers between the writes, we can always assume
>> that the writes from invocation 0 land last (obviously we still need to know
>> that invocation 0 did write, but your patch already checks that).
>
>
> There's an annoying subtlety though, if there are tess factor writes
> *before* a barrier, and then tess factor reads after the barrier. But that
> should be easy enough to check.

That shouldn't matter. Tess factor LDS stores are always executed if
(tcs_reads_tessfactor_outputs || !invoc0_tessfactors_are_def). Tess
factor loads always use LDS. No TGSI instruction can read tess factors
from VGPRs.

Marek


More information about the mesa-dev mailing list