turnip: implement VK_EXT_private_data
authorHyunjun Ko <zzoon@igalia.com>
Mon, 13 Jul 2020 03:12:56 +0000 (03:12 +0000)
committerMarge Bot <eric+marge@anholt.net>
Tue, 14 Jul 2020 02:48:30 +0000 (02:48 +0000)
Which is using base class's implementation.

Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5539>

src/freedreno/vulkan/tu_device.c
src/freedreno/vulkan/tu_extensions.py

index a893c3be148cad5e940070fde25234302de602ca..7f0ac1fe499e6fe5e76059f617fc58fca37c541e 100644 (file)
@@ -762,6 +762,12 @@ tu_GetPhysicalDeviceFeatures2(VkPhysicalDevice physicalDevice,
          features->vertexAttributeInstanceRateZeroDivisor = true;
          break;
       }
+      case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES_EXT: {
+         VkPhysicalDevicePrivateDataFeaturesEXT *features =
+            (VkPhysicalDevicePrivateDataFeaturesEXT *)ext;
+         features->privateData = true;
+         break;
+      }
       default:
          break;
       }
@@ -2699,3 +2705,56 @@ void tu_GetPhysicalDeviceMultisamplePropertiesEXT(
    else
       pMultisampleProperties->maxSampleLocationGridSize = (VkExtent2D){ 0, 0 };
 }
+
+
+VkResult
+tu_CreatePrivateDataSlotEXT(VkDevice _device,
+                            const VkPrivateDataSlotCreateInfoEXT* pCreateInfo,
+                            const VkAllocationCallbacks* pAllocator,
+                            VkPrivateDataSlotEXT* pPrivateDataSlot)
+{
+   TU_FROM_HANDLE(tu_device, device, _device);
+   return vk_private_data_slot_create(&device->vk,
+                                      pCreateInfo,
+                                      pAllocator,
+                                      pPrivateDataSlot);
+}
+
+void
+tu_DestroyPrivateDataSlotEXT(VkDevice _device,
+                             VkPrivateDataSlotEXT privateDataSlot,
+                             const VkAllocationCallbacks* pAllocator)
+{
+   TU_FROM_HANDLE(tu_device, device, _device);
+   vk_private_data_slot_destroy(&device->vk, privateDataSlot, pAllocator);
+}
+
+VkResult
+tu_SetPrivateDataEXT(VkDevice _device,
+                     VkObjectType objectType,
+                     uint64_t objectHandle,
+                     VkPrivateDataSlotEXT privateDataSlot,
+                     uint64_t data)
+{
+   TU_FROM_HANDLE(tu_device, device, _device);
+   return vk_object_base_set_private_data(&device->vk,
+                                          objectType,
+                                          objectHandle,
+                                          privateDataSlot,
+                                          data);
+}
+
+void
+tu_GetPrivateDataEXT(VkDevice _device,
+                     VkObjectType objectType,
+                     uint64_t objectHandle,
+                     VkPrivateDataSlotEXT privateDataSlot,
+                     uint64_t* pData)
+{
+   TU_FROM_HANDLE(tu_device, device, _device);
+   vk_object_base_get_private_data(&device->vk,
+                                   objectType,
+                                   objectHandle,
+                                   privateDataSlot,
+                                   pData);
+}
index 5bdc791be147c36b840cf458d4be56f3767df95c..e2583afbe53c6b5409f48db3a9f46ad272d086ec 100644 (file)
@@ -85,6 +85,7 @@ EXTENSIONS = [
     Extension('VK_EXT_vertex_attribute_divisor',          1, True),
     Extension('VK_KHR_shader_draw_parameters',            1, True),
     Extension('VK_KHR_variable_pointers',                 1, True),
+    Extension('VK_EXT_private_data',                      1, True),
 ]
 
 MAX_API_VERSION = VkVersion(MAX_API_VERSION)