libvulkan: Implement new VkFence parameter in vkAcquireNextImageKHR
This parameter was added recently but wasn't hooked up. This adds a
new parameter to the vkAcquireImageANDROID extension function, and
plumbs the fence through from vkAcquireNextImageKHR to it.
This change also fixes some function signatures for API functions that
are implemented in the loader bottom rather than the driver. These
functions are only ever called through function pointers returned by
vkGet*ProcAddr, and therefore pass through a cast to
PFN_vkVoidFunction. So the compiler had no way to know they were
supposed to match a particular prototype, and couldn't issue an error
when they didn't. This change adds explicit static casts to the
expected function pointer type before reinterpret casting to the
generic function pointer type to enable compile errors.
Change-Id: I8a7e065502f783d5f2381b43c880644868234f8f
(cherry picked from commit f62f5de0c60212796b6d910cbd194c7002226264)
diff --git a/vulkan/libvulkan/loader.h b/vulkan/libvulkan/loader.h
index e007f8d..65f11f4 100644
--- a/vulkan/libvulkan/loader.h
+++ b/vulkan/libvulkan/loader.h
@@ -215,16 +215,18 @@
const VkAllocationCallbacks* allocator,
VkInstance* instance);
PFN_vkVoidFunction GetInstanceProcAddr(VkInstance instance, const char* name);
-PFN_vkVoidFunction GetDeviceProcAddr(VkDevice drv_device, const char* name);
-void GetDeviceQueue(VkDevice drv_device,
- uint32_t family,
- uint32_t index,
- VkQueue* out_queue);
-VkResult AllocateCommandBuffers(VkDevice device,
- const VkCommandBufferAllocateInfo* alloc_info,
- VkCommandBuffer* cmdbufs);
-VkResult DestroyDevice(VkDevice drv_device,
- const VkAllocationCallbacks* allocator);
+VKAPI_ATTR PFN_vkVoidFunction GetDeviceProcAddr(VkDevice drv_device,
+ const char* name);
+VKAPI_ATTR void GetDeviceQueue(VkDevice drv_device,
+ uint32_t family,
+ uint32_t index,
+ VkQueue* out_queue);
+VKAPI_ATTR VkResult
+AllocateCommandBuffers(VkDevice device,
+ const VkCommandBufferAllocateInfo* alloc_info,
+ VkCommandBuffer* cmdbufs);
+VKAPI_ATTR void DestroyDevice(VkDevice drv_device,
+ const VkAllocationCallbacks* allocator);
void* AllocMem(VkInstance instance,
size_t size,
@@ -292,9 +294,9 @@
const VkSwapchainCreateInfoKHR* create_info,
const VkAllocationCallbacks* allocator,
VkSwapchainKHR* swapchain_handle);
-VKAPI_ATTR VkResult DestroySwapchainKHR(VkDevice device,
- VkSwapchainKHR swapchain_handle,
- const VkAllocationCallbacks* allocator);
+VKAPI_ATTR void DestroySwapchainKHR(VkDevice device,
+ VkSwapchainKHR swapchain_handle,
+ const VkAllocationCallbacks* allocator);
VKAPI_ATTR VkResult GetSwapchainImagesKHR(VkDevice device,
VkSwapchainKHR swapchain_handle,
uint32_t* count,
@@ -303,6 +305,7 @@
VkSwapchainKHR swapchain_handle,
uint64_t timeout,
VkSemaphore semaphore,
+ VkFence fence,
uint32_t* image_index);
VKAPI_ATTR VkResult
QueuePresentKHR(VkQueue queue, const VkPresentInfoKHR* present_info);