Valve Adds RADV "Secure Compile" Support For Pre-Caching Game Shaders
The latest feature contribution by Valve's Linux driver developers to the open-source RADV driver is a "secure compile" feature.
The secure compile feature allows for spawning multiple compile threads on the same system that are secured via SECCOMP filters as the "secure" aspect of this feature for ensuring the threads are just doing their designated shader compilation tasks with no shaders going rogue.
The focus by these Valve developers is allowing software -- most namely, Steam -- to pre-compile large databases of shaders such as collected through their Fossilize program. By pre-compiling the shaders, it can avoid in-game stuttering and help with game load times.
The concept itself isn't new and Valve has worked on OpenGL/Vulkan shader caching/pre-caching and distributing those through Steam to help with stuttering and load times. What's new now in Mesa 19.3 is the "secure" compile functionality via SECCOMP for added safety and exposing a RADV_SECURE_COMPILE_THREADS environment variable for specifying the number of extra threads to spawn for handling this pre-compiling of shaders ahead of time.
The RADV secure compile feature had been open for two months as part of this merge request which overnight was merged for this quarter's Mesa 19.3 stable series.
The secure compile feature allows for spawning multiple compile threads on the same system that are secured via SECCOMP filters as the "secure" aspect of this feature for ensuring the threads are just doing their designated shader compilation tasks with no shaders going rogue.
The focus by these Valve developers is allowing software -- most namely, Steam -- to pre-compile large databases of shaders such as collected through their Fossilize program. By pre-compiling the shaders, it can avoid in-game stuttering and help with game load times.
The concept itself isn't new and Valve has worked on OpenGL/Vulkan shader caching/pre-caching and distributing those through Steam to help with stuttering and load times. What's new now in Mesa 19.3 is the "secure" compile functionality via SECCOMP for added safety and exposing a RADV_SECURE_COMPILE_THREADS environment variable for specifying the number of extra threads to spawn for handling this pre-compiling of shaders ahead of time.
The RADV secure compile feature had been open for two months as part of this merge request which overnight was merged for this quarter's Mesa 19.3 stable series.
4 Comments