vulkan: Implement VkSurfaceKHR and use vulkanext.h
Between header version 0.183.0 and 0.184.0, a copy of vulkan.h which
includes extensions was added to the registry, called vulkanext.h. The
vulkan.h included here is actually the registry's vulkanext.h.
(In a later upstream change, the no-extensions version was removed
from the registry, and vulkanext.h was renamed vulkan.h, matching what
we're doing here.)
The version of the extensions picked up in the header file is later
than the ones used in the previous SDK, so this change also updates
our implementation to the extension versions included in the header.
The main change is replacing the VkSurfaceDescriptionKHR structure
with a VkSurfaceKHR object.
Change-Id: I18fa5a269db0fcdbdbde3e9304167bc15e456f85
(cherry picked from commit 957a59a48a8d2e81ca3bb52aacd8d08b1b43dc74)
diff --git a/vulkan/libvulkan/loader.cpp b/vulkan/libvulkan/loader.cpp
index c427918..a44026f 100644
--- a/vulkan/libvulkan/loader.cpp
+++ b/vulkan/libvulkan/loader.cpp
@@ -1102,16 +1102,29 @@
return VK_SUCCESS;
}
-void* AllocDeviceMem(VkDevice device,
- size_t size,
- size_t align,
- VkSystemAllocType type) {
+void* AllocMem(VkInstance instance,
+ size_t size,
+ size_t align,
+ VkSystemAllocType type) {
+ const VkAllocCallbacks* alloc_cb = instance->alloc;
+ return alloc_cb->pfnAlloc(alloc_cb->pUserData, size, align, type);
+}
+
+void FreeMem(VkInstance instance, void* ptr) {
+ const VkAllocCallbacks* alloc_cb = instance->alloc;
+ alloc_cb->pfnFree(alloc_cb->pUserData, ptr);
+}
+
+void* AllocMem(VkDevice device,
+ size_t size,
+ size_t align,
+ VkSystemAllocType type) {
const VkAllocCallbacks* alloc_cb =
static_cast<Device*>(GetVtbl(device)->device)->instance->alloc;
return alloc_cb->pfnAlloc(alloc_cb->pUserData, size, align, type);
}
-void FreeDeviceMem(VkDevice device, void* ptr) {
+void FreeMem(VkDevice device, void* ptr) {
const VkAllocCallbacks* alloc_cb =
static_cast<Device*>(GetVtbl(device)->device)->instance->alloc;
alloc_cb->pfnFree(alloc_cb->pUserData, ptr);