compiler, vk: Support subgroup size of 4

Relax the assert and assign it an enum value

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30876>
This commit is contained in:
Jesse Natalie
2024-08-28 10:17:48 -07:00
committed by Marge Bot
parent 9f88b6025b
commit 03655dfda1
4 changed files with 8 additions and 1 deletions
+1
View File
@@ -1586,6 +1586,7 @@ enum ENUM_PACKED gl_subgroup_size
* also the subgroup size. If any new values are added, they must respect
* this invariant.
*/
SUBGROUP_SIZE_REQUIRE_4 = 4, /**< VK_EXT_subgroup_size_control */
SUBGROUP_SIZE_REQUIRE_8 = 8, /**< VK_EXT_subgroup_size_control */
SUBGROUP_SIZE_REQUIRE_16 = 16, /**< VK_EXT_subgroup_size_control */
SUBGROUP_SIZE_REQUIRE_32 = 32, /**< VK_EXT_subgroup_size_control */
+3
View File
@@ -1911,6 +1911,9 @@ get_subgroup_size(const struct shader_info *info, unsigned max_subgroup_size)
*/
return info->stage == MESA_SHADER_FRAGMENT ? 0 : max_subgroup_size;
case SUBGROUP_SIZE_REQUIRE_4:
unreachable("Unsupported subgroup size type");
case SUBGROUP_SIZE_REQUIRE_8:
case SUBGROUP_SIZE_REQUIRE_16:
case SUBGROUP_SIZE_REQUIRE_32:
+3
View File
@@ -1616,6 +1616,9 @@ get_subgroup_size(const struct shader_info *info, unsigned max_subgroup_size)
*/
return info->stage == MESA_SHADER_FRAGMENT ? 0 : max_subgroup_size;
case SUBGROUP_SIZE_REQUIRE_4:
unreachable("Unsupported subgroup size type");
case SUBGROUP_SIZE_REQUIRE_8:
case SUBGROUP_SIZE_REQUIRE_16:
case SUBGROUP_SIZE_REQUIRE_32:
+1 -1
View File
@@ -110,7 +110,7 @@ vk_get_subgroup_size(uint32_t spirv_version,
uint32_t req_subgroup_size = get_required_subgroup_size(info_pNext);
if (req_subgroup_size > 0) {
assert(util_is_power_of_two_nonzero(req_subgroup_size));
assert(req_subgroup_size >= 8 && req_subgroup_size <= 128);
assert(req_subgroup_size >= 4 && req_subgroup_size <= 128);
return req_subgroup_size;
} else if (allow_varying || spirv_version >= 0x10600) {
/* Starting with SPIR-V 1.6, varying subgroup size the default */