mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-23 15:39:03 +00:00
Import OpenCL exported semaphore in Vulkan (#1898)
Except for SYNC_FD, current implementation doesn't import exported OpenCL semaphore in Vulkan and ends up doing signal and wait on essentially two unrelated semaphores (one created in OpenCL and one in Vulkan). Since OpenCL exports the semaphore, import that in Vulkan to perform signal/wait on the same underlying payload.
This commit is contained in:
@@ -26,6 +26,23 @@
|
||||
#include <OpenCL/cl_ext.h>
|
||||
#endif
|
||||
|
||||
#define CREATE_OPENCL_SEMAPHORE(clSemaphore, vkSemaphore, ctx, handleType, \
|
||||
devIdx, createExportable) \
|
||||
if (!(createExportable \
|
||||
&& (check_external_semaphore_handle_type( \
|
||||
devIdx, getCLSemaphoreTypeFromVulkanType(handleType), \
|
||||
CL_DEVICE_SEMAPHORE_EXPORT_HANDLE_TYPES_KHR) \
|
||||
== CL_SUCCESS))) \
|
||||
{ \
|
||||
clSemaphore = new clExternalImportableSemaphore(vkSemaphore, ctx, \
|
||||
handleType, devIdx); \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
clSemaphore = new clExternalExportableSemaphore(vkSemaphore, ctx, \
|
||||
handleType, devIdx); \
|
||||
}
|
||||
|
||||
typedef cl_semaphore_khr (*pfnclCreateSemaphoreWithPropertiesKHR)(
|
||||
cl_context context, cl_semaphore_properties_khr *sema_props,
|
||||
cl_int *errcode_ret);
|
||||
@@ -76,7 +93,9 @@ cl_int check_external_memory_handle_type(
|
||||
cl_external_memory_handle_type_khr requiredHandleType);
|
||||
cl_int check_external_semaphore_handle_type(
|
||||
cl_device_id deviceID,
|
||||
cl_external_semaphore_handle_type_khr requiredHandleType);
|
||||
cl_external_semaphore_handle_type_khr requiredHandleType,
|
||||
cl_device_info queryParamName =
|
||||
CL_DEVICE_SEMAPHORE_IMPORT_HANDLE_TYPES_KHR);
|
||||
cl_int setMaxImageDimensions(cl_device_id deviceID, size_t &width,
|
||||
size_t &height);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user