anv: disable CCS for Source2 games on Xe2

Dota 2 and Counter-Strike 2 really want to be able to allocate memory
for both VkImages and VkBuffers from the same memory type. Xe2's
special compression-only memory type does not support buffers, which
makes these games crash. Disable CCS on these games as a workaround.

This is a temporary workaround as we're still working towards a
long-term solution (either by fixing the engine or finding a way
better expose our memory types).

Backport-to: 24.2
Fixes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11520
Fixes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11521
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Jianxun Zhang <jianxun.zhang@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30481>
This commit is contained in:
Paulo Zanoni
2024-08-01 15:17:27 -07:00
committed by Marge Bot
parent b4f5a04223
commit 644dcc0337
5 changed files with 17 additions and 0 deletions

View File

@@ -16,6 +16,7 @@ static const driOptionDescription anv_dri_options[] = {
DRI_CONF_VK_XWAYLAND_WAIT_READY(false)
DRI_CONF_ANV_ASSUME_FULL_SUBGROUPS(0)
DRI_CONF_ANV_DISABLE_FCV(false)
DRI_CONF_ANV_DISABLE_XE2_CCS(false)
DRI_CONF_ANV_EXTERNAL_MEMORY_IMPLICIT_SYNC(true)
DRI_CONF_ANV_FORCE_GUC_LOW_LATENCY(false)
DRI_CONF_ANV_SAMPLE_MASK_OUT_OPENGL_BEHAVIOUR(false)
@@ -166,6 +167,8 @@ anv_init_dri_options(struct anv_instance *instance)
instance->enable_tbimr = driQueryOptionb(&instance->dri_options, "intel_tbimr");
instance->disable_fcv =
driQueryOptionb(&instance->dri_options, "anv_disable_fcv");
instance->disable_xe2_ccs =
driQueryOptionb(&instance->dri_options, "anv_disable_xe2_ccs");
instance->external_memory_implicit_sync =
driQueryOptionb(&instance->dri_options, "anv_external_memory_implicit_sync");
instance->compression_control_enabled =

View File

@@ -2250,6 +2250,9 @@ anv_physical_device_try_create(struct vk_instance *vk_instance,
goto fail_fd;
}
if (devinfo.ver == 20 && instance->disable_xe2_ccs)
intel_debug |= DEBUG_NO_CCS;
/* Disable Wa_16013994831 on Gfx12.0 because we found other cases where we
* need to always disable preemption :
* - https://gitlab.freedesktop.org/mesa/mesa/-/issues/5963

View File

@@ -1299,6 +1299,7 @@ struct anv_instance {
unsigned force_vk_vendor;
bool has_fake_sparse;
bool disable_fcv;
bool disable_xe2_ccs;
bool compression_control_enabled;
bool anv_fake_nonlocal_memory;

View File

@@ -1251,6 +1251,12 @@ TODO: document the other workarounds.
<application name="Total War: WARHAMMER III" executable="TotalWarhammer3">
<option name="anv_fake_nonlocal_memory" value="true" />
</application>
<!-- Source2 games seem confused by the CCS-only memory type, so
temporarily disable CCS. More details on the issue:
https://gitlab.freedesktop.org/mesa/mesa/-/issues/11520 -->
<engine engine_name_match="Source2">
<option name="anv_disable_xe2_ccs" value="true" />
</engine>
<!--
Disable 16-bit feature on zink and angle so that GLES mediump doesn't
lower to our inefficent 16-bit shader support. No need to do so for

View File

@@ -784,6 +784,10 @@
DRI_CONF_OPT_B(anv_disable_fcv, def, \
"Disable FCV optimization")
#define DRI_CONF_ANV_DISABLE_XE2_CCS(def) \
DRI_CONF_OPT_B(anv_disable_xe2_ccs, def, \
"Disable CCS optimization on Xe2")
#define DRI_CONF_ANV_EXTERNAL_MEMORY_IMPLICIT_SYNC(def) \
DRI_CONF_OPT_B(anv_external_memory_implicit_sync, def, "Implicit sync on external BOs")