diff options
author | 2016-03-24 16:24:40 +0800 | |
---|---|---|
committer | 2016-04-07 21:15:03 +0800 | |
commit | ba0be41afe39dcbed0a712a32d1ab6c341797007 (patch) | |
tree | d47694e68fda562e143727f811734f95d8c93412 | |
parent | cc5e2765a9d56b03b69d0c3f25b94721f82d034e (diff) |
vulkan: move GetDeviceQueue_Bottom
Move it from loader.cpp to driver.cpp and rename it to
driver::GetDeviceQueue. No functional change.
Change-Id: Ide8ebe044e62b8ef6fc64ac03dcc1d920f5bf9a6
-rw-r--r-- | vulkan/libvulkan/code-generator.tmpl | 2 | ||||
-rw-r--r-- | vulkan/libvulkan/driver.cpp | 10 | ||||
-rw-r--r-- | vulkan/libvulkan/driver.h | 2 | ||||
-rw-r--r-- | vulkan/libvulkan/driver_gen.cpp | 2 | ||||
-rw-r--r-- | vulkan/libvulkan/loader.cpp | 10 | ||||
-rw-r--r-- | vulkan/libvulkan/loader.h | 1 |
6 files changed, 15 insertions, 12 deletions
diff --git a/vulkan/libvulkan/code-generator.tmpl b/vulkan/libvulkan/code-generator.tmpl index 23c27176d7..4ec13a0cd5 100644 --- a/vulkan/libvulkan/code-generator.tmpl +++ b/vulkan/libvulkan/code-generator.tmpl @@ -834,6 +834,8 @@ VK_KHR_swapchain {{if eq $.Name "vkGetDeviceProcAddr"}} reinterpret_cast<PFN_vkVoidFunction>({{$base}}), + {{else if eq $.Name "vkGetDeviceQueue"}} + reinterpret_cast<PFN_vkVoidFunction>({{$base}}), {{else}} reinterpret_cast<PFN_vkVoidFunction>({{$base}}_Bottom), {{end}} diff --git a/vulkan/libvulkan/driver.cpp b/vulkan/libvulkan/driver.cpp index d517c72440..1641e31bc3 100644 --- a/vulkan/libvulkan/driver.cpp +++ b/vulkan/libvulkan/driver.cpp @@ -205,5 +205,15 @@ PFN_vkVoidFunction GetDeviceProcAddr(VkDevice device, const char* pName) { : hook->disabled_proc; } +void GetDeviceQueue(VkDevice device, + uint32_t queueFamilyIndex, + uint32_t queueIndex, + VkQueue* pQueue) { + const auto& data = GetData(device); + + data.driver.GetDeviceQueue(device, queueFamilyIndex, queueIndex, pQueue); + SetData(*pQueue, data); +} + } // namespace driver } // namespace vulkan diff --git a/vulkan/libvulkan/driver.h b/vulkan/libvulkan/driver.h index 7af63fab29..8569a52d0e 100644 --- a/vulkan/libvulkan/driver.h +++ b/vulkan/libvulkan/driver.h @@ -108,6 +108,8 @@ const VkAllocationCallbacks& GetDefaultAllocator(); VKAPI_ATTR PFN_vkVoidFunction GetInstanceProcAddr(VkInstance instance, const char* pName); VKAPI_ATTR PFN_vkVoidFunction GetDeviceProcAddr(VkDevice device, const char* pName); VKAPI_ATTR VkResult EnumerateInstanceExtensionProperties(const char* pLayerName, uint32_t* pPropertyCount, VkExtensionProperties* pProperties); + +VKAPI_ATTR void GetDeviceQueue(VkDevice device, uint32_t queueFamilyIndex, uint32_t queueIndex, VkQueue* pQueue); // clang-format on template <typename DispatchableType> diff --git a/vulkan/libvulkan/driver_gen.cpp b/vulkan/libvulkan/driver_gen.cpp index 87987c884c..b6081f0047 100644 --- a/vulkan/libvulkan/driver_gen.cpp +++ b/vulkan/libvulkan/driver_gen.cpp @@ -268,7 +268,7 @@ const ProcHook g_proc_hooks[] = { "vkGetDeviceQueue", ProcHook::DEVICE, ProcHook::EXTENSION_CORE, - reinterpret_cast<PFN_vkVoidFunction>(GetDeviceQueue_Bottom), + reinterpret_cast<PFN_vkVoidFunction>(GetDeviceQueue), nullptr, nullptr, }, diff --git a/vulkan/libvulkan/loader.cpp b/vulkan/libvulkan/loader.cpp index 3e5ea22c10..96eae53e3c 100644 --- a/vulkan/libvulkan/loader.cpp +++ b/vulkan/libvulkan/loader.cpp @@ -638,16 +638,6 @@ void DestroyDevice_Bottom(VkDevice vkdevice, const VkAllocationCallbacks*) { DestroyDevice(&GetDispatchParent(vkdevice), vkdevice); } -void GetDeviceQueue_Bottom(VkDevice vkdevice, - uint32_t family, - uint32_t index, - VkQueue* queue_out) { - const auto& data = driver::GetData(vkdevice); - - data.driver.GetDeviceQueue(vkdevice, family, index, queue_out); - driver::SetData(*queue_out, data); -} - VkResult AllocateCommandBuffers_Bottom( VkDevice vkdevice, const VkCommandBufferAllocateInfo* alloc_info, diff --git a/vulkan/libvulkan/loader.h b/vulkan/libvulkan/loader.h index a2c7e83a72..2183c29ad9 100644 --- a/vulkan/libvulkan/loader.h +++ b/vulkan/libvulkan/loader.h @@ -53,7 +53,6 @@ VKAPI_ATTR VkResult EnumerateDeviceExtensionProperties_Bottom(VkPhysicalDevice p VKAPI_ATTR VkResult CreateDevice_Bottom(VkPhysicalDevice pdev, const VkDeviceCreateInfo* create_info, const VkAllocationCallbacks* allocator, VkDevice* device_out); VKAPI_ATTR void DestroyInstance_Bottom(VkInstance vkinstance, const VkAllocationCallbacks* allocator); VKAPI_ATTR void DestroyDevice_Bottom(VkDevice device, const VkAllocationCallbacks* pAllocator); -VKAPI_ATTR void GetDeviceQueue_Bottom(VkDevice device, uint32_t queueFamilyIndex, uint32_t queueIndex, VkQueue* pQueue); VKAPI_ATTR VkResult AllocateCommandBuffers_Bottom(VkDevice device, const VkCommandBufferAllocateInfo* pAllocateInfo, VkCommandBuffer* pCommandBuffers); // clang-format on |