vulkan,anv: Add common entrypoints for VK_EXT_private_data

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676>
This commit is contained in:
Jason Ekstrand 2021-01-23 22:43:56 -06:00 committed by Marge Bot
parent f8bc9a4e7a
commit 3536bec0fa
2 changed files with 47 additions and 46 deletions

View file

@ -4670,52 +4670,6 @@ vk_icdNegotiateLoaderICDInterfaceVersion(uint32_t* pSupportedVersion)
return VK_SUCCESS;
}
VkResult anv_CreatePrivateDataSlotEXT(
VkDevice _device,
const VkPrivateDataSlotCreateInfoEXT* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkPrivateDataSlotEXT* pPrivateDataSlot)
{
ANV_FROM_HANDLE(anv_device, device, _device);
return vk_private_data_slot_create(&device->vk, pCreateInfo, pAllocator,
pPrivateDataSlot);
}
void anv_DestroyPrivateDataSlotEXT(
VkDevice _device,
VkPrivateDataSlotEXT privateDataSlot,
const VkAllocationCallbacks* pAllocator)
{
ANV_FROM_HANDLE(anv_device, device, _device);
vk_private_data_slot_destroy(&device->vk, privateDataSlot, pAllocator);
}
VkResult anv_SetPrivateDataEXT(
VkDevice _device,
VkObjectType objectType,
uint64_t objectHandle,
VkPrivateDataSlotEXT privateDataSlot,
uint64_t data)
{
ANV_FROM_HANDLE(anv_device, device, _device);
return vk_object_base_set_private_data(&device->vk,
objectType, objectHandle,
privateDataSlot, data);
}
void anv_GetPrivateDataEXT(
VkDevice _device,
VkObjectType objectType,
uint64_t objectHandle,
VkPrivateDataSlotEXT privateDataSlot,
uint64_t* pData)
{
ANV_FROM_HANDLE(anv_device, device, _device);
vk_object_base_get_private_data(&device->vk,
objectType, objectHandle,
privateDataSlot, pData);
}
VkResult anv_CreateDeferredOperationKHR(
VkDevice _device,
const VkAllocationCallbacks* pAllocator,

View file

@ -24,6 +24,7 @@
#include "vk_object.h"
#include "vk_alloc.h"
#include "vk_common_entrypoints.h"
#include "vk_device.h"
#include "util/hash_table.h"
#include "util/ralloc.h"
@ -230,3 +231,49 @@ vk_object_base_get_private_data(struct vk_device *device,
*pData = 0;
}
}
VkResult
vk_common_CreatePrivateDataSlotEXT(VkDevice _device,
const VkPrivateDataSlotCreateInfoEXT *pCreateInfo,
const VkAllocationCallbacks *pAllocator,
VkPrivateDataSlotEXT *pPrivateDataSlot)
{
VK_FROM_HANDLE(vk_device, device, _device);
return vk_private_data_slot_create(device, pCreateInfo, pAllocator,
pPrivateDataSlot);
}
void
vk_common_DestroyPrivateDataSlotEXT(VkDevice _device,
VkPrivateDataSlotEXT privateDataSlot,
const VkAllocationCallbacks *pAllocator)
{
VK_FROM_HANDLE(vk_device, device, _device);
vk_private_data_slot_destroy(device, privateDataSlot, pAllocator);
}
VkResult
vk_common_SetPrivateDataEXT(VkDevice _device,
VkObjectType objectType,
uint64_t objectHandle,
VkPrivateDataSlotEXT privateDataSlot,
uint64_t data)
{
VK_FROM_HANDLE(vk_device, device, _device);
return vk_object_base_set_private_data(device,
objectType, objectHandle,
privateDataSlot, data);
}
void
vk_common_GetPrivateDataEXT(VkDevice _device,
VkObjectType objectType,
uint64_t objectHandle,
VkPrivateDataSlotEXT privateDataSlot,
uint64_t *pData)
{
VK_FROM_HANDLE(vk_device, device, _device);
vk_object_base_get_private_data(device,
objectType, objectHandle,
privateDataSlot, pData);
}