<?xml version="1.0"?>
<driconf>
    <device driver="turnip">
        <!-- Up to DXVK version 2.3.0 -->
        <engine engine_name_match="DXVK" engine_versions="0:8400896">
            <!--
                See: https://github.com/doitsujin/dxvk/issues/3861

                The shader-defined array size is entirely meaningless in D3D.
            -->
            <option name="tu_allow_oob_indirect_ubo_loads" value="true" />
        </engine>
        <engine engine_name_match="DXVK|vkd3d">
            <!--
                DXVK and VKD3D-Proton use customBorderColorWithoutFormat and have most of
                D24S8 images with USAGE_SAMPLED, but never sample it with border color.
            -->
            <option name="tu_enable_fast_border_color_for_undefined_formats" value="true" />
            <!--
                For sampling, Vulkan requires texture coordinates to be truncated, whereas
                D3D requires them to be rounded to nearest even value. The former is used by
                default, the latter is used through this option.
            -->
            <option name="tu_use_tex_coord_round_nearest_even_mode" value="true" />

            <!--
                The hardware algorithm for alpha-to-coverage seems to
                consistently produce bad results compared to other vendors.
                Always enabling emulation would potentially regress performance
                when it is dynamically enabled and off, but both both DXVK and
                vkd3d-proton are known to compile pipelines with
                alpha-to-coverage statically disabled.
            -->
            <option name="tu_emulate_alpha_to_coverage" value="true" />

            <!--
                DX games almost always tend to prefer SYSMEM over GMEM, so we just hardcode
                this for DXVK and VKD3D-Proton.
            -->
            <option name="tu_autotune_algorithm" value="prefer_sysmem" />
        </engine>
	<engine engine_name_match="vkd3d">
	    <option name="tu_enable_softfloat32" value="true" />
	</engine>
        <engine engine_name_match="ANGLE">
            <!--
               ANGLE uses customBorderColorWithoutFormat on D24S8 and doesn't check
               depthStencilSwizzleOneSupport.
               -->
            <option name="tu_enable_d24s8_border_color_workaround" value="true" />
        </engine>
        <!-- Starting from Android 14, framework HWUI requires a second graphics
             queue to avoid racing between webview and skiavk. -->
        <engine engine_name_match="android framework">
            <option name="tu_emulate_second_queue" value="true" />
        </engine>
        <engine engine_name_match="Kex Engine">
            <!-- https://gitlab.freedesktop.org/mesa/mesa/-/issues/5437 -->
            <!-- Older Kex Engine based games that use Vulkan like "Forsaken Remastered",
                 "Doom 64", "STAR WARS: Dark Forces Remaster" mistakingly use DONT_CARE
                 as LOAD_OP. Newer games like "SiN Reloaded" or "The Thing: Remastered"
                 don't have this issue, and they never use DONT_CARE.
                 Unfortunately, Kex Engine doesn't pass its version via pApplicationInfo,
                 so the easiest solution is to set tu_dont_care_as_load for all Kex Engine games.
             -->
            <option name="tu_dont_care_as_load" value="true" />
        </engine>
        <engine engine_name_match="Clausewitz">
            <!-- Clausewitz engine games like "Europa Universalis V", "Crusader Kings III",
                 "Victoria 3" with Vulkan backend have issue where they do indirect OOB reads
                 from UBOs in a vertex shader, leading to infinite loops. All the above games
                 were on Clausewitz engine version 4194304 at the time of testing.
             -->
            <option name="tu_allow_oob_indirect_ubo_loads" value="true" />
        </engine>
        <application name="Sons Of The Forest" application_name_match="SonsOfTheForest.exe">
            <option name="tu_ignore_frag_depth_direction" value="true" />
        </application>
        <application name="Yooka-Laylee" application_name_match="YookaLaylee.x86_64">
            <!--
                A vertex shader performs OOB UBO reads causing vertex corruption.
                Disable UBO to const lowering to force bounds checking which
                fixes the corruption.
            -->
            <option name="tu_allow_oob_indirect_ubo_loads" value="true" />
        </application>
        <application name="Creed: Rise to Glory" application_name_match="Creed-Win64-Shipping.exe">
            <option name="tu_ignore_frag_depth_direction" value="true" />
        </application>
        <application name="Half-Life: Alyx" application_name_match="hlvr">
            <option name="tu_emulate_alpha_to_coverage" value="true" />
        </application>
        <application name='No Man&apos;s Sky' application_name_match='No Man&apos;s Sky'>
            <!-- A lighting CS reducing 8x8 regions with fmin/fmax does a write once per
            subgroup (assuming 64), or collects the results from two subgroups in the
            32 subgroup size case.  Thus, our 128 subgroup size results in vertical banding
            when half the 8x8 regions don't get written.
            -->
            <option name="tu_restrict_subgroup_size_64" value="true" />
        </application>
        <application name="Spilled!" application_name_match="Spilled!.exe">
            <!-- Required for Turnip's GMEM mode running under Unity's Vulkan backend. -->
            <option name="tu_dont_care_as_load" value="true" />
        </application>
        <application name="Marvel's Spider-Man Remastered" application_name_match="Spider-Man.exe">
            <!-- Bad texturing without tu_enable_texel_buffer_emulation -->
            <option name="tu_enable_texel_buffer_emulation" value="true" />
            <!-- From brief testing doesn't require tu_enable_ssbo_emulation -->
        </application>
        <application name="Ratchet and Clank: Rift Apart" application_name_match="RiftApart.exe">
            <!-- Many static object disappear without tu_enable_texel_buffer_emulation -->
            <option name="tu_enable_texel_buffer_emulation" value="true" />
            <!-- All moving objects disappear without tu_enable_ssbo_emulation -->
            <option name="tu_enable_ssbo_emulation" value="true" />
        </application>
        <application name="DOOMEternal" application_name_match="DOOMEternal">
            <!-- All enemies are invisible without tu_enable_ssbo_emulation -->
            <option name="tu_enable_ssbo_emulation" value="true" />
        </application>
    </device>
</driconf>
