Slashdot Mirror


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."

25 of 202 comments (clear)

  1. Re:Oh wow by Anonymous Coward · · Score: 5, Informative

    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.

  2. Re:OpenGL is the future by TheRaven64 · · Score: 5, Informative

    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
  3. Re:Stop gap by TheRaven64 · · Score: 5, Interesting

    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
  4. Re:And still linux sucks by dingen · · Score: 4, Insightful

    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.
  5. Re:And still linux sucks by 91degrees · · Score: 3, Informative

    I think the argument is that nobody does so for several years.

  6. Re:And still linux sucks by dingen · · Score: 4, Insightful

    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.
  7. Re:Valve competing with Microsoft by ledow · · Score: 5, Informative

    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.

  8. Re:Valve competing with Microsoft by Anonymous Coward · · Score: 5, Interesting

    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.

  9. obligatory by Anonymous Coward · · Score: 5, Funny

    Drivers to be renamed "Black Mesa OpenGL Library"?

  10. Re:And still linux sucks by dingen · · Score: 5, Insightful

    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.
  11. Re:And still linux sucks by dingen · · Score: 4, Insightful

    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.
  12. Re:Valve competing with Microsoft by dingen · · Score: 5, Informative

    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.
  13. Re:And still linux sucks by dingen · · Score: 4, Insightful

    So hurray to Valve for fixing this and hurray to Linux for letting them, right?

    --
    Pretty good is actually pretty bad.
  14. Re:And still linux sucks by jones_supa · · Score: 4, Informative

    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.

  15. Re:And still linux sucks by geekmux · · Score: 4, Insightful

    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...

  16. Re:And still linux sucks by Wootery · · Score: 4, Insightful

    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.

  17. Re:And still linux sucks by jones_supa · · Score: 3, Interesting

    Actually the hardware support is quite good already. I agree with your other points though: Linux world is a mess with parts missing, lots of bugs, and lacking quality assurance.

  18. Re:Valve competing with Microsoft by Charliemopps · · Score: 5, Insightful

    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.

  19. GLES 2.0 and OpenCL... by carlhaagen · · Score: 4, Informative

    ...both have functionality for accessing (and saving) a compiled shader so that it can be loaded and used instantly on next run.

  20. Re:And still linux sucks by crossmr · · Score: 3, Insightful

    Because linux isn't a cohesive platform. That's the problem. As I was googling around one of the staff at adobe mentioned last year that Linux lacked standardized APIs on a forum thread regarding photoshop on Linux.

    There is a perception that Linux is a bit like the wild west and in this day and age when you have stable mature platforms like Mac and Windows available, that's risky for developers. Even for big companies.

    The intrinsic connection they have is market share and having already been the platform for this programs for a long time. Linux needs to really step up and say "Hey we're ready look at us" but they haven't had that moment yet.

    Ubuntu is a step in the right direction. If a company with real money can get behind it and drive it to some kind of consumer ready level like Windows or Mac is, enthusiasts can still sit there and fork and tweak and do as they like, but getting a real ready version there that gets people's attention and wants to make people use it and develop for it is what will drive Linux's success.

    It might not be directly Linux's fault that Microsoft doesn't make office for Linux, but they just got office for IOS not that long ago. Who knows what kind of wrangling that took. But if I was someone like Canonical I'd see just how much money it would take to convince Microsoft to make it for linux and make that happen. I'd do the same with programs like Photoshop, and other major programs that have major user bases that are seen as core apps. Valve already seems like they're moving in the direction of taking care of games so I'd make sure I was meeting with them and getting everyone on the same page. They don't have to arrange all the programs. If they do a few core programs that reach a large percentage of the user base, the other programs will start to get ported to linux as user base picks up. For example if they paid to get photoshop and office ported and linux went from the low single digits its sitting around now on the desktop up to 20% or a little higher I think you'd see companies start to take notice and start to focus a little more on it.

  21. Re:And still linux sucks by mrchaotica · · Score: 5, Insightful

    I don't know what API Playstation games require.

    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

  22. Great work from Valve. by nimbius · · Score: 3, Interesting

    Im also hoping they deprecate the libraries in Team Fortress 2 that are patent encumbered before someone hauls them into a texas court. W have perfectly reasonable alternatives to S3TC.
    Installation and posix portability are also on my wishlist but thats sort of offtopic and not likely to happen without a bit of ecosystem backlash..

    --
    Good people go to bed earlier.
  23. Re: And still linux sucks. by king+neckbeard · · Score: 3, Insightful

    Yes, there are some dickheads in charge of major Linux projects that refuse to do things users want. There are also dickheads in charge of major Microsoft proejct that refuse to do things users want. Same with Apple, Adobe, Oracle, and many other companies.

    and no, it's not only used by cultists. It's used by smartphones, GPS, DVRs, servers, supercomputers, and other places. The desktop is more of an exception than a rule, but the desktop is the place where the OS is more visible.

    --
    This is my signature. There are many like it, but this one is mine.
  24. Re:And still linux sucks by slack_justyb · · Score: 3, Informative

    You are smoking crack. The reason is because non-open drivers have had this implemented since word "go". That's what people wanted to use. Hence, the whole supply/demand thing kicking in. That someone is doing it in the open-source drivers means that they aren't getting the love they expected from the third party, and suddenly there is a business interest in having better support in the open driver.

    To draw a parallel, would you use the default drivers that come "out of box" on a fresh install on Microsoft Windows whatever, or would you actually go to the vendor's website and download their specific drivers? I think we're done here.

  25. Nvidia's been doing this for a while on Linux by dkegel · · Score: 5, Informative

    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... )