anv: Add control over divergent atomics fusion opt via driconf

anv_enable_opt_divergent_atomics dricong option supported values:
   1 - fuse buffer divergent atomics
   2 - fuse image divergent atomics

Enabled for titles:
   Total War: WARHAMMER III
   The Elder Scrolls IV: Oblivion Remastered
   Call of Duty: Black Ops III

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40631>
This commit is contained in:
Arkady Shlykov 2026-04-02 13:30:34 +00:00 committed by Marge Bot
parent 7f7ba20cca
commit b1d379eeba
5 changed files with 19 additions and 0 deletions

View file

@ -40,6 +40,7 @@ static const driOptionDescription anv_dri_options[] = {
DRI_CONF_ANV_QUERY_COPY_WITH_SHADER_THRESHOLD(6)
DRI_CONF_ANV_FORCE_INDIRECT_DESCRIPTORS(false)
DRI_CONF_ANV_DISABLE_LINK_TIME_OPTIMIZATION(false)
DRI_CONF_ANV_ENABLE_OPT_DIVERGENT_ATOMICS(0)
DRI_CONF_SHADER_SPILLING_RATE(11)
DRI_CONFIG_INTEL_FORCE_COMPUTE_SURFACE_PREFETCH(true)
DRI_CONFIG_INTEL_FORCE_SAMPLER_PREFETCH(false)
@ -268,6 +269,8 @@ anv_init_dri_options(struct anv_instance *instance)
instance->disable_lto =
driQueryOptionb(&instance->dri_options, "anv_disable_link_time_optimization");
instance->enable_opt_divergent_atomics =
driQueryOptioni(&instance->dri_options, "anv_enable_opt_divergent_atomics");
instance->stack_ids = driQueryOptioni(&instance->dri_options, "intel_stack_id");
switch (instance->stack_ids) {

View file

@ -1848,6 +1848,7 @@ struct anv_instance {
* Performance workarounds
*/
bool disable_lto;
enum brw_divergent_atomics_flags enable_opt_divergent_atomics;
/**
* Ray tracing configuration.

View file

@ -293,6 +293,7 @@ populate_base_prog_key(struct brw_base_prog_key *key,
*/
if (rs != NULL)
key->robust_flags = anv_get_robust_flags(rs);
key->divergent_atomics_flags = pdevice->instance->enable_opt_divergent_atomics;
key->limit_trig_input_range = pdevice->instance->limit_trig_input_range;
}

View file

@ -1131,6 +1131,16 @@ TODO: document the other workarounds.
</application>
<application name="Total War: WARHAMMER III" executable="TotalWarhammer3">
<option name="anv_fake_nonlocal_memory" value="true" />
<option name="anv_enable_opt_divergent_atomics" value="1" />
</application>
<application name="Total War: WARHAMMER III" executable="Warhammer3.exe">
<option name="anv_enable_opt_divergent_atomics" value="1" />
</application>
<application name="The Elder Scrolls IV: Oblivion Remastered" executable="OblivionRemastered-Win.exe">
<option name="anv_enable_opt_divergent_atomics" value="1" />
</application>
<application name="Call of Duty: Black Ops III" executable="BlackOps3.exe">
<option name="anv_enable_opt_divergent_atomics" value="1" />
</application>
<application name="Horizon Forbidden West" executable="HorizonForbiddenWest.exe">
<!-- Missing barrier between clear/init shader & write

View file

@ -976,6 +976,10 @@
DRI_CONF_OPT_B(anv_barrier_post_typed_clear_shader, def, \
"Insert pipeline barriers post clearing shader on typed data")
#define DRI_CONF_ANV_ENABLE_OPT_DIVERGENT_ATOMICS(def) \
DRI_CONF_OPT_I(anv_enable_opt_divergent_atomics, def, 0, 3,\
"Enable fusion of divergent atomics (see brw_divergent_atomics_flags)")
/**
* \brief HASVK specific configuration options
*/