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

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26094>
This commit is contained in:
Samuel Pitoiset
2023-11-07 12:00:02 +01:00
committed by Marge Bot
parent fe159c85de
commit 9b840df9f6
7 changed files with 43 additions and 1 deletions

View File

@@ -152,6 +152,9 @@ static const driOptionDescription radv_dri_options[] = {
DRI_CONF_RADV_FLUSH_BEFORE_TIMESTAMP_WRITE(false)
DRI_CONF_RADV_RT_WAVE64(false)
DRI_CONF_DUAL_COLOR_BLEND_BY_LOCATION(false)
DRI_CONF_RADV_OVERRIDE_GRAPHICS_SHADER_VERSION(0)
DRI_CONF_RADV_OVERRIDE_COMPUTE_SHADER_VERSION(0)
DRI_CONF_RADV_OVERRIDE_RAY_TRACING_SHADER_VERSION(0)
DRI_CONF_RADV_APP_LAYER()
DRI_CONF_SECTION_END
};
@@ -208,6 +211,13 @@ radv_init_dri_options(struct radv_instance *instance)
instance->force_rt_wave64 = driQueryOptionb(&instance->dri_options, "radv_rt_wave64");
instance->dual_color_blend_by_location = driQueryOptionb(&instance->dri_options, "dual_color_blend_by_location");
instance->override_graphics_shader_version =
driQueryOptioni(&instance->dri_options, "radv_override_graphics_shader_version");
instance->override_compute_shader_version =
driQueryOptioni(&instance->dri_options, "radv_override_compute_shader_version");
instance->override_ray_tracing_shader_version =
driQueryOptioni(&instance->dri_options, "radv_override_ray_tracing_shader_version");
}
static const struct vk_instance_extension_table radv_instance_extensions_supported = {