Add imgui
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user