mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 11:48:06 +02:00
radv: move all game workarounds to drirc
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10978>
This commit is contained in:
parent
25a6c35bbc
commit
b9ff51f750
2 changed files with 50 additions and 77 deletions
|
|
@ -825,82 +825,6 @@ radv_get_perftest_option_name(int id)
|
|||
return radv_perftest_options[id].string;
|
||||
}
|
||||
|
||||
static void
|
||||
radv_handle_per_app_options(struct radv_instance *instance, const VkApplicationInfo *info)
|
||||
{
|
||||
const char *name = info ? info->pApplicationName : NULL;
|
||||
const char *engine_name = info ? info->pEngineName : NULL;
|
||||
|
||||
if (name) {
|
||||
if (!strcmp(name, "DOOM_VFR")) {
|
||||
/* Work around a Doom VFR game bug */
|
||||
instance->debug_flags |= RADV_DEBUG_NO_DYNAMIC_BOUNDS;
|
||||
} else if (!strcmp(name, "Fledge")) {
|
||||
/*
|
||||
* Zero VRAM for "The Surge 2"
|
||||
*
|
||||
* This avoid a hang when when rendering any level. Likely
|
||||
* uninitialized data in an indirect draw.
|
||||
*/
|
||||
instance->debug_flags |= RADV_DEBUG_ZERO_VRAM;
|
||||
} else if (!strcmp(name, "No Man's Sky")) {
|
||||
/* Work around a NMS game bug */
|
||||
instance->debug_flags |= RADV_DEBUG_DISCARD_TO_DEMOTE;
|
||||
} else if (!strcmp(name, "DOOMEternal")) {
|
||||
/* Zero VRAM for Doom Eternal to fix rendering issues. */
|
||||
instance->debug_flags |= RADV_DEBUG_ZERO_VRAM;
|
||||
} else if (!strcmp(name, "ShadowOfTheTomb")) {
|
||||
/* Work around flickering foliage for native Shadow of the Tomb Raider
|
||||
* on GFX10.3 */
|
||||
instance->debug_flags |= RADV_DEBUG_INVARIANT_GEOM;
|
||||
}
|
||||
}
|
||||
|
||||
if (engine_name) {
|
||||
if (!strcmp(engine_name, "vkd3d")) {
|
||||
/* Zero VRAM for all VKD3D (DX12->VK) games to fix
|
||||
* rendering issues.
|
||||
*/
|
||||
instance->debug_flags |= RADV_DEBUG_ZERO_VRAM;
|
||||
} else if (!strcmp(engine_name, "Quantic Dream Engine")) {
|
||||
/* Fix various artifacts in Detroit: Become Human */
|
||||
instance->debug_flags |= RADV_DEBUG_ZERO_VRAM | RADV_DEBUG_DISCARD_TO_DEMOTE;
|
||||
|
||||
/* Fix rendering issues in Detroit: Become Human
|
||||
* because the game uses render loops (it
|
||||
* samples/renders from/to the same depth/stencil
|
||||
* texture inside the same draw) without input
|
||||
* attachments and that is invalid Vulkan usage.
|
||||
*/
|
||||
instance->disable_tc_compat_htile_in_general = true;
|
||||
}
|
||||
}
|
||||
|
||||
instance->enable_mrt_output_nan_fixup =
|
||||
driQueryOptionb(&instance->dri_options, "radv_enable_mrt_output_nan_fixup");
|
||||
|
||||
instance->disable_shrink_image_store =
|
||||
driQueryOptionb(&instance->dri_options, "radv_disable_shrink_image_store");
|
||||
|
||||
instance->absolute_depth_bias =
|
||||
driQueryOptionb(&instance->dri_options, "radv_absolute_depth_bias");
|
||||
|
||||
instance->disable_tc_compat_htile_in_general =
|
||||
driQueryOptionb(&instance->dri_options, "radv_disable_tc_compat_htile_general");
|
||||
|
||||
if (driQueryOptionb(&instance->dri_options, "radv_no_dynamic_bounds"))
|
||||
instance->debug_flags |= RADV_DEBUG_NO_DYNAMIC_BOUNDS;
|
||||
|
||||
if (driQueryOptionb(&instance->dri_options, "radv_zero_vram"))
|
||||
instance->debug_flags |= RADV_DEBUG_ZERO_VRAM;
|
||||
|
||||
if (driQueryOptionb(&instance->dri_options, "radv_lower_discard_to_demote"))
|
||||
instance->debug_flags |= RADV_DEBUG_DISCARD_TO_DEMOTE;
|
||||
|
||||
if (driQueryOptionb(&instance->dri_options, "radv_invariant_geom"))
|
||||
instance->debug_flags |= RADV_DEBUG_INVARIANT_GEOM;
|
||||
}
|
||||
|
||||
// clang-format off
|
||||
static const driOptionDescription radv_dri_options[] = {
|
||||
DRI_CONF_SECTION_PERFORMANCE
|
||||
|
|
@ -935,6 +859,30 @@ radv_init_dri_options(struct radv_instance *instance)
|
|||
driParseConfigFiles(&instance->dri_options, &instance->available_dri_options, 0, "radv", NULL,
|
||||
instance->vk.app_info.app_name, instance->vk.app_info.app_version,
|
||||
instance->vk.app_info.engine_name, instance->vk.app_info.engine_version);
|
||||
|
||||
instance->enable_mrt_output_nan_fixup =
|
||||
driQueryOptionb(&instance->dri_options, "radv_enable_mrt_output_nan_fixup");
|
||||
|
||||
instance->disable_shrink_image_store =
|
||||
driQueryOptionb(&instance->dri_options, "radv_disable_shrink_image_store");
|
||||
|
||||
instance->absolute_depth_bias =
|
||||
driQueryOptionb(&instance->dri_options, "radv_absolute_depth_bias");
|
||||
|
||||
instance->disable_tc_compat_htile_in_general =
|
||||
driQueryOptionb(&instance->dri_options, "radv_disable_tc_compat_htile_general");
|
||||
|
||||
if (driQueryOptionb(&instance->dri_options, "radv_no_dynamic_bounds"))
|
||||
instance->debug_flags |= RADV_DEBUG_NO_DYNAMIC_BOUNDS;
|
||||
|
||||
if (driQueryOptionb(&instance->dri_options, "radv_zero_vram"))
|
||||
instance->debug_flags |= RADV_DEBUG_ZERO_VRAM;
|
||||
|
||||
if (driQueryOptionb(&instance->dri_options, "radv_lower_discard_to_demote"))
|
||||
instance->debug_flags |= RADV_DEBUG_DISCARD_TO_DEMOTE;
|
||||
|
||||
if (driQueryOptionb(&instance->dri_options, "radv_invariant_geom"))
|
||||
instance->debug_flags |= RADV_DEBUG_INVARIANT_GEOM;
|
||||
}
|
||||
|
||||
VkResult
|
||||
|
|
@ -972,7 +920,6 @@ radv_CreateInstance(const VkInstanceCreateInfo *pCreateInfo,
|
|||
VG(VALGRIND_CREATE_MEMPOOL(instance, 0, false));
|
||||
|
||||
radv_init_dri_options(instance);
|
||||
radv_handle_per_app_options(instance, pCreateInfo->pApplicationInfo);
|
||||
|
||||
*pInstance = radv_instance_to_handle(instance);
|
||||
|
||||
|
|
|
|||
|
|
@ -743,8 +743,21 @@ TODO: document the other workarounds.
|
|||
</application>
|
||||
</device>
|
||||
<device driver="radv">
|
||||
<!-- Engine workarounds -->
|
||||
<engine engine_name_match="vkd3d">
|
||||
<option name="radv_zero_vram" value="true" />
|
||||
</engine>
|
||||
|
||||
<engine engine_name_match="Quantic Dream Engine">
|
||||
<option name="radv_zero_vram" value="true" />
|
||||
<option name="radv_lower_discard_to_demote" value="true" />
|
||||
<option name="radv_disable_tc_compat_htile_general" value="true" />
|
||||
</engine>
|
||||
|
||||
<!-- Game workarounds -->
|
||||
<application name="Shadow Of The Tomb Raider" application_name_match="ShadowOfTheTomb">
|
||||
<option name="radv_report_llvm9_version_string" value="true" />
|
||||
<option name="radv_invariant_geom" value="true" />
|
||||
</application>
|
||||
|
||||
<application name="RAGE 2" executable="RAGE2.exe">
|
||||
|
|
@ -770,10 +783,23 @@ TODO: document the other workarounds.
|
|||
|
||||
<application name="The Surge 2" application_name_match="Fledge">
|
||||
<option name="radv_disable_shrink_image_store" value="true" />
|
||||
<option name="radv_zero_vram" value="true" />
|
||||
</application>
|
||||
|
||||
<application name="World War Z" application_name_match="WWZ">
|
||||
<option name="radv_override_uniform_offset_alignment" value="16" />
|
||||
</application>
|
||||
|
||||
<application name="DOOM VFR" application_name_match="DOOM_VFR">
|
||||
<option name="radv_no_dynamic_bounds" value="true" />
|
||||
</application>
|
||||
|
||||
<application name="DOOM Eternal" application_name_match="DOOMEternal">
|
||||
<option name="radv_zero_vram" value="true" />
|
||||
</application>
|
||||
|
||||
<application name="No Man's Sky" application_name_match="No Man's Sky">
|
||||
<option name="radv_lower_discard_to_demote" value="true" />
|
||||
</application>
|
||||
</device>
|
||||
</driconf>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue