diff options
author | Jordan Halase <jordan@halase.me> | 2019-11-03 15:19:25 -0600 |
---|---|---|
committer | Jordan Halase <jordan@halase.me> | 2019-11-03 15:19:25 -0600 |
commit | faa978ae4e9bfe02758b82895d5b0985093f55f7 (patch) | |
tree | 17ff790cebaa9912799c744e7a2ac12f2c7dd4d0 | |
parent | d57e38324f5d1c611d23f08a9c3d489be7ad01a6 (diff) |
Change device function loader
-rw-r--r-- | main.c | 9 |
1 files changed, 3 insertions, 6 deletions
@@ -839,24 +839,21 @@ static int rvkLoadDeviceFunctions(struct RenderVulkan *vk, VkDevice device) const char *const strErrLd = "Error loading device function %s"; static const char *const _vkDestroyDevice = "vkDestroyDevice"; - uintptr_t *__vkDestroyDevice = (uintptr_t*)&vk->dev->vkDestroyDevice; - *__vkDestroyDevice = (uintptr_t)vk->api->vkGetDeviceProcAddr(device, _vkDestroyDevice); + vk->dev->vkDestroyDevice = (PFN_vkDestroyDevice)vk->api->vkGetDeviceProcAddr(device, _vkDestroyDevice); if (!vk->dev->vkDestroyDevice) { rvkSetErrMsg(vk, strErrLd, _vkDestroyDevice); return -1; } static const char *const _vkDeviceWaitIdle = "vkDeviceWaitIdle"; - uintptr_t *__vkDeviceWaitIdle = (uintptr_t*)&vk->dev->vkDeviceWaitIdle; - *__vkDeviceWaitIdle = (uintptr_t)vk->api->vkGetDeviceProcAddr(device, _vkDeviceWaitIdle); + vk->dev->vkDeviceWaitIdle = (PFN_vkDeviceWaitIdle)vk->api->vkGetDeviceProcAddr(device, _vkDeviceWaitIdle); if (!vk->dev->vkDeviceWaitIdle) { rvkSetErrMsg(vk, strErrLd, _vkDeviceWaitIdle); return -1; } static const char *const _vkGetDeviceQueue = "vkGetDeviceQueue"; - uintptr_t *__vkGetDeviceQueue = (uintptr_t*)&vk->dev->vkGetDeviceQueue; - *__vkGetDeviceQueue = (uintptr_t)vk->api->vkGetDeviceProcAddr(device, _vkGetDeviceQueue); + vk->dev->vkGetDeviceQueue = (PFN_vkGetDeviceQueue)vk->api->vkGetDeviceProcAddr(device, _vkGetDeviceQueue); if (!vk->dev->vkGetDeviceQueue) { rvkSetErrMsg(vk, strErrLd, _vkGetDeviceQueue); return -1; |