Valve Sponsors Work To Greatly Speed-Up Linux OpenGL Game Load Times
An anonymous reader writes "Valve Software has sponsored some interesting improvements developed by LunarG for the Mesa OpenGL library on Linux for deferred and threaded GLSL shader compilation. What these changes mean for users of the open-source Linux graphics drivers when running their favorite games is that OpenGL games now load a lot faster. As an example, the time from starting Dota 2 until the time actually being within the game is reduced by about 20 seconds on an Intel system. While Direct3D has offered similar functionality for a while, OpenGL has not, which has given it a bad reputation with regard to game load times until all shaders are compiled and cached — fortunately it's now addressed for OpenGL if using the Mesa Linux graphics drivers on a supported game."
This won't affect Tux Racer's FPS. This will affect the load time on DotA 2, as well as other games which compile many shaders during load time.
Caching of compiled shaders is supported by the OpenCL spec, and I presume by GLSL as well (I've not looked, but they generally use more or less the same code paths). The application is responsible for asking the driver for the cacheable version and then loading it again later. The problem is that, on first load, the game is effectively doing ahead-of-time compilation of all of its shaders and, previously, these were all done in a single thread. The multithreading part is a bit odd, because most DRI GPU drivers use LLVM on the back end and LLVM has supported multithreaded compilation for a few years.
I am TheRaven on Soylent News
An IR doesn't buy you much. The time taken for clang to compile OpenCL C to SPIR is about 10% of the time required for LLVM to optimise and codegen the resulting SPIR into native code. The driving force behind SPIR comes from developers who don't want their shader source code embedded in their binary source.
I am TheRaven on Soylent News
So Linux sucks because anyone can improve it in the areas where they feel it is needed? Yeah, that does suck. Booo, Linux.
Pretty good is actually pretty bad.
If nobody is willing to develop a certain feature, then maybe there isn't a real demand for it.
Pretty good is actually pretty bad.
I think you miss something:
On Windows, OpenGL already competes with DirectX. Especially with the indie-game revolution of the last 10 years.
On Linux, OpenGL wins 100% complete, hands-down. Because DirectX can't even run, let alone come close on performance.
On Mac, OpenGL wins 100% complete, hands-down. Unless you count boot-camp, which is really just Windows.
You can try to paint a different picture all you like - fact is that OpenGL is not only "the same" as DirectX when you're on Windows, but also runs in a ton of other places. That fact that it has slightly less performance than the ideal scenario on one of those (it has to be said) more obscure platforms is pretty inconsequential (and now fixed). I haven't seen anyone complain about the OpenGL performance on those millions of smartphones that run it. I haven't heard much about DirectX on smartphones, however.
Cherry-picking the battlefield for a comparison is no worse than cheating because you know you're going to lose.
Even on windows, OpenGL is not that much slower, on the order of 10% for 'normal' 3D game code. With a modern video card that difference almost doesnt matter.
Drivers to be renamed "Black Mesa OpenGL Library"?
I doubt people are using Windows because of the deferred and threaded GLSL shader compilation. I think it has more to do with the fact games are barely available for Linux at all. And that also has little do with how shaders are precompiled I think.
This feature just shaves off a few seconds during load time. That's great of course, but by no means a killer feature that previously has been a real problem for anyone. That's why the feature is late to the party and it is a gaming company who comes up with the patch, as they want their games to load faster. Makes sense, right? In no way I see how this makes Linux look bad.
Pretty good is actually pretty bad.
How is it Linux fault that Microsoft doesn't provide Office or Adobe doesn't provide Photoshop for it?
Pretty good is actually pretty bad.
And that's just the desktop. On phones, OpenGL wins all. On tablets, OpenGL wins all. On consoles, DirectX is only relevant for the Xbox, the rest runs OpenGL.
The sphere of influence Microsoft has on the computing industry as a whole has been shrinking with each passing year for at least a decade now. The diminishing relevance of DirectX is yet another proof of this.
Pretty good is actually pretty bad.
So hurray to Valve for fixing this and hurray to Linux for letting them, right?
Pretty good is actually pretty bad.
And that also has little do with how shaders are precompiled I think.
As far as I know, you cannot precompile shaders anyway because the compiled code is hardware-dependent. The shader processors are different among architectures and manufacturers, and do not have a common baseline like "x86-64" to target, like we have on the CPU side.
Well, there's no demand for this because there's a relatively convenient alternative. In this case, the alternative is Windows and DirectX. It doesn't really say a lot for Linux if this is what people are doing.
Yes, exactly right. 3D gaming isn't some half-dead community with no revenue stream on other platforms. Hell, other platforms were created for gaming due to demand (From Atari to PS4), which has been going on for decades.
In the meantime, the Linux community sat on the sidelines and assumed what everyone really wanted in any new distro...a new version of GNOME or KDE to keep other more "important" debates alive.
While I can understand an efficiency within demand, it's rather odd that Linux still looks at 3D gaming like it's a 20-megapixel camera in a cell phone, when we in fact have 20-megapixel cameras in cell phones these days...
Kinda, yeah. What we're seeing now is the breaking of the chicken-and-egg problem of gaming on Linux. Up until very recently, virtually no developers bothered developing games for Linux, because no-one does gaming in Linux. No-one ran Linux for gaming, because there were very few games for Linux (and the drivers were a pain).
Up until recently, Linux had merely taken over the world when it came to servers and mobile (Android). Now it's being given a real shot at gaming.
The problem with OpenGL isn't speed or load times. Microsoft made directx so 3D programming in windows would be easier. It's just like C# or VBA. They made it much easier to use, and therefore much cheaper to hire for. If you're hiring people to write a new 3D engine using OpenGL you need people at the top of their field... If you're hiring for DirectX there are dozens of local tech colleges filled with mediocre talent that will fit the bill. Now, you could argue that you should be getting top talent anyways, but that's why you don't run a major game producers.
...both have functionality for accessing (and saving) a compiled shader so that it can be loaded and used instantly on next run.
OpenGL. Just like WiiU, Android, iOS, and every other platform that isn't Microsoft.
"[Regarding the 'cloud,'] ownership was what made America different than Russia." -- Woz
FWIW, the Nvidia proprietary drivers have had a shader cache on Linux since the 290.03 release in late 2011 (search for GLShaderDiskCache). It probably helps Mass Effect 2 under Wine somewhat (here's a bug report from before the cache was added to the driver: http://bugs.winehq.org/show_bu... )