<?xml version="1.0" standalone="yes"?>
<!--

============================================
Application bugs worked around in this file:
============================================

-->

<!DOCTYPE driconf [
   <!ELEMENT driconf      (device+)>
   <!ELEMENT device       (application | engine)+>
   <!ATTLIST device       driver CDATA #IMPLIED
                          device CDATA #IMPLIED>
   <!ELEMENT application  (option+)>
   <!ATTLIST application  name CDATA #REQUIRED
                          executable CDATA #IMPLIED
                          executable_regexp CDATA #IMPLIED
                          sha1 CDATA #IMPLIED
                          application_name_match CDATA #IMPLIED
                          application_versions CDATA #IMPLIED>
   <!ELEMENT engine       (option+)>

   <!-- engine_name_match: A regexp matching the engine name -->
   <!-- engine_versions: A version in range format
             (version 1 to 4 : "1:4") -->

   <!ATTLIST engine       engine_name_match CDATA #REQUIRED
                          engine_versions CDATA #IMPLIED>

   <!ELEMENT option       EMPTY>
   <!ATTLIST option       name CDATA #REQUIRED
                          value CDATA #REQUIRED>
]>

<!-- NOTE: `executable` shouldn't be used for shader based drirc workarounds
     because they aren't applied when replaying with Fossilize for precompilation. -->
<driconf>
    <device driver="radv">
        <!-- Engine workarounds -->
        <engine engine_name_match="vkd3d">
            <option name="radv_zero_vram" value="true" />
            <option name="radv_disable_aniso_single_level" value="true" />
            <option name="radv_disable_trunc_coord" value="true" />
            <option name="radv_dgc" value="true" />
        </engine>

        <engine engine_name_match="DXVK">
            <option name="radv_disable_aniso_single_level" value="true" />
            <option name="radv_disable_trunc_coord" value="true" />
        </engine>

        <engine engine_name_match="mesa zink">
            <option name="radv_disable_aniso_single_level" value="true" />
        </engine>

        <engine engine_name_match="Quantic Dream Engine">
            <option name="radv_zero_vram" value="true" />
            <option name="radv_disable_tc_compat_htile_general" value="true" />
            <option name="radv_app_layer" value="quanticdream" />
        </engine>

        <engine engine_name_match="^UnrealEngine"> <!-- UE4/5 Vulkan RHI -->
            <option name="radv_flush_before_query_copy" value="true" />
            <option name="radv_flush_before_timestamp_write" value="true" />
            <option name="radv_zero_vram" value="true" />
        </engine>

        <engine engine_name_match="DXVK_NvRemix">
            <option name="radv_tex_non_uniform" value="true" />
        </engine>

        <!-- Game workarounds -->
        <application name="Shadow Of The Tomb Raider (Native)" application_name_match="ShadowOfTheTomb">
            <option name="radv_report_llvm9_version_string" value="true" />
            <option name="radv_invariant_geom" value="true" />
        </application>

        <application name="Shadow Of The Tomb Raider (DX11/DX12)" application_name_match="SOTTR.exe">
            <!-- DXVK and vkd3d-proton both enable invariant position but it's
                 disabled for SotTR because it breaks NV more than it helps -->
            <option name="radv_invariant_geom" value="true" />
            <option name="radv_split_fma" value="true" />
        </application>

        <application name="RAGE 2" application_name_match="Rage 2">
            <option name="radv_enable_mrt_output_nan_fixup" value="true" />
            <option name="radv_app_layer" value="rage2" />
            <option name="radv_zero_vram" value="true" />
        </application>

        <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 (and World War Z: Aftermath)" application_name_match="WWZ|wwz">
            <option name="radv_override_uniform_offset_alignment" value="16" />
            <option name="radv_disable_shrink_image_store" value="true" />
            <option name="radv_invariant_geom" value="true" />
            <option name="dual_color_blend_by_location" value="true" />
        </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" />
            <option name="radv_legacy_sparse_binding" value="true" />
        </application>

        <application name="DOOM (2016)" application_name_match="DOOM$">
            <option name="radv_disable_dcc" value="true" />
        </application>

        <application name="Wolfenstein II" application_name_match="Wolfenstein II The New Colossus">
            <option name="radv_disable_dcc" value="true" />
        </application>

        <application name="Grid Autosport" application_name_match="GRIDAutosport_avx.exe">
            <option name="radv_disable_sinking_load_input_fs" value="true" />
        </application>

        <application name="Grid Autosport" application_name_match="GRIDAutosport.exe">
            <option name="radv_disable_sinking_load_input_fs" value="true" />
        </application>

        <application name="Hammerting" application_name_match="TDTD">
            <option name="radv_zero_vram" value="true" />
        </application>

        <application name="RDR2" application_name_match="Red Dead Redemption 2">
            <option name="radv_enable_unified_heap_on_apu" value="true" />
            <option name="radv_zero_vram" value="true" />
            <!-- Disable DCC for mips to workaround rendering issues because
                 the game aliases two images incorrectly. -->
            <option name="radv_disable_dcc_mips" value="true" />
        </application>

        <application name="Metro Exodus (Linux native)" application_name_match="metroexodus">
            <option name="radv_app_layer" value="metroexodus" />
        </application>

        <application name="Hellblade: Senua's Sacrifice" application_name_match="HellbladeGame-Win64-Shipping.exe">
            <!-- RT shaders in Hellblade: Senua's Sacrifice cause misrenders because they assume full subgroups.
                 This is only guaranteed with wave64, so force wave64 on for this game. -->
            <option name="radv_rt_wave64" value="true" />
        </application>

        <application name="War Thunder" application_name_match="WarThunder">
            <option name="radv_invariant_geom" value="true"/>
        </application>

        <application name="Crysis 2 Remastered" application_name_match="Crysis2Remastered.exe">
            <option name="radv_ssbo_non_uniform" value="true" />
        </application>

        <application name="Crysis 3 Remastered" application_name_match="Crysis3Remastered.exe">
            <option name="radv_ssbo_non_uniform" value="true" />
        </application>

        <application name="Persona 3 Reload" application_name_match="P3R.exe">
            <option name="radv_disable_ngg_gs" value="true" />
        </application>

        <application name="Helldivers 2" executable="helldivers2.exe">
            <option name="radv_force_pstate_peak_gfx11_dgpu" value="true" />
        </application>

        <!-- OpenGL Game workarounds (zink) -->
        <application name="Black Geyser: Couriers of Darkness" executable="BlackGeyser.x86_64">
            <option name="radv_zero_vram" value="true" />
        </application>

        <!-- https://gitlab.freedesktop.org/mesa/mesa/-/issues/2686 -->
        <application name="7 Days to Die" executable="7DaysToDie.x86_64">
            <option name="radv_zero_vram" value="true" />
        </application>
        <application name="7 Days to Die" executable="7DaysToDie.x86">
            <option name="radv_zero_vram" value="true" />
        </application>

        <application name="Monolith demo5" executable="runner" sha1="0c40d509a74e357f0280cb1bd882e9cd94b91bdf">
            <option name="radv_zero_vram" value="true" />
        </application>

        <application name="American Truck Simulator" executable="amtrucks">
            <option name="radv_zero_vram" value="true" />
        </application>

        <application name="Counter-Strike Global Offensive" executable="csgo_linux64">
            <option name="radv_zero_vram" value="true" />
        </application>

        <application name="Exanima" executable="Exanima.exe">
            <option name="radv_zero_vram" value="true"/>
        </application>

        <application name="Rocket League" executable="RocketLeague">
            <option name="radv_zero_vram" value="true" />
        </application>
        <application name="Crystal Project" executable="Crystal Project.bin.x86_64">
            <option name="radv_zero_vram" value="true" />
        </application>

        <application name="Half-Life Alyx" application_name_match="hlvr">
            <option name="dual_color_blend_by_location" value="true" />
        </application>

        <application name="Enshrouded" executable="enshrouded.exe">
            <option name="radv_zero_vram" value="true"/>
        </application>

        <!-- If storage features for depth formats are advertised, the Game chooses a code path
             for Terrain height map initialization that has countless bugs:
             https://gitlab.freedesktop.org/mesa/mesa/-/issues/11265 -->
        <application name="Total War: WARHAMMER III" application_name_match="TotalWarhammer3">
            <option name="radv_disable_depth_storage" value="true"/>
        </application>
    </device>
</driconf>
