3 ms·
The other commenter makes it sound a bit more crazy than it is. "Intercept shaders" sounds super hacky, but in reality, games simply don't ship with compiled sh
by sigmoid10 2y ago
The other commenter makes it sound a bit more crazy than it is. "Intercept shaders" sounds super hacky, but in reality, games simply don't ship with compiled shaders. Instead they are compiled by your driver for your exact hardware. Naturally that allows the compiler to perform more or less aggressive optimisations, similar to how you might be able to optimise CPU programs by shipping C code and only compiling everything on the target machine once you know the exact feature sets.
- crazygringo 2y agoI don't know -- if that other commenter is correct, it does sound pretty crazy. Improving your compiler for everybody's code is one thing. But saying, if the shader that comes in is exactly this code from this specific game, then use this specific precompiled binary, or even just apply these specific hand-tuned optimizations that aren't normally applied, that does seem pretty crazy to me. But I don't know which it is?
- Cieric 2y agoFinger printing based on shaders is quite rare, really most of the time we detect things like the exe name calling us or sometime, very rarely they will give us a better name through an extension. (unreal engine does this automatically). From there all the options are simple, but full shader replacements are one. In the api I work on the shaders have a built in hash value, so that along with the game identified means we know exsactly what shader it is. Most of the replacements aren't complicated though, it's just replacing slow things with faster things for our specific hardware. In the end we are the final compiler so us tweaking things to work better should be expected to a degree.
- chrisjj 2y ago> most of the time we detect things like the exe name calling us What could possibly go wrong? :)
- Benanov 2y agoquack.exe performing noticeably worse in benchmarks on certain cards than quake.exe in the late 90's/early 2000's?
- chrisjj 2y agoYup. Looking at you, ATI.
- magicalhippo 2y agoFor those who don't remember: https://web.archive.org/web/20230819072628/https://techreport.com/review/how-atis-drivers-optimize-quake-iii/ https://web.archive.org/web/20230819072628/https://techrepor...
- macbr 2y agoIn the case of the Minecraft mod Sodium, which replaces much of Minecraft's rendering internals, Nvidia optimisations caused the game to crash. So the mod devs had to implement workarounds to stop the driver from detecting that Minecraft is running... (changing the window title among other things) https://github.com/CaffeineMC/sodium/issues/1486 https://github.com/CaffeineMC/sodium/issues/1486 https://github.com/CaffeineMC/sodium/issues/1816 https://github.com/CaffeineMC/sodium/issues/1816
- immibis 2y agoAnd plain Minecraft did the opposite by adding -XX:JavaHeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump to the command line, when they changed the way the game started so that it wasn't detected as minecraft.exe any more. (Side effect: if you trigger a heap dump, it gets that name)
- chrisjj 2y agoYuuuk.
- Cieric 2y ago
- flohofwoe 2y agoGraphics drivers on Windows definitely do plenty of 'optimizations' for specific game executables, from replacing entire shaders to 'massaging/fixing' 3D-API calls. And AFAIK Proton does things like this too, but for different reasons (fixing games that don't adhere to the D3D API documentation and/or obviously ignored D3D validation layer messages).