Use the same helpers as for other handle<->pointer conversions.
Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
if (!sem)
return VK_ERROR_OUT_OF_HOST_MEMORY;
- *pSemaphore = (VkSemaphore)sem;
+ *pSemaphore = radeon_winsys_sem_to_handle(sem);
return VK_SUCCESS;
}
const VkAllocationCallbacks* pAllocator)
{
RADV_FROM_HANDLE(radv_device, device, _device);
- struct radeon_winsys_sem *sem;
+ RADV_FROM_HANDLE(radeon_winsys_sem, sem, _semaphore);
if (!_semaphore)
return;
- sem = (struct radeon_winsys_sem *)_semaphore;
device->ws->destroy_sem(sem);
}
bool signalled;
};
+struct radeon_winsys_sem;
+
#define RADV_DEFINE_HANDLE_CASTS(__radv_type, __VkType) \
\
static inline struct __radv_type * \
RADV_DEFINE_NONDISP_HANDLE_CASTS(radv_render_pass, VkRenderPass)
RADV_DEFINE_NONDISP_HANDLE_CASTS(radv_sampler, VkSampler)
RADV_DEFINE_NONDISP_HANDLE_CASTS(radv_shader_module, VkShaderModule)
+RADV_DEFINE_NONDISP_HANDLE_CASTS(radeon_winsys_sem, VkSemaphore)
#endif /* RADV_PRIVATE_H */