[Mesa-dev] Time to merge threaded GL dispatch? (aka glthread)

Steven Newbury steve at snewbury.org.uk
Mon Feb 6 15:30:23 UTC 2017

On Mon, 2017-02-06 at 01:11 +0100, Marek Olšák wrote:
> Hi,
> Back in 2012-2013, then-Intel employees Eric Anholt and Paul Berry
> wrote this threaded GL dispatch where GL calls are queued and
> executed
> in a different thread. It was supposed to deal with high CPU overhead
> of Mesa, but at the time most games used the compatibility profile
> and
> Steam didn't really exist on Linux, so it didn't help many (if any)
> apps.
> Things are different today. We have Steam and most games use the GL
> core profile. We know of several games that have better performance
> with glthread, namely Borderlands 2, and some people reported to me
> that some other games also benefit. It's about time we put this into
> mainline Mesa.
> My plan is that we merge it as-is or with minor changes, and then
> we'll clean it up and improve it while it's in master. It's disabled
> by default, so it shouldn't bother anyone who doesn't want it. There
> is a drirc option to turn it on (just use the corresponding env var).
> All Gallium drivers support it.
> A note on synchronizations. Borderlands 2 has 170 thread syncs per
> frame. That means the app thread has to stop and wait 170x per frame.
> Despite that, it still has 70% higher performance in some cases. My
> theory is that if you have a lot of draw calls, you can have a lot of
> syncs, because the sheer amount of draw calls will just make those
> syncs irrelevant. 200 syncs per 4k draw calls is like 1 sync per 20
> draw calls.
> Here it is: https://cgit.freedesktop.org/~mareko/mesa/log/?h=glthread
> The plan is to merge everything up to the gallium commit (without the
> Intel commits, I'll let Intel decide what to do with them). I can
> send
> the whole series to the list if that's preferable.
> Opinions?
Despite not requesting merge of the Intel commits, I took a look, and
they're (mis)applied to variously i915/i965 where previously there was
the "intel" driver directory.  Presumably i965 is the correct driver to
be applying the changes to and I've reworked the patches accordingly.

Will test them shortly.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170206/21f64cc6/attachment-0001.sig>

More information about the mesa-dev mailing list