Cleanup debug stuff

This commit is contained in:
2024-01-24 10:58:46 -05:00
parent d2387cfb81
commit e0fa4c947d
4 changed files with 11 additions and 16 deletions

View File

@@ -25,5 +25,9 @@ target_link_libraries(FGLEngine PUBLIC Vulkan::Vulkan glfw glm FGLImGui Tracy::T
target_include_directories(FGLEngine PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/..)
set_target_properties(FGLEngine PROPERTIES COMPILE_FLAGS ${FGL_FLAGS})
target_compile_definitions(FGLEngine PRIVATE TRACY_ENABLE=1)
target_compile_definitions(FGLEngine PRIVATE ENABLE_IMGUI=1)
string(TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_UPPER_BUILD_TYPE)
if (CMAKE_UPPER_BUILD_TYPE STREQUAL "DEBUG")
target_compile_definitions(FGLEngine PRIVATE ENABLE_IMGUI=1)
else ()
target_compile_definitions(FGLEngine PRIVATE ENABLE_IMGUI=0)
endif ()

View File

@@ -40,7 +40,7 @@ namespace fgl::engine
{
using namespace fgl::literals::size_literals;
initGlobalStagingBuffer( 256_MiB );
#ifdef ENABLE_IMGUI
#if ENABLE_IMGUI
initImGui();
#endif
loadGameObjects();
@@ -138,11 +138,8 @@ namespace fgl::engine
draw_parameter_buffers[ frame_index ],
m_renderer.getGBufferDescriptor( frame_index ) };
#ifdef TRACY_ENABLE
#if TRACY_ENABLE
auto& tracy_ctx { frame_info.tracy_ctx };
#endif
#endif
CameraInfo current_camera_info { .projection = camera.getProjectionMatrix(),
@@ -151,7 +148,7 @@ namespace fgl::engine
camera_info[ frame_index ] = current_camera_info;
#ifdef ENABLE_IMGUI
#if ENABLE_IMGUI
{
ZoneScopedN( "ImGui recording" );
ImGui_ImplVulkan_NewFrame();
@@ -331,12 +328,10 @@ namespace fgl::engine
m_entity_renderer.pass( frame_info );
#ifdef ENABLE_IMGUI
#if ENABLE_IMGUI
{
#ifdef TRACY_ENABLE
#if TRACY_ENABLE
TracyVkZone( tracy_ctx, command_buffer, "ImGui Rendering" );
#endif
#endif
ImGui_ImplVulkan_RenderDrawData( data, command_buffer );
}
@@ -344,10 +339,8 @@ namespace fgl::engine
m_renderer.endSwapchainRendererPass( command_buffer );
#ifdef TRACY_ENABLE
#if TRACY_ENABLE
TracyVkCollect( frame_info.tracy_ctx, command_buffer );
#endif
#endif
m_renderer.endFrame();
@@ -516,7 +509,7 @@ namespace fgl::engine
EngineContext::~EngineContext()
{
#ifdef ENABLE_IMGUI
#if ENABLE_IMGUI
cleanupImGui();
#endif
}

View File

@@ -50,7 +50,6 @@ namespace fgl::engine
!= vk::Result::eSuccess )
throw std::runtime_error( "Failed to allocate command buffers" );
#ifdef TRACY_ENABLE
#if TRACY_ENABLE
m_tracy_ctx.resize( SwapChain::MAX_FRAMES_IN_FLIGHT );
@@ -62,7 +61,6 @@ namespace fgl::engine
m_tracy_ctx[ i ] =
TracyVkContext( phy_dev, dev, Device::getInstance().graphicsQueue(), m_command_buffer[ i ] );
}
#endif
#endif
}

View File

@@ -61,7 +61,7 @@ namespace fgl::engine
TracyVkCtx getCurrentTracyCTX() const
{
#ifdef TRACY_ENABLE
#if TRACY_ENABLE
return m_tracy_ctx[ current_frame_idx ];
#else
return nullptr;