v3dv: expose more subgroup features on V3D 7.x

The hardware included additional instructions to support more
subgroup features, so let's put them to use.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27211>
This commit is contained in:
Iago Toral Quiroga
2024-01-23 09:01:46 +01:00
committed by Marge Bot
parent 93df9800e8
commit 31e8740808
2 changed files with 18 additions and 7 deletions

View File

@@ -336,12 +336,10 @@ get_features(const struct v3dv_physical_device *physical_device,
.samplerMirrorClampToEdge = true,
/* These are mandatory by Vulkan 1.2, however, we don't support any of
* the optional features affected by them (non 32-bit types for
* shaderSubgroupExtendedTypes and additional subgroup ballot for
* subgroupBroadcastDynamicId), so in practice setting them to true
* doesn't have any implications for us until we implement any of these
* optional features.
/* Extended subgroup types is mandatory by Vulkan 1.2, however, it is
* only in effect if the implementation supports non 32-bit types, which
* we don't, so in practice setting it to true doesn't have any
* implications for us.
*/
.shaderSubgroupExtendedTypes = true,
.subgroupBroadcastDynamicId = true,
@@ -1377,11 +1375,20 @@ v3dv_GetPhysicalDeviceProperties2(VkPhysicalDevice physicalDevice,
snprintf(vk12.driverInfo, VK_MAX_DRIVER_INFO_SIZE,
"Mesa " PACKAGE_VERSION MESA_GIT_SHA1);
VkSubgroupFeatureFlags subgroup_ops = VK_SUBGROUP_FEATURE_BASIC_BIT;
if (pdevice->devinfo.ver >= 71) {
subgroup_ops |= VK_SUBGROUP_FEATURE_BALLOT_BIT |
VK_SUBGROUP_FEATURE_SHUFFLE_BIT |
VK_SUBGROUP_FEATURE_SHUFFLE_RELATIVE_BIT |
VK_SUBGROUP_FEATURE_VOTE_BIT |
VK_SUBGROUP_FEATURE_QUAD_BIT;
}
VkPhysicalDeviceVulkan11Properties vk11 = {
.deviceLUIDValid = false,
.subgroupSize = V3D_CHANNELS,
.subgroupSupportedStages = VK_SHADER_STAGE_COMPUTE_BIT,
.subgroupSupportedOperations = VK_SUBGROUP_FEATURE_BASIC_BIT,
.subgroupSupportedOperations = subgroup_ops,
.subgroupQuadOperationsInAllStages = false,
.pointClippingBehavior = VK_POINT_CLIPPING_BEHAVIOR_ALL_CLIP_PLANES,
.maxMultiviewViewCount = MAX_MULTIVIEW_VIEW_COUNT,

View File

@@ -167,7 +167,11 @@ static const struct spirv_to_nir_options default_spirv_options = {
.multiview = true,
.storage_8bit = true,
.storage_16bit = true,
.subgroup_ballot = true,
.subgroup_basic = true,
.subgroup_quad = true,
.subgroup_shuffle = true,
.subgroup_vote = true,
.variable_pointers = true,
.vk_memory_model = true,
.vk_memory_model_device_scope = true,