Commit 3a7514ea authored by Jason Ekstrand's avatar Jason Ekstrand Committed by Marge Bot
Browse files

anv,radv: Use common entrypoints for VK_KHR_deferred_operation


Reviewed-by: Lionel Landwerlin's avatarLionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Samuel Pitoiset's avatarSamuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen's avatarBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <mesa/mesa!8676>
parent 23ba48a0
......@@ -34,7 +34,6 @@
#include "radv_shader.h"
#include "radv_cs.h"
#include "util/disk_cache.h"
#include "vk_deferred_operation.h"
#include "vk_util.h"
#ifdef _WIN32
typedef void* drmDevicePtr;
......@@ -8139,42 +8138,3 @@ VkResult radv_GetPhysicalDeviceFragmentShadingRatesKHR(
return vk_outarray_status(&out);
}
VkResult radv_CreateDeferredOperationKHR(VkDevice _device,
const VkAllocationCallbacks* pAllocator,
VkDeferredOperationKHR* pDeferredOperation)
{
RADV_FROM_HANDLE(radv_device, device, _device);
return vk_create_deferred_operation(&device->vk, pAllocator,
pDeferredOperation);
}
void radv_DestroyDeferredOperationKHR(VkDevice _device,
VkDeferredOperationKHR operation,
const VkAllocationCallbacks* pAllocator)
{
RADV_FROM_HANDLE(radv_device, device, _device);
vk_destroy_deferred_operation(&device->vk, operation, pAllocator);
}
uint32_t radv_GetDeferredOperationMaxConcurrencyKHR(VkDevice _device,
VkDeferredOperationKHR operation)
{
RADV_FROM_HANDLE(radv_device, device, _device);
return vk_get_deferred_operation_max_concurrency(&device->vk, operation);
}
VkResult radv_GetDeferredOperationResultKHR(VkDevice _device,
VkDeferredOperationKHR operation)
{
RADV_FROM_HANDLE(radv_device, device, _device);
return vk_get_deferred_operation_result(&device->vk, operation);
}
VkResult radv_DeferredOperationJoinKHR(VkDevice _device,
VkDeferredOperationKHR operation)
{
RADV_FROM_HANDLE(radv_device, device, _device);
return vk_deferred_operation_join(&device->vk, operation);
}
......@@ -4533,46 +4533,3 @@ vk_icdNegotiateLoaderICDInterfaceVersion(uint32_t* pSupportedVersion)
*pSupportedVersion = MIN2(*pSupportedVersion, 4u);
return VK_SUCCESS;
}
VkResult anv_CreateDeferredOperationKHR(
VkDevice _device,
const VkAllocationCallbacks* pAllocator,
VkDeferredOperationKHR* pDeferredOperation)
{
ANV_FROM_HANDLE(anv_device, device, _device);
return vk_create_deferred_operation(&device->vk, pAllocator,
pDeferredOperation);
}
void anv_DestroyDeferredOperationKHR(
VkDevice _device,
VkDeferredOperationKHR operation,
const VkAllocationCallbacks* pAllocator)
{
ANV_FROM_HANDLE(anv_device, device, _device);
vk_destroy_deferred_operation(&device->vk, operation, pAllocator);
}
uint32_t anv_GetDeferredOperationMaxConcurrencyKHR(
VkDevice _device,
VkDeferredOperationKHR operation)
{
ANV_FROM_HANDLE(anv_device, device, _device);
return vk_get_deferred_operation_max_concurrency(&device->vk, operation);
}
VkResult anv_GetDeferredOperationResultKHR(
VkDevice _device,
VkDeferredOperationKHR operation)
{
ANV_FROM_HANDLE(anv_device, device, _device);
return vk_get_deferred_operation_result(&device->vk, operation);
}
VkResult anv_DeferredOperationJoinKHR(
VkDevice _device,
VkDeferredOperationKHR operation)
{
ANV_FROM_HANDLE(anv_device, device, _device);
return vk_deferred_operation_join(&device->vk, operation);
}
......@@ -40,7 +40,7 @@ struct vk_debug_report_callback {
VK_DEFINE_NONDISP_HANDLE_CASTS(vk_debug_report_callback, base,
VkDebugReportCallbackEXT,
VK_OBJECT_TYPE_INSTANCE)
VK_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT)
VkResult
vk_common_CreateDebugReportCallbackEXT(VkInstance _instance,
......
......@@ -24,13 +24,16 @@
#include "vk_deferred_operation.h"
#include "vk_alloc.h"
#include "vk_common_entrypoints.h"
#include "vk_device.h"
VkResult
vk_create_deferred_operation(struct vk_device *device,
const VkAllocationCallbacks *pAllocator,
VkDeferredOperationKHR *pDeferredOperation)
vk_common_CreateDeferredOperationKHR(VkDevice _device,
const VkAllocationCallbacks *pAllocator,
VkDeferredOperationKHR *pDeferredOperation)
{
VK_FROM_HANDLE(vk_device, device, _device);
struct vk_deferred_operation *op =
vk_alloc2(&device->alloc, pAllocator, sizeof(*op), 8,
VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
......@@ -46,36 +49,37 @@ vk_create_deferred_operation(struct vk_device *device,
}
void
vk_destroy_deferred_operation(struct vk_device *device,
VkDeferredOperationKHR operation,
const VkAllocationCallbacks *pAllocator)
vk_common_DestroyDeferredOperationKHR(VkDevice _device,
VkDeferredOperationKHR operation,
const VkAllocationCallbacks *pAllocator)
{
if (operation == VK_NULL_HANDLE)
return;
VK_FROM_HANDLE(vk_device, device, _device);
VK_FROM_HANDLE(vk_deferred_operation, op, operation);
if (op == NULL)
return;
vk_object_base_finish(&op->base);
vk_free2(&device->alloc, pAllocator, op);
}
uint32_t
vk_get_deferred_operation_max_concurrency(UNUSED struct vk_device *device,
UNUSED VkDeferredOperationKHR operation)
vk_common_GetDeferredOperationMaxConcurrencyKHR(UNUSED VkDevice device,
UNUSED VkDeferredOperationKHR operation)
{
return 1;
}
VkResult
vk_get_deferred_operation_result(UNUSED struct vk_device *device,
UNUSED VkDeferredOperationKHR operation)
vk_common_GetDeferredOperationResultKHR(UNUSED VkDevice device,
UNUSED VkDeferredOperationKHR operation)
{
return VK_SUCCESS;
}
VkResult
vk_deferred_operation_join(UNUSED struct vk_device *device,
UNUSED VkDeferredOperationKHR operation)
vk_common_DeferredOperationJoinKHR(UNUSED VkDevice device,
UNUSED VkDeferredOperationKHR operation)
{
return VK_SUCCESS;
}
......@@ -40,28 +40,6 @@ VK_DEFINE_NONDISP_HANDLE_CASTS(vk_deferred_operation, base,
VkDeferredOperationKHR,
VK_OBJECT_TYPE_DEFERRED_OPERATION_KHR)
VkResult
vk_create_deferred_operation(struct vk_device *device,
const VkAllocationCallbacks *pAllocator,
VkDeferredOperationKHR *pDeferredOperation);
void
vk_destroy_deferred_operation(struct vk_device *device,
VkDeferredOperationKHR operation,
const VkAllocationCallbacks *pAllocator);
uint32_t
vk_get_deferred_operation_max_concurrency(struct vk_device *device,
VkDeferredOperationKHR operation);
VkResult
vk_get_deferred_operation_result(struct vk_device *device,
VkDeferredOperationKHR operation);
VkResult
vk_deferred_operation_join(struct vk_device *device,
VkDeferredOperationKHR operation);
#ifdef __cplusplus
}
#endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment