Compare commits
No commits in common. "f05e1605d6d07f225cd924539eaa498c61705ccb" and "2e111c13e92005129ca6f22cbe773ec9ed35cbd2" have entirely different histories.
f05e1605d6
...
2e111c13e9
1
.clangd
1
.clangd
@ -6,7 +6,6 @@ CompileFlags:
|
|||||||
- -DINITIALIZERS_IMPL
|
- -DINITIALIZERS_IMPL
|
||||||
- -DPIPELINES_IMPL
|
- -DPIPELINES_IMPL
|
||||||
- -DDESCRIPTORS_IMPL
|
- -DDESCRIPTORS_IMPL
|
||||||
- -DCALLBACK_IMPL
|
|
||||||
- -DTIMER_IMPL
|
- -DTIMER_IMPL
|
||||||
- -DLOGGER_IMPL
|
- -DLOGGER_IMPL
|
||||||
- -DSERVER_INIT_IMPL
|
- -DSERVER_INIT_IMPL
|
||||||
|
|||||||
@ -18,24 +18,6 @@ if (GIT_FOUND)
|
|||||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||||
ERROR_QUIET
|
ERROR_QUIET
|
||||||
)
|
)
|
||||||
execute_process(
|
|
||||||
COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD
|
|
||||||
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
|
|
||||||
OUTPUT_VARIABLE GIT_BRANCH
|
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
||||||
ERROR_QUIET
|
|
||||||
)
|
|
||||||
set(GIT_DEPS "${CMAKE_SOURCE_DIR}/.git/HEAD")
|
|
||||||
if(GIT_BRANCH AND EXISTS "${CMAKE_SOURCE_DIR}/.git/refs/heads/${GIT_BRANCH}")
|
|
||||||
list(APPEND GIT_DEPS "${CMAKE_SOURCE_DIR}/.git/refs/heads/${GIT_BRANCH}")
|
|
||||||
endif()
|
|
||||||
# Optionnel : index pour les modifications stagées
|
|
||||||
if(EXISTS "${CMAKE_SOURCE_DIR}/.git/index")
|
|
||||||
list(APPEND GIT_DEPS "${CMAKE_SOURCE_DIR}/.git/index")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# On définit la propriété pour le répertoire source.
|
|
||||||
set_directory_properties(PROPERTIES CMAKE_CONFIGURE_DEPENDS "${GIT_DEPS}")
|
|
||||||
endif()
|
endif()
|
||||||
# Fallback
|
# Fallback
|
||||||
|
|
||||||
|
|||||||
@ -127,7 +127,6 @@ function ( addBinary BINARY_NAME )
|
|||||||
${CMAKE_SOURCE_DIR}/src/imgui/imgui_draw.cpp
|
${CMAKE_SOURCE_DIR}/src/imgui/imgui_draw.cpp
|
||||||
${CMAKE_SOURCE_DIR}/src/imgui/imgui_tables.cpp
|
${CMAKE_SOURCE_DIR}/src/imgui/imgui_tables.cpp
|
||||||
${CMAKE_SOURCE_DIR}/src/imgui/imgui_widgets.cpp
|
${CMAKE_SOURCE_DIR}/src/imgui/imgui_widgets.cpp
|
||||||
${CMAKE_SOURCE_DIR}/src/imgui/imgui_demo.cpp
|
|
||||||
|
|
||||||
${CMAKE_SOURCE_DIR}/src/imgui/backends/imgui_impl_glfw.cpp
|
${CMAKE_SOURCE_DIR}/src/imgui/backends/imgui_impl_glfw.cpp
|
||||||
${CMAKE_SOURCE_DIR}/src/imgui/backends/imgui_impl_vulkan.cpp
|
${CMAKE_SOURCE_DIR}/src/imgui/backends/imgui_impl_vulkan.cpp
|
||||||
|
|||||||
@ -109,15 +109,10 @@ class Engine {
|
|||||||
uint32_t width,
|
uint32_t width,
|
||||||
uint32_t height
|
uint32_t height
|
||||||
);
|
);
|
||||||
void buildImgui();
|
|
||||||
void destroySwapchain();
|
void destroySwapchain();
|
||||||
void drawBackground(
|
void drawBackground(
|
||||||
VkCommandBuffer cmd
|
VkCommandBuffer cmd
|
||||||
);
|
);
|
||||||
void drawImgui(
|
|
||||||
VkCommandBuffer cmd,
|
|
||||||
VkImageView targetImageView
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
@ -330,19 +325,6 @@ void Engine::draw() {
|
|||||||
_swapchainExtent
|
_swapchainExtent
|
||||||
);
|
);
|
||||||
|
|
||||||
// Set the swapchain image layout to Attachment Optimal so ImGui can write on top of it
|
|
||||||
vkutil::transitionImage(
|
|
||||||
cmd,
|
|
||||||
_swapchainImages[swapchainImageIndex],
|
|
||||||
VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
|
|
||||||
VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL
|
|
||||||
);
|
|
||||||
|
|
||||||
drawImgui(
|
|
||||||
cmd,
|
|
||||||
_swapchainImageViews[swapchainImageIndex]
|
|
||||||
);
|
|
||||||
|
|
||||||
// Uses the present layout to display into the screen
|
// Uses the present layout to display into the screen
|
||||||
vkutil::transitionImage(
|
vkutil::transitionImage(
|
||||||
cmd,
|
cmd,
|
||||||
@ -402,7 +384,6 @@ void Engine::run() {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
buildImgui();
|
|
||||||
draw();
|
draw();
|
||||||
}
|
}
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
@ -423,7 +404,6 @@ void Engine::initRender() {
|
|||||||
initSyncStructures();
|
initSyncStructures();
|
||||||
initDescriptors();
|
initDescriptors();
|
||||||
initPipelines();
|
initPipelines();
|
||||||
initImgui();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Engine::initVulkan() {
|
void Engine::initVulkan() {
|
||||||
@ -910,7 +890,7 @@ void Engine::initImgui() {
|
|||||||
.PipelineRenderingCreateInfo {
|
.PipelineRenderingCreateInfo {
|
||||||
.sType = VK_STRUCTURE_TYPE_PIPELINE_RENDERING_CREATE_INFO_KHR,
|
.sType = VK_STRUCTURE_TYPE_PIPELINE_RENDERING_CREATE_INFO_KHR,
|
||||||
.colorAttachmentCount = 1,
|
.colorAttachmentCount = 1,
|
||||||
.pColorAttachmentFormats = &_drawImage.imageFormat
|
.pColorAttachmentFormats = &_swapchainImageFormat
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
.UseDynamicRendering = true
|
.UseDynamicRendering = true
|
||||||
@ -918,7 +898,7 @@ void Engine::initImgui() {
|
|||||||
|
|
||||||
ImGui_ImplVulkan_Init(&initInfo);
|
ImGui_ImplVulkan_Init(&initInfo);
|
||||||
|
|
||||||
_mainDeletionQueue.pushFunction([this, imguiPool]() {
|
_mainDeletionQueue.pushFonction([this]() {
|
||||||
ImGui_ImplVulkan_Shutdown();
|
ImGui_ImplVulkan_Shutdown();
|
||||||
vkDestroyDescriptorPool(
|
vkDestroyDescriptorPool(
|
||||||
_device,
|
_device,
|
||||||
@ -975,19 +955,6 @@ void Engine::createSwapchain(
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void Engine::buildImgui() {
|
|
||||||
// New frames
|
|
||||||
ImGui_ImplVulkan_NewFrame();
|
|
||||||
ImGui_ImplGlfw_NewFrame();
|
|
||||||
ImGui::NewFrame();
|
|
||||||
|
|
||||||
// Main ImGui things
|
|
||||||
ImGui::ShowDemoWindow();
|
|
||||||
|
|
||||||
// Finish everything
|
|
||||||
ImGui::Render();
|
|
||||||
}
|
|
||||||
|
|
||||||
void Engine::destroySwapchain() {
|
void Engine::destroySwapchain() {
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
fmt::println("[Engine:Cleanup] Destroying the swapchain...");
|
fmt::println("[Engine:Cleanup] Destroying the swapchain...");
|
||||||
@ -1044,38 +1011,6 @@ void Engine::drawBackground(
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Engine::drawImgui(
|
|
||||||
VkCommandBuffer cmd,
|
|
||||||
VkImageView targetImageView
|
|
||||||
) {
|
|
||||||
VkRenderingAttachmentInfo colorAttachment {
|
|
||||||
vkinit::attachmentInfo(
|
|
||||||
targetImageView,
|
|
||||||
nullptr,
|
|
||||||
VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL
|
|
||||||
)
|
|
||||||
};
|
|
||||||
VkRenderingInfo renderInfo {
|
|
||||||
vkinit::renderingInfo(
|
|
||||||
_swapchainExtent,
|
|
||||||
&colorAttachment,
|
|
||||||
nullptr
|
|
||||||
)
|
|
||||||
};
|
|
||||||
|
|
||||||
vkCmdBeginRendering(
|
|
||||||
cmd,
|
|
||||||
&renderInfo
|
|
||||||
);
|
|
||||||
|
|
||||||
ImGui_ImplVulkan_RenderDrawData(
|
|
||||||
ImGui::GetDrawData(),
|
|
||||||
cmd
|
|
||||||
);
|
|
||||||
|
|
||||||
vkCmdEndRendering(cmd);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Engine::immediateSubmit(
|
void Engine::immediateSubmit(
|
||||||
std::function<
|
std::function<
|
||||||
void(VkCommandBuffer cmd)
|
void(VkCommandBuffer cmd)
|
||||||
@ -1145,7 +1080,5 @@ void Engine::immediateSubmit(
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -2,7 +2,6 @@
|
|||||||
#define INITIALIZERS_H
|
#define INITIALIZERS_H
|
||||||
// Normal header
|
// Normal header
|
||||||
#include "Common/Types.h"
|
#include "Common/Types.h"
|
||||||
#include <vulkan/vulkan_core.h>
|
|
||||||
|
|
||||||
namespace vkinit {
|
namespace vkinit {
|
||||||
VkCommandPoolCreateInfo commandPoolCreateInfo(
|
VkCommandPoolCreateInfo commandPoolCreateInfo(
|
||||||
@ -58,17 +57,6 @@ namespace vkinit {
|
|||||||
VkImageAspectFlags aspectFlags
|
VkImageAspectFlags aspectFlags
|
||||||
);
|
);
|
||||||
|
|
||||||
VkRenderingAttachmentInfo attachmentInfo(
|
|
||||||
VkImageView view,
|
|
||||||
VkClearValue* clear,
|
|
||||||
VkImageLayout layout /*= VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL*/
|
|
||||||
);
|
|
||||||
|
|
||||||
VkRenderingInfo renderingInfo(
|
|
||||||
VkExtent2D renderExtent,
|
|
||||||
VkRenderingAttachmentInfo* colorAttachment,
|
|
||||||
VkRenderingAttachmentInfo* depthAttachment
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -254,52 +242,6 @@ namespace vkinit {
|
|||||||
|
|
||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
|
|
||||||
VkRenderingAttachmentInfo attachmentInfo(
|
|
||||||
VkImageView view,
|
|
||||||
VkClearValue* clear,
|
|
||||||
VkImageLayout layout /*= VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL*/
|
|
||||||
) {
|
|
||||||
VkRenderingAttachmentInfo colorAttachment {
|
|
||||||
.sType = VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_INFO,
|
|
||||||
.pNext = nullptr,
|
|
||||||
.imageView = view,
|
|
||||||
.imageLayout = layout,
|
|
||||||
.loadOp = clear ? VK_ATTACHMENT_LOAD_OP_CLEAR : VK_ATTACHMENT_LOAD_OP_LOAD,
|
|
||||||
.storeOp = VK_ATTACHMENT_STORE_OP_STORE
|
|
||||||
};
|
|
||||||
|
|
||||||
if (clear) {
|
|
||||||
colorAttachment.clearValue = *clear;
|
|
||||||
}
|
|
||||||
|
|
||||||
return colorAttachment;
|
|
||||||
}
|
|
||||||
|
|
||||||
VkRenderingInfo renderingInfo(
|
|
||||||
VkExtent2D renderExtent,
|
|
||||||
VkRenderingAttachmentInfo* colorAttachment,
|
|
||||||
VkRenderingAttachmentInfo* depthAttachment
|
|
||||||
) {
|
|
||||||
VkRenderingInfo renderInfo {
|
|
||||||
.sType = VK_STRUCTURE_TYPE_RENDERING_INFO,
|
|
||||||
.pNext = nullptr,
|
|
||||||
.renderArea = VkRect2D {
|
|
||||||
VkOffset2D {
|
|
||||||
0,
|
|
||||||
0
|
|
||||||
}, renderExtent
|
|
||||||
},
|
|
||||||
.layerCount = 1,
|
|
||||||
.colorAttachmentCount = 1,
|
|
||||||
.pColorAttachments = colorAttachment,
|
|
||||||
.pDepthAttachment = depthAttachment,
|
|
||||||
.pStencilAttachment = nullptr
|
|
||||||
};
|
|
||||||
return renderInfo;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user