summaryrefslogtreecommitdiff
path: root/src/window.cpp
diff options
context:
space:
mode:
authorJonathan Bradley <jcb@pikum.xyz>2025-01-08 22:26:07 -0500
committerJonathan Bradley <jcb@pikum.xyz>2025-01-08 22:26:07 -0500
commit5845642965a1eebaec3a1d1126445ecb459688b8 (patch)
treed3c54bec229ac4dcf7c4af349e0383130a041752 /src/window.cpp
parentb2548ba4ce295fcd94a50123fb543fac2ef2bc33 (diff)
first-pass replace cmake with make
Diffstat (limited to 'src/window.cpp')
-rw-r--r--src/window.cpp66
1 files changed, 35 insertions, 31 deletions
diff --git a/src/window.cpp b/src/window.cpp
index c7963eb..1be148f 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -1,3 +1,4 @@
+#include "backends/imgui_impl_vulkan.h"
#include "math-helpers.hpp"
#include "static/missing-texture.hpp"
#define GLFW_INCLUDE_NONE
@@ -2263,52 +2264,55 @@ void CreateImGui() {
vkCreateDescriptorPool(vkDevice, &descriptorPoolCreateInfo, vkAllocator, &imGuiDescriptorPool);
ImGui_ImplGlfw_InitForVulkan(window, true);
- ImGui_ImplVulkan_InitInfo initInfo;
+ ImGui_ImplVulkan_InitInfo initInfo = {};
initInfo.Allocator = vkAllocator;
initInfo.CheckVkResultFn = ImGuiCheckVkResult;
- initInfo.ColorAttachmentFormat = VkFormat::VK_FORMAT_B8G8R8A8_SRGB;
+ // initInfo.ColorAttachmentFormat = VkFormat::VK_FORMAT_B8G8R8A8_SRGB;
initInfo.DescriptorPool = imGuiDescriptorPool;
initInfo.Device = vkDevice;
- initInfo.Instance = vkInstance;
initInfo.ImageCount = MAX_FRAMES_IN_FLIGHT;
- initInfo.MinImageCount = MAX_FRAMES_IN_FLIGHT;
+ initInfo.Instance = vkInstance;
initInfo.MSAASamples = VK_SAMPLE_COUNT_1_BIT;
+ initInfo.MinImageCount = MAX_FRAMES_IN_FLIGHT;
initInfo.PhysicalDevice = vkPhysicalDevice;
initInfo.PipelineCache = {};
initInfo.Queue = graphicsQueue;
initInfo.QueueFamily = graphicsFamilyIndex;
+ initInfo.RenderPass = presentRenderPass;
initInfo.Subpass = 0;
initInfo.UseDynamicRendering = false;
- ImGui_ImplVulkan_Init(&initInfo, presentRenderPass);
+ ImGui_ImplVulkan_Init(&initInfo);
// font
- {
- VkCommandBufferBeginInfo begInfo;
- begInfo.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO;
- begInfo.pNext = nullptr;
- begInfo.flags = VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT;
- begInfo.pInheritanceInfo = {};
- vkBeginCommandBuffer(presentCommandBuffers[0], &begInfo);
-
- ImGui_ImplVulkan_CreateFontsTexture(presentCommandBuffers[0]);
-
- vkEndCommandBuffer(presentCommandBuffers[0]);
-
- VkSubmitInfo submitInfo;
- submitInfo.sType = VK_STRUCTURE_TYPE_SUBMIT_INFO;
- submitInfo.pNext = nullptr;
- submitInfo.waitSemaphoreCount = 0;
- submitInfo.pWaitSemaphores = nullptr;
- submitInfo.pWaitDstStageMask = nullptr;
- submitInfo.commandBufferCount = 1;
- submitInfo.pCommandBuffers = presentCommandBuffers;
- submitInfo.signalSemaphoreCount = 0;
- submitInfo.pSignalSemaphores = nullptr;
- vkQueueSubmit(graphicsQueue, 1, &submitInfo, nullptr);
- vkQueueWaitIdle(graphicsQueue);
- }
- ImGui_ImplVulkan_DestroyFontUploadObjects();
+ // {
+ // VkCommandBufferBeginInfo begInfo;
+ // begInfo.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO;
+ // begInfo.pNext = nullptr;
+ // begInfo.flags = VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT;
+ // begInfo.pInheritanceInfo = {};
+ // vkBeginCommandBuffer(presentCommandBuffers[0], &begInfo);
+
+ // ImGui_ImplVulkan_CreateFontsTexture();
+ // ImGui_ImplVulkan_CreateFontsTexture(presentCommandBuffers[0]);
+
+ // vkEndCommandBuffer(presentCommandBuffers[0]);
+
+ // VkSubmitInfo submitInfo;
+ // submitInfo.sType = VK_STRUCTURE_TYPE_SUBMIT_INFO;
+ // submitInfo.pNext = nullptr;
+ // submitInfo.waitSemaphoreCount = 0;
+ // submitInfo.pWaitSemaphores = nullptr;
+ // submitInfo.pWaitDstStageMask = nullptr;
+ // submitInfo.commandBufferCount = 1;
+ // submitInfo.pCommandBuffers = presentCommandBuffers;
+ // submitInfo.signalSemaphoreCount = 0;
+ // submitInfo.pSignalSemaphores = nullptr;
+ // vkQueueSubmit(graphicsQueue, 1, &submitInfo, nullptr);
+ // vkQueueWaitIdle(graphicsQueue);
+ // }
+ // ImGui_ImplVulkan_DestroyFontsTexture();
+ // ImGui_ImplVulkan_DestroyFontUploadObjects();
}
void RecordCommandBuffer(VkCommandBuffer commandBuffer, uint32_t imageIndex) {