Add imgui

This commit is contained in:
2026-06-22 03:22:13 +02:00
parent 6f679e7329
commit 331a565cc9
14 changed files with 415 additions and 15 deletions
+18
View File
@@ -13,6 +13,8 @@
#include <SDL2/SDL_vulkan.h>
#include <destrum/Graphics/Init.h>
#include <destrum/Graphics/Pipelines/ImguiPass.h>
#include "destrum/Graphics/imageLoader.h"
#include "destrum/Util/GameState.h"
@@ -77,6 +79,8 @@ void GfxDevice::init(SDL_Window* window, const std::string& appName, bool vSync)
.value();
device = vkb::DeviceBuilder{physicalDevice}.build().value();
volkLoadDevice(device);
graphicsQueueFamily = device.get_queue_index(vkb::QueueType::graphics).value();
graphicsQueue = device.get_queue(vkb::QueueType::graphics).value();
@@ -234,6 +238,20 @@ void GfxDevice::endFrame(VkCommandBuffer cmd, const GPUImage& drawImage, const E
}
}
// prepare for present
// vkutil::transitionImage(cmd, swapchainImage, swapchainLayout, VK_IMAGE_LAYOUT_PRESENT_SRC_KHR);
// swapchainLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR;
if (props.imguiPass) {
props.imguiPass->render(
cmd,
swapchainImage,
getSwapchainImageView(static_cast<std::uint32_t>(swapchainImageIndex)),
swapchainLayout,
getSwapchainExtent()
);
}
// prepare for present
vkutil::transitionImage(cmd, swapchainImage, swapchainLayout, VK_IMAGE_LAYOUT_PRESENT_SRC_KHR);
swapchainLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR;