Multi-threaded WebGL on Mac

(Follow Bug 1232742 for more details)

Today we enabled CGL’s ‘Multi-threaded OpenGL Execution‘ mode on Nightly. There’s a lot of good information on that page so I wont repeat it all here.

In short, even though OpenGL is already an asynchronous API, the driver must do some work to prepare the OpenGL command queue which can be a bottleneck for certain content. Right now Firefox makes OpenGL call on the main thread on all platforms so it’s up to the driver where & how to schedule this work. Typically the command buffers are prepared synchronously at the moment of the call and in some cases can have a lot of overhead. If the WebGL applications needs the full refresh window, say ~15ms, then the work done in the driver might start causing missed frame degrading performance. Turning on this feature will move this work to another thread.

We decided to turn it on because we believe it will be overall beneficial for well optimized WebGL content that is CPU-bound as measured in the Unity Benchmark:

Unity Multi-thread WebGL Benchmark

Unity Multi-thread WebGL Benchmark

Overall this leads to a 15% score improvements however in some cases the scores are worse because the feature only helps for speed up demos that are bound by the CPU overhead of certain OpenGL calls.

Turning this on is an experiment to see the benefit of making OpenGL calls asynchronous. Based on the results we may consider ‘remoting’ the OpenGL calls manually on more platforms for performance reasons however we’re still undecided since it’s a large new project.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s