|
|
|
@ -48,8 +48,9 @@ static int g_SwapChainResizeHeight = 0;
|
|
|
|
|
|
|
|
|
|
static void check_vk_result(VkResult err)
|
|
|
|
|
{
|
|
|
|
|
if (err == 0) return;
|
|
|
|
|
printf("VkResult %d\n", err);
|
|
|
|
|
if (err == 0)
|
|
|
|
|
return;
|
|
|
|
|
fprintf(stderr, "[vulkan] Error: VkResult = %d\n", err);
|
|
|
|
|
if (err < 0)
|
|
|
|
|
abort();
|
|
|
|
|
}
|
|
|
|
@ -58,7 +59,7 @@ static void check_vk_result(VkResult err)
|
|
|
|
|
static VKAPI_ATTR VkBool32 VKAPI_CALL debug_report(VkDebugReportFlagsEXT flags, VkDebugReportObjectTypeEXT objectType, uint64_t object, size_t location, int32_t messageCode, const char* pLayerPrefix, const char* pMessage, void* pUserData)
|
|
|
|
|
{
|
|
|
|
|
(void)flags; (void)object; (void)location; (void)messageCode; (void)pUserData; (void)pLayerPrefix; // Unused arguments
|
|
|
|
|
fprintf(stderr, "[vulkan] ObjectType: %i\nMessage: %s\n\n", objectType, pMessage);
|
|
|
|
|
fprintf(stderr, "[vulkan] Debug report from ObjectType: %i\nMessage: %s\n\n", objectType, pMessage);
|
|
|
|
|
return VK_FALSE;
|
|
|
|
|
}
|
|
|
|
|
#endif // IMGUI_VULKAN_DEBUG_REPORT
|
|
|
|
@ -225,7 +226,7 @@ static void SetupVulkanWindow(ImGui_ImplVulkanH_Window* wd, VkSurfaceKHR surface
|
|
|
|
|
|
|
|
|
|
// Create SwapChain, RenderPass, Framebuffer, etc.
|
|
|
|
|
IM_ASSERT(g_MinImageCount >= 2);
|
|
|
|
|
ImGui_ImplVulkanH_CreateWindow(g_Instance, g_PhysicalDevice, g_Device, wd, g_QueueFamily, g_Allocator, width, height, g_MinImageCount);
|
|
|
|
|
ImGui_ImplVulkanH_CreateOrResizeWindow(g_Instance, g_PhysicalDevice, g_Device, wd, g_QueueFamily, g_Allocator, width, height, g_MinImageCount);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void CleanupVulkan()
|
|
|
|
@ -459,7 +460,7 @@ int main(int, char**)
|
|
|
|
|
{
|
|
|
|
|
g_SwapChainRebuild = false;
|
|
|
|
|
ImGui_ImplVulkan_SetMinImageCount(g_MinImageCount);
|
|
|
|
|
ImGui_ImplVulkanH_CreateWindow(g_Instance, g_PhysicalDevice, g_Device, &g_MainWindowData, g_QueueFamily, g_Allocator, g_SwapChainResizeWidth, g_SwapChainResizeHeight, g_MinImageCount);
|
|
|
|
|
ImGui_ImplVulkanH_CreateOrResizeWindow(g_Instance, g_PhysicalDevice, g_Device, &g_MainWindowData, g_QueueFamily, g_Allocator, g_SwapChainResizeWidth, g_SwapChainResizeHeight, g_MinImageCount);
|
|
|
|
|
g_MainWindowData.FrameIndex = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|