[Mesa-dev] [PATCH v2 2/3] nir: Add a discard optimization pass

Eero Tamminen eero.t.tamminen at intel.com
Wed Jul 11 10:05:27 UTC 2018


On 06.07.2018 00:28, Jason Ekstrand wrote:
> On Thu, Jul 5, 2018 at 2:18 PM, Jason Ekstrand <jason at jlekstrand.net 
> <mailto:jason at jlekstrand.net>> wrote:
>         >> Optimizing for the latter case is an essentially
>         >> heuristic assumption that needs to be verified experimentally.  Have you
>         >> tested the effect of this pass on non-DX workloads extensively?
>         >>
>         >
>         > Yes, it is a trade-off.  No, I have not done particularly extensive
>         > testing.  We do, however, know of non-DXVK workloads that would benefit
>         > from this.  I believe Manhattan is one such example though I have not yet
>         > benchmarked it.
>         >
>         You should grab some numbers then to make sure there are no
>         regressions...
>     I'm working on that.  Unfortunately the perf system is giving me
>     trouble so I don't have the numbers yet.
>         But keep in mind that the i965 scheduler is already
>         performing a similar optimization (locally, but with cycle-count
>         information).  This will only help over the existing
>         optimization if the
>         shaders that represent a bottleneck in Manhattan have sufficient
>         control
>         flow for the basic block boundaries to represent a problem to the
>         (local) scheduler.
>     I'm not sure about the manhattan shader but the Skyrim shader does
>     have control flow which the discard has to get moved above.
> I have results from the perf system now and somehow this pass makes 
> manhattan noticeably worse.  I'll look into that.

Note: All the more complex GfxBench tests use discard:
	Egypt, T-Rex, Manhattan, CarChase, AztecRuins...

(Most of the other benchmarks we're running, don't use them.)

	- Eero

More information about the mesa-dev mailing list