radv: implement VK_EXT_private_data
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 29 Apr 2020 08:19:11 +0000 (10:19 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 13 May 2020 06:23:49 +0000 (08:23 +0200)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4886>

docs/relnotes/new_features.txt
src/amd/vulkan/radv_device.c
src/amd/vulkan/radv_extensions.py

index 9a34a73f821a2afdc23ebde4b47a67a770231d74..857b888ac41decc459432edb1e1c28f638b095ec 100644 (file)
@@ -1,2 +1,2 @@
 GL_ARB_compute_variable_group_size on Iris.
-VK_EXT_private_data on ANV.
+VK_EXT_private_data on ANV and RADV.
index c2a3223ea9620483d308c8ba874194f81e7c9f91..c4440a20b724a0ced0d3836f9152e7834b377c9d 100644 (file)
@@ -1274,6 +1274,12 @@ void radv_GetPhysicalDeviceFeatures2(
                        features->nullDescriptor = true;
                        break;
                }
+               case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES_EXT: {
+                       VkPhysicalDevicePrivateDataFeaturesEXT *features =
+                               (VkPhysicalDevicePrivateDataFeaturesEXT *)ext;
+                       features->privateData = true;
+                       break;
+               }
                default:
                        break;
                }
@@ -7778,3 +7784,48 @@ void radv_GetPhysicalDeviceMultisamplePropertiesEXT(
                pMultisampleProperties->maxSampleLocationGridSize = (VkExtent2D){ 0, 0 };
        }
 }
+
+VkResult radv_CreatePrivateDataSlotEXT(
+    VkDevice                                    _device,
+    const VkPrivateDataSlotCreateInfoEXT*       pCreateInfo,
+    const VkAllocationCallbacks*                pAllocator,
+    VkPrivateDataSlotEXT*                       pPrivateDataSlot)
+{
+       RADV_FROM_HANDLE(radv_device, device, _device);
+       return vk_private_data_slot_create(&device->vk, pCreateInfo, pAllocator,
+                                          pPrivateDataSlot);
+}
+
+void radv_DestroyPrivateDataSlotEXT(
+    VkDevice                                    _device,
+    VkPrivateDataSlotEXT                        privateDataSlot,
+    const VkAllocationCallbacks*                pAllocator)
+{
+       RADV_FROM_HANDLE(radv_device, device, _device);
+       vk_private_data_slot_destroy(&device->vk, privateDataSlot, pAllocator);
+}
+
+VkResult radv_SetPrivateDataEXT(
+    VkDevice                                    _device,
+    VkObjectType                                objectType,
+    uint64_t                                    objectHandle,
+    VkPrivateDataSlotEXT                        privateDataSlot,
+    uint64_t                                    data)
+{
+       RADV_FROM_HANDLE(radv_device, device, _device);
+       return vk_object_base_set_private_data(&device->vk, objectType,
+                                              objectHandle, privateDataSlot,
+                                              data);
+}
+
+void radv_GetPrivateDataEXT(
+    VkDevice                                    _device,
+    VkObjectType                                objectType,
+    uint64_t                                    objectHandle,
+    VkPrivateDataSlotEXT                        privateDataSlot,
+    uint64_t*                                   pData)
+{
+       RADV_FROM_HANDLE(radv_device, device, _device);
+       vk_object_base_get_private_data(&device->vk, objectType, objectHandle,
+                                       privateDataSlot, pData);
+}
index 032fd8e567f2d0a873cfd3a0ff2df14611b730d4..bf9f87a0acaa154a339b3ddc6821eb5878fc9786 100644 (file)
@@ -159,6 +159,7 @@ EXTENSIONS = [
     Extension('VK_EXT_pci_bus_info',                      2, True),
     Extension('VK_EXT_pipeline_creation_feedback',        1, True),
     Extension('VK_EXT_post_depth_coverage',               1, 'device->rad_info.chip_class >= GFX10'),
+    Extension('VK_EXT_private_data',                      1, True),
     Extension('VK_EXT_queue_family_foreign',              1, True),
     Extension('VK_EXT_robustness2',                       1, True),
     # Disable sample locations on GFX10 until the CTS failures have been resolved.