anv: Simplify subgroup_size_type rules for compute shaders

The populate_base_prog_key will set VARYING depending if the pipeline
flag is used.  Later, when full subgroups flag is set, it will flip to
UNIFORM -- which for compute shaders is effectively the same, so don't
bother setting it again.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12946>
This commit is contained in:
Caio Marcelo de Oliveira Filho 2021-09-16 17:52:38 -07:00 committed by Marge Bot
parent ca0f892191
commit 9add809e7f
1 changed files with 7 additions and 10 deletions

View File

@ -567,18 +567,15 @@ populate_cs_prog_key(const struct intel_device_info *devinfo,
rss_info->requiredSubgroupSize == 16 ||
rss_info->requiredSubgroupSize == 32);
key->base.subgroup_size_type = rss_info->requiredSubgroupSize;
} else if (flags & VK_PIPELINE_SHADER_STAGE_CREATE_REQUIRE_FULL_SUBGROUPS_BIT_EXT) {
} else if (flags & VK_PIPELINE_SHADER_STAGE_CREATE_REQUIRE_FULL_SUBGROUPS_BIT_EXT &&
!(flags & VK_PIPELINE_SHADER_STAGE_CREATE_ALLOW_VARYING_SUBGROUP_SIZE_BIT_EXT)) {
/* If the client expressly requests full subgroups and they don't
* specify a subgroup size, we need to pick one. If they're requested
* varying subgroup sizes, we set it to UNIFORM and let the back-end
* compiler pick. Otherwise, we specify the API value of 32.
* Performance will likely be terrible in this case but there's nothing
* we can do about that. The client should have chosen a size.
* specify a subgroup size neither allow varying subgroups, we need to
* pick one. So we specify the API value of 32. Performance will
* likely be terrible in this case but there's nothing we can do about
* that. The client should have chosen a size.
*/
if (flags & VK_PIPELINE_SHADER_STAGE_CREATE_ALLOW_VARYING_SUBGROUP_SIZE_BIT_EXT)
key->base.subgroup_size_type = BRW_SUBGROUP_SIZE_UNIFORM;
else
key->base.subgroup_size_type = BRW_SUBGROUP_SIZE_REQUIRE_32;
key->base.subgroup_size_type = BRW_SUBGROUP_SIZE_REQUIRE_32;
}
}