Nvidia has confirmed a driver bug resulting in a loss of performance on Linux
gamingonlinux.com
gamingonlinux.com
https://bugzilla.mozilla.org/show_bug.cgi?id=1382358 https://bugs.gentoo.org/639250
The complexity of modern computing is truly terrifying.
Basically, here's what happens:
* Each game comes with a bunch of shaders, which are written in some low-level language and compiled to bytecode which is compiled for the specific graphics card on your machine at runtime by the driver.
* For commercially important games, Nvidia will have someone manually tune the shaders for best performance on Nvidia's architecture.
* When a driver supporting that game is released, the driver has copies of those tuned shaders, and when it's asked to compile a shader it has a tuned copy of, instead of compiling it it just emits the copy of the shader that it came with.
As for game-specific optimizations, I spent 5 years on the DirectX team writing those. I see those as part of the value-add of a HW vendor personally. But to your point, I also occasionally spent a week or 2 embedded with game developers to incorporate those optimizations into game engines with mixed results. When game developers refused to do so because reasons(tm), we occasionally overrode their intent within the driver because our reasons(tm). Old timers (2003-2005) might remember NVIDIA getting called out for this by HW web sites when the shader compilers could not come close to hand-optimized code. I never understood the fuss myself and I try not to work with the sorts who agreed with it. Life is just too short.
Part of the reason for this is that it's so incredibly difficult to get to the "happy path" of a GPU when writing graphics code. (at least, with more complicated APIs. I think the newer things like DirectX 12 or Vulkan provide a much lower-level set of primitives to allow the developer to get to that happy path much easier, rather than doing 5 incantations in a magic circle to get there) The underlying state machine and code for a driver is incredibly complicated, and the only people who know how it really works and can view code at all levels of the software are the employees of the graphics card vendor. So they're the only ones who can truly squeeze every ounce out of the hardware/software.