radv: enable subgroup capabilities
authorDaniel Schürmann <daniel.schuermann@campus.tu-berlin.de>
Tue, 6 Mar 2018 14:05:13 +0000 (15:05 +0100)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Fri, 13 Apr 2018 23:03:15 +0000 (01:03 +0200)
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_device.c
src/amd/vulkan/radv_shader.c

index a4a0ea6dd5f0ace88ca0bc19d9e94670e443e2b0..b8313b26ebf1b718973f26e49040874aff0a03d1 100644 (file)
@@ -940,8 +940,14 @@ void radv_GetPhysicalDeviceProperties2(
                            (VkPhysicalDeviceSubgroupProperties*)ext;
                        properties->subgroupSize = 64;
                        properties->supportedStages = VK_SHADER_STAGE_ALL;
-                       properties->supportedOperations = VK_SUBGROUP_FEATURE_BASIC_BIT;
-                       properties->quadOperationsInAllStages = false;
+                       properties->supportedOperations =
+                                                       VK_SUBGROUP_FEATURE_BASIC_BIT |
+                                                       VK_SUBGROUP_FEATURE_BALLOT_BIT |
+                                                       VK_SUBGROUP_FEATURE_QUAD_BIT |
+                                                       VK_SUBGROUP_FEATURE_SHUFFLE_BIT |
+                                                       VK_SUBGROUP_FEATURE_SHUFFLE_RELATIVE_BIT |
+                                                       VK_SUBGROUP_FEATURE_VOTE_BIT;
+                       properties->quadOperationsInAllStages = true;
                        break;
                }
                case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES: {
index eaf24dcdee8bbb77018adbd36fa53a61d7aa37e2..9d49bc02a8185860ec74fc6cede6cf49bb5dacef 100644 (file)
@@ -213,7 +213,11 @@ radv_shader_compile_to_nir(struct radv_device *device,
                                .tessellation = true,
                                .int64 = true,
                                .multiview = true,
+                               .subgroup_ballot = true,
                                .subgroup_basic = true,
+                               .subgroup_quad = true,
+                               .subgroup_shuffle = true,
+                               .subgroup_vote = true,
                                .variable_pointers = true,
                                .gcn_shader = true,
                                .trinary_minmax = true,
@@ -283,7 +287,8 @@ radv_shader_compile_to_nir(struct radv_device *device,
                        .lower_to_scalar = 1,
                        .lower_subgroup_masks = 1,
                        .lower_shuffle = 1,
-                       .lower_quad =  1,
+                       .lower_shuffle_to_32bit = 1,
+                       .lower_vote_eq_to_ballot = 1,
                });
 
        radv_optimize_nir(nir);