RADV Adds Knobs To Force Shader Re-Compilation - Helping Games On The Steam Deck

Written by Michael Larabel in Valve on 13 November 2023 at 06:53 AM EST. 19 Comments
VALVE
Valve's Steam Deck is a heavy user of relying on pre-compiled shaders to yield quicker start times and a more efficient handheld gaming experience. But in cases where bugs happen and a shader compiler fix needs to be back-ported, there isn't a straight-forward means of properly handling that for the Steam Deck. But with new knobs being added to the Mesa RADV driver code, there will be some options for better dealing with this moving forward.

In cases where wanting to force RADV shaders to be re-compiled, namely for back-porting fixes and the like, there are some new DRIRC options added to Mesa 24.0-devel to easily force the re-compilation that can be targeted at specific games.

Steam Deck running F1 game


Prolific RADV contributor Samuel Pitoiset of Valve's Linux graphics driver team added the new DRIRC options for making it easier to force shader re-compilation for specific game(s) shaders when needed. He explained in the code merge that hit Mesa Git this morning:
radv: add drirc options to force re-compilation of shaders when needed

On Steam Deck, shaders are pre-compiled for better performance (less stuttering, less CPU usage, etc). But when a compiler fix needs to be backported, there is currently no way to handle this properly.

This introduces 3 drirc options radv_override_{graphics,compute,ray_tracing}_shader_version in order to force the driver to re-compile pipelines when needed. By default, the shader version is 0 for all pipelines.

When one drirc is set for a specific game, RADV will re-compile all pipelines only once with the compiler fix included (because the pipeline key would be different).

A nice, straight-forward improvement for RADV to better deal with shader issues on a per-game basis. This change will presumably be back-ported for SteamOS and be working its way to Steam Deck devices shortly. This is a change that is also beneficial to the Linux desktop/gaming at large.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week