From 1fd1e4b5f2418e3ac2909658993bfedb615537ec Mon Sep 17 00:00:00 2001 From: rtk0c Date: Thu, 6 May 2021 21:56:40 -0700 Subject: Change brace style to on new line, add initial deliveries view when an order entry is selected --- core/src/Entrypoint/Backend_Vulkan.cpp | 42 ++++++++++++++++++++++------------ 1 file changed, 28 insertions(+), 14 deletions(-) (limited to 'core/src/Entrypoint/Backend_Vulkan.cpp') diff --git a/core/src/Entrypoint/Backend_Vulkan.cpp b/core/src/Entrypoint/Backend_Vulkan.cpp index 9d79acf..de3b5ca 100644 --- a/core/src/Entrypoint/Backend_Vulkan.cpp +++ b/core/src/Entrypoint/Backend_Vulkan.cpp @@ -12,7 +12,8 @@ # include # include -class VulkanBackend : public RenderingBackend { +class VulkanBackend : public RenderingBackend +{ private: GLFWwindow* mWindow; @@ -31,7 +32,8 @@ private: bool mSwapChainRebuild = false; public: - VulkanBackend() { + VulkanBackend() + { glfwSetErrorCallback(&GlfwErrorCallback); if (!glfwInit()) { throw std::runtime_error("Failed to initialize GLFW."); @@ -80,7 +82,8 @@ public: ImGui_ImplVulkan_Init(&init_info, mMainWindowData.RenderPass); } - virtual ~VulkanBackend() { + virtual ~VulkanBackend() + { auto err = vkDeviceWaitIdle(mDevice); CheckVkResults(err); ImGui_ImplVulkan_Shutdown(); @@ -94,7 +97,8 @@ public: glfwTerminate(); } - virtual void RunUntilWindowClose(void (*windowContent)()) override { + virtual void RunUntilWindowClose(void (*windowContent)()) override + { // Upload Fonts { // Use any command queue @@ -158,7 +162,8 @@ public: } private: - void SetupVulkan(const char** extensions, uint32_t extensions_count) { + void SetupVulkan(const char** extensions, uint32_t extensions_count) + { VkResult err; // Create Vulkan Instance @@ -267,7 +272,8 @@ private: } } - void SetupVulkanWindow(ImGui_ImplVulkanH_Window* wd, VkSurfaceKHR surface, int width, int height) { + void SetupVulkanWindow(ImGui_ImplVulkanH_Window* wd, VkSurfaceKHR surface, int width, int height) + { wd->Surface = surface; // Check for WSI support @@ -291,7 +297,8 @@ private: ImGui_ImplVulkanH_CreateOrResizeWindow(mInstance, mPhysicalDevice, mDevice, wd, mQueueFamily, mAllocator, width, height, mMinImageCount); } - void FrameRender(ImGui_ImplVulkanH_Window* wd, ImDrawData* drawData) { + void FrameRender(ImGui_ImplVulkanH_Window* wd, ImDrawData* drawData) + { VkResult err; VkSemaphore imageAcquiredSemaphore = wd->FrameSemaphores[wd->SemaphoreIndex].ImageAcquiredSemaphore; @@ -356,7 +363,8 @@ private: } } - void FramePresent(ImGui_ImplVulkanH_Window* wd) { + void FramePresent(ImGui_ImplVulkanH_Window* wd) + { if (mSwapChainRebuild) { return; } @@ -378,18 +386,21 @@ private: wd->SemaphoreIndex = (wd->SemaphoreIndex + 1) % wd->ImageCount; // Now we can use the next set of semaphores } - void CleanupVulkan() { + void CleanupVulkan() + { vkDestroyDescriptorPool(mDevice, mDescriptorPool, mAllocator); vkDestroyDevice(mDevice, mAllocator); vkDestroyInstance(mInstance, mAllocator); } - void CleanupVulkanWindow() { + void CleanupVulkanWindow() + { ImGui_ImplVulkanH_DestroyWindow(mInstance, mDevice, &mMainWindowData, mAllocator); } - static void CheckVkResults(VkResult err) { + static void CheckVkResults(VkResult err) + { if (err == 0) return; std::string message; @@ -402,12 +413,14 @@ private: std::cerr << message << '\n'; } } - static void GlfwErrorCallback(int errorCode, const char* message) { + static void GlfwErrorCallback(int errorCode, const char* message) + { std::cerr << "GLFW Error " << errorCode << ": " << message << "\n"; } }; -std::unique_ptr RenderingBackend::CreateVulkanBackend() { +std::unique_ptr RenderingBackend::CreateVulkanBackend() +{ try { return std::make_unique(); } catch (std::exception& e) { @@ -417,7 +430,8 @@ std::unique_ptr RenderingBackend::CreateVulkanBackend() { #else // ^^ BUILD_CORE_WITH_VULKAN_BACKEND | ~BUILD_CORE_WITH_VULKAN_BACKEND vv -std::unique_ptr RenderingBackend::CreateVulkanBackend() { +std::unique_ptr RenderingBackend::CreateVulkanBackend() +{ return nullptr; } -- cgit v1.2.3-70-g09d2