From: Hyunjun Ko Date: Mon, 13 Jul 2020 03:12:56 +0000 (+0000) Subject: turnip: implement VK_EXT_private_data X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d941c6b74fefa97d2d4a1c522170312946d964ca;p=mesa.git turnip: implement VK_EXT_private_data Which is using base class's implementation. Signed-off-by: Hyunjun Ko Part-of: --- diff --git a/src/freedreno/vulkan/tu_device.c b/src/freedreno/vulkan/tu_device.c index a893c3be148..7f0ac1fe499 100644 --- a/src/freedreno/vulkan/tu_device.c +++ b/src/freedreno/vulkan/tu_device.c @@ -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); +} diff --git a/src/freedreno/vulkan/tu_extensions.py b/src/freedreno/vulkan/tu_extensions.py index 5bdc791be14..e2583afbe53 100644 --- a/src/freedreno/vulkan/tu_extensions.py +++ b/src/freedreno/vulkan/tu_extensions.py @@ -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)