radv: workaround games which assume full subgroups if cswave32 is enabled

This assumption becomes incorrect with RADV_PERFTEST=cswave32.

Games include Detroit: Become Human and Doom Eternal.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7918>
This commit is contained in:
Rhys Perry
2020-12-03 17:38:51 +00:00
committed by Marge Bot
parent c73c246e05
commit cacce76db9

View File

@@ -2776,6 +2776,18 @@ radv_fill_shader_keys(struct radv_device *device,
if (!subgroup_size)
subgroup_size = device->physical_device->cs_wave_size;
unsigned local_size = nir[MESA_SHADER_COMPUTE]->info.cs.local_size[0] *
nir[MESA_SHADER_COMPUTE]->info.cs.local_size[1] *
nir[MESA_SHADER_COMPUTE]->info.cs.local_size[2];
/* Games don't always request full subgroups when they should,
* which can cause bugs if cswave32 is enabled.
*/
if (device->physical_device->cs_wave_size == 32 &&
nir[MESA_SHADER_COMPUTE]->info.cs.uses_wide_subgroup_intrinsics &&
!req_subgroup_size && local_size % RADV_SUBGROUP_SIZE == 0)
require_full_subgroups = true;
if (require_full_subgroups && !req_subgroup_size) {
/* don't use wave32 pretending to be wave64 */
subgroup_size = RADV_SUBGROUP_SIZE;