drirc/anv: add flag to disable VK_EXT_subgroup_size_control

This can be used to workaround problem cases with application
controlled subgroup size.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
(cherry picked from commit c105366165)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41268>
This commit is contained in:
Tapani Pälli 2026-04-07 07:54:39 +03:00 committed by Eric Engestrom
parent b32eb09817
commit e65c1667e7
5 changed files with 13 additions and 3 deletions

View file

@ -2374,7 +2374,7 @@
"description": "drirc/anv: add flag to disable VK_EXT_subgroup_size_control",
"nominated": false,
"nomination_type": 0,
"resolution": 4,
"resolution": 1,
"main_sha": null,
"because_sha": null,
"notes": null

View file

@ -41,6 +41,7 @@ static const driOptionDescription anv_dri_options[] = {
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_ANV_BRW_DISABLE_SUBGROUP_SIZE_CONTROL(false)
DRI_CONF_SHADER_SPILLING_RATE(11)
DRI_CONFIG_INTEL_FORCE_COMPUTE_SURFACE_PREFETCH(true)
DRI_CONFIG_INTEL_FORCE_SAMPLER_PREFETCH(false)

View file

@ -375,7 +375,7 @@ get_device_extensions(const struct anv_physical_device *device,
.EXT_shader_subgroup_vote = true,
.EXT_shader_viewport_index_layer = true,
.EXT_shader_uniform_buffer_unsized_array = true,
.EXT_subgroup_size_control = true,
.EXT_subgroup_size_control = !device->brw_disable_subgroup_size_control,
#ifdef ANV_USE_WSI_PLATFORM
.EXT_swapchain_maintenance1 = true,
#endif
@ -2774,6 +2774,10 @@ anv_physical_device_try_create(struct vk_instance *vk_instance,
}
device->disable_fcv = device->info.verx10 >= 125 ||
instance->disable_fcv;
device->brw_disable_subgroup_size_control =
!intel_use_jay(&device->info, MESA_SHADER_COMPUTE) &&
driQueryOptionb(&device->instance->dri_options,
"anv_brw_disable_subgroup_size_control");
result = anv_physical_device_init_heaps(device, fd);
if (result != VK_SUCCESS)

View file

@ -1558,7 +1558,8 @@ struct anv_physical_device {
bool emu_astc_ldr;
/* true if FCV optimization should be disabled. */
bool disable_fcv;
/**/
/* true if EXT_subgroup_size_control extension should be disabled. */
bool brw_disable_subgroup_size_control;
bool always_flush_cache;

View file

@ -984,6 +984,10 @@
DRI_CONF_OPT_I(anv_enable_opt_divergent_atomics, def, 0, 3,\
"Enable fusion of divergent atomics (see brw_divergent_atomics_flags)")
#define DRI_CONF_ANV_BRW_DISABLE_SUBGROUP_SIZE_CONTROL(def) \
DRI_CONF_OPT_B(anv_brw_disable_subgroup_size_control, def, \
"Disable EXT_subgroup_size_control support when using brw compiler.")
/**
* \brief HASVK specific configuration options
*/