mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-27 21:20:12 +01:00
anv: bring back some lost game drirc workarounds for subgroups
Fixes:d39e443ef8(" anv: add infrastructure for common vk_pipeline") Signed-off-by: Tapani Pälli <tapani.palli@intel.com> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> (cherry picked from commitf48df6f45c) Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38268>
This commit is contained in:
parent
86313f9571
commit
3ddddf78b4
2 changed files with 29 additions and 4 deletions
|
|
@ -134,7 +134,7 @@
|
|||
"description": "anv: bring back some lost game drirc workarounds for subgroups",
|
||||
"nominated": true,
|
||||
"nomination_type": 2,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "d39e443ef888ffd9c3385ed4c40e727868626b6b",
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -699,8 +699,10 @@ lookup_ycbcr_conversion(const void *_stage, uint32_t set,
|
|||
}
|
||||
|
||||
static void
|
||||
anv_fixup_subgroup_size(struct anv_instance *instance, struct shader_info *info)
|
||||
anv_fixup_subgroup_size(struct anv_device *device, struct shader_info *info)
|
||||
{
|
||||
const struct anv_instance *instance = device->physical->instance;
|
||||
|
||||
if (!mesa_shader_stage_uses_workgroup(info->stage))
|
||||
return;
|
||||
|
||||
|
|
@ -721,6 +723,29 @@ anv_fixup_subgroup_size(struct anv_instance *instance, struct shader_info *info)
|
|||
info->min_subgroup_size = BRW_SUBGROUP_SIZE;
|
||||
}
|
||||
|
||||
if (instance->assume_full_subgroups_with_barrier &&
|
||||
info->stage == MESA_SHADER_COMPUTE &&
|
||||
device->info->verx10 <= 125 &&
|
||||
info->uses_control_barrier &&
|
||||
info->min_subgroup_size != info->max_subgroup_size &&
|
||||
local_size &&
|
||||
local_size % BRW_SUBGROUP_SIZE == 0) {
|
||||
info->max_subgroup_size = BRW_SUBGROUP_SIZE;
|
||||
info->min_subgroup_size = BRW_SUBGROUP_SIZE;
|
||||
}
|
||||
|
||||
/* Similarly, sometimes games rely on the implicit synchronization of
|
||||
* the shared memory accesses, and choosing smaller subgroups than the game
|
||||
* expects will cause bugs. */
|
||||
if (instance->assume_full_subgroups_with_shared_memory &&
|
||||
info->shared_size > 0 &&
|
||||
info->min_subgroup_size != info->max_subgroup_size &&
|
||||
local_size &&
|
||||
local_size % BRW_SUBGROUP_SIZE == 0) {
|
||||
info->max_subgroup_size = BRW_SUBGROUP_SIZE;
|
||||
info->min_subgroup_size = BRW_SUBGROUP_SIZE;
|
||||
}
|
||||
|
||||
/* Cooperative matrix extension requires that all invocations in a subgroup
|
||||
* be active. As a result, when the application does not request a specific
|
||||
* subgroup size, we must use SIMD32.
|
||||
|
|
@ -1307,7 +1332,7 @@ anv_shader_lower_nir(struct anv_device *device,
|
|||
|
||||
if (nir->info.stage == MESA_SHADER_COMPUTE &&
|
||||
nir->info.cs.has_cooperative_matrix) {
|
||||
anv_fixup_subgroup_size(pdevice->instance, &nir->info);
|
||||
anv_fixup_subgroup_size(device, &nir->info);
|
||||
NIR_PASS(_, nir, brw_nir_lower_cmat, nir->info.api_subgroup_size);
|
||||
NIR_PASS(_, nir, nir_lower_indirect_derefs, nir_var_function_temp, 16);
|
||||
}
|
||||
|
|
@ -1876,7 +1901,7 @@ anv_shader_compile(struct vk_device *vk_device,
|
|||
|
||||
anv_shader_lower_nir(device, mem_ctx, state, shader_data);
|
||||
|
||||
anv_fixup_subgroup_size(device->physical->instance,
|
||||
anv_fixup_subgroup_size(device,
|
||||
&shader_data->info->nir->info);
|
||||
|
||||
anv_nir_apply_shader_workarounds(shader_data->info->nir);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue