Some cleanup for optimization stuff

This commit is contained in:
2024-02-22 23:13:43 -05:00
parent 5a476e0fe2
commit 9d75e182d6
6 changed files with 12 additions and 6 deletions

View File

@@ -4,7 +4,7 @@ string(TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_UPPER_BUILD_TYPE)
message("-- Cmake upper: ${CMAKE_UPPER_BUILD_TYPE}")
if (CMAKE_UPPER_BUILD_TYPE STREQUAL "DEBUG")
if (CMAKE_UPPER_BUILD_TYPE STREQUAL "DEBUG" OR CMAKE_UPPER_BUILD_TYPE STREQUAL "RELWITHDEBINFO")
set(TRACY_ENABLE ON)
set(TRACY_ON_DEMAND ON)
endif ()

View File

@@ -114,7 +114,7 @@
set(FGL_OPTIMIZATION_FLAGS_RELEASE "-O2 -s -fdevirtualize-at-ltrans -fdevirtualize-speculatively -funroll-loops") # System agonistc flags
set(FGL_OPTIMIZATION_FLAGS_DEBUG "-O0 -g -fstrict-aliasing -fno-omit-frame-pointer -ftrapv -fverbose-asm -femit-class-debug-always") # Debug flags
set(FGL_OPTIMIZATION_FLAGS_SYSTEM "-march=native -flto=auto -fdeclone-ctor-dtor -fgcse -fgcse-las -fgcse-sm -ftree-loop-im -fivopts -ftree-loop-ivcanon -fira-hoist-pressure -fsched-pressure -fsched-spec-load -fipa-pta -s -ffat-lto-objects -fno-enforce-eh-specs -fstrict-enums") # System specific flags. Probably not portable
set(FGL_OPTIMIZATION_FLAGS_RELWITHDEBINFO "-O2 -g -fdevirtualize-at-ltrans -fdevirtualize-speculatively -fdeclone-ctor-dtor -funroll-loops")
set(FGL_OPTIMIZATION_FLAGS_RELWITHDEBINFO "-O2 -s -fdevirtualize-at-ltrans -fdevirtualize-speculatively -fdeclone-ctor-dtor -funroll-loops")
# Final sets
set(FGL_FLAGS "${FGL_CONFIG} ${FGL_OPTIMIZATION_FLAGS_${UPPER_BUILD_TYPE}} ${FLG_WARNINGS}" PARENT_SCOPE) # Flags for our shit

View File

@@ -26,10 +26,12 @@ target_include_directories(FGLEngine PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/..)
set_target_properties(FGLEngine PROPERTIES COMPILE_FLAGS ${FGL_FLAGS})
string(TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_UPPER_BUILD_TYPE)
if (CMAKE_UPPER_BUILD_TYPE STREQUAL "DEBUG")
if (CMAKE_UPPER_BUILD_TYPE STREQUAL "DEBUG" OR CMAKE_UPPER_BUILD_TYPE STREQUAL "RELWITHDEBINFO")
target_compile_definitions(FGLEngine PRIVATE ENABLE_IMGUI=1)
target_compile_definitions(FGLEngine PRIVATE ENABLE_IMGUI_DRAWERS=1)
else ()
target_compile_definitions(FGLEngine PRIVATE ENABLE_IMGUI=0)
target_compile_definitions(FGLEngine PRIVATE ENABLE_IMGUI_DRAWERS=0)
endif ()
#GLM settings

View File

@@ -10,7 +10,7 @@
#include "engine/primitives/Vector.hpp"
#include "tracy_colors.hpp"
#ifndef NDEBUG
#if ENABLE_IMGUI_DRAWERS
namespace fgl::engine::debug
{

View File

@@ -26,7 +26,11 @@ namespace fgl::engine
} // namespace fgl::engine
#ifndef NDEBUG
#ifndef ENABLE_IMGUI_DRAWERS
#define ENABLE_IMGUI_DRAWERS 0
#endif
#if ENABLE_IMGUI_DRAWERS
namespace fgl::engine::debug
{

View File

@@ -173,7 +173,7 @@ namespace fgl::engine
cmd.firstInstance = model_matrices.size();
auto matricies { std::move( itter.second ) };
std::sort( matricies.begin(), matricies.end(), sortFunc );
//std::sort( matricies.begin(), matricies.end(), sortFunc );
draw_commands.emplace_back( cmd );
model_matrices.insert( model_matrices.end(), matricies.begin(), matricies.end() );