radv: implement Vulkan 1.1 features and properties
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 26 Nov 2019 07:13:14 +0000 (08:13 +0100)
committerJason Ekstrand <jason@jlekstrand.net>
Wed, 15 Jan 2020 14:42:25 +0000 (08:42 -0600)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_device.c

index 39f83404b79822cb6aa6337deab44044c1362934..7b4ba74c9770c8ec09148a8ba7028975deed5b5c 100644 (file)
@@ -1202,6 +1202,23 @@ void radv_GetPhysicalDeviceFeatures2(
                        features->separateDepthStencilLayouts = true;
                        break;
                }
+               case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_FEATURES: {
+                       VkPhysicalDeviceVulkan11Features *features =
+                               (VkPhysicalDeviceVulkan11Features *)ext;
+                       features->storageBuffer16BitAccess = pdevice->rad_info.chip_class >= GFX8 && !pdevice->use_aco;
+                       features->uniformAndStorageBuffer16BitAccess = pdevice->rad_info.chip_class >= GFX8 && !pdevice->use_aco;
+                       features->storagePushConstant16 = pdevice->rad_info.chip_class >= GFX8 && !pdevice->use_aco;
+                       features->storageInputOutput16 = pdevice->rad_info.chip_class >= GFX8 && !pdevice->use_aco && LLVM_VERSION_MAJOR >= 9;
+                       features->multiview = true;
+                       features->multiviewGeometryShader = true;
+                       features->multiviewTessellationShader = true;
+                       features->variablePointersStorageBuffer = true;
+                       features->variablePointers = true;
+                       features->protectedMemory = false;
+                       features->samplerYcbcrConversion = true;
+                       features->shaderDrawParameters = true;
+                       break;
+               }
                default:
                        break;
                }
@@ -1706,6 +1723,42 @@ void radv_GetPhysicalDeviceProperties2(
                        }
                        break;
                }
+               case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_PROPERTIES: {
+                       VkPhysicalDeviceVulkan11Properties *props =
+                               (VkPhysicalDeviceVulkan11Properties *)ext;
+
+                       memcpy(props->deviceUUID, pdevice->device_uuid, VK_UUID_SIZE);
+                       memcpy(props->driverUUID, pdevice->driver_uuid, VK_UUID_SIZE);
+                       memset(props->deviceLUID, 0, VK_LUID_SIZE);
+                       /* The LUID is for Windows. */
+                       props->deviceLUIDValid = false;
+                       props->deviceNodeMask = 0;
+                       {
+                               props->subgroupSize = RADV_SUBGROUP_SIZE;
+                               props->subgroupSupportedStages = VK_SHADER_STAGE_ALL;
+                               props->subgroupSupportedOperations =
+                                                       VK_SUBGROUP_FEATURE_BASIC_BIT |
+                                                       VK_SUBGROUP_FEATURE_VOTE_BIT |
+                                                       VK_SUBGROUP_FEATURE_ARITHMETIC_BIT |
+                                                       VK_SUBGROUP_FEATURE_BALLOT_BIT |
+                                                       VK_SUBGROUP_FEATURE_CLUSTERED_BIT |
+                                                       VK_SUBGROUP_FEATURE_QUAD_BIT;
+                               if (pdevice->rad_info.chip_class == GFX8 ||
+                                   pdevice->rad_info.chip_class == GFX9) {
+                                       props->subgroupSupportedOperations |=
+                                                                       VK_SUBGROUP_FEATURE_SHUFFLE_BIT |
+                                                                       VK_SUBGROUP_FEATURE_SHUFFLE_RELATIVE_BIT;
+                               }
+                               props->subgroupQuadOperationsInAllStages = true;
+                       }
+                       props->pointClippingBehavior = VK_POINT_CLIPPING_BEHAVIOR_ALL_CLIP_PLANES;
+                       props->maxMultiviewViewCount = MAX_VIEWS;
+                       props->maxMultiviewInstanceIndex = INT_MAX;
+                       props->protectedNoFault = false;
+                       props->maxPerSetDescriptors = RADV_MAX_PER_SET_DESCRIPTORS;
+                       props->maxMemoryAllocationSize = RADV_MAX_MEMORY_ALLOCATION_SIZE;
+                       break;
+               }
                default:
                        break;
                }