Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Added tracy profiler.
  • Loading branch information
MrDrElliot committed Feb 12, 2026
commit 2c01f860d51f3dfa87b1693362a3a16b20e4bfe2
14 changes: 11 additions & 3 deletions build_scripts/premake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,14 @@ function spartan_project_configuration()
defines { API_CPP_DEFINE }
libdirs { LIBRARY_DIR }

defines
{
"TRACY_ALLOW_SHADOW_WARNING",
"TRACY_ENABLE",
"TRACY_CALLSTACK",
"TRACY_ON_DEMAND",
}

files {
SOURCE_DIR .. "/**.h", SOURCE_DIR .. "/**.cpp",
SOURCE_DIR .. "/**.hpp", SOURCE_DIR .. "/**.inl",
Expand All @@ -105,7 +113,7 @@ function spartan_project_configuration()
"../third_party/sdl", "../third_party/assimp", "../third_party/physx", "../third_party/free_image",
"../third_party/free_type", "../third_party/compressonator", "../third_party/renderdoc",
"../third_party/meshoptimizer", "../third_party/dxc", "../third_party/nrd", "../third_party/openxr",
"../third_party/lua", "../third_party/lua/lua"
"../third_party/lua", "../third_party/lua/lua", "../third_party/Tracy/public"
}
linkoptions {
"/LIBPATH:" .. path.getabsolute("../third_party/libraries"),
Expand Down Expand Up @@ -139,7 +147,7 @@ function spartan_project_configuration()
targetname(EXECUTABLE_NAME)
targetdir(TARGET_DIR)
debugdir(TARGET_DIR)
links { "dxcompiler", "assimp", "FreeImageLib", "freetype", "SDL3", "Compressonator_MT", "meshoptimizer", "NRD", "ShaderMakeBlob", "openxr_loader", "lua" }
links { "dxcompiler", "assimp", "FreeImageLib", "freetype", "SDL3", "Compressonator_MT", "meshoptimizer", "NRD", "ShaderMakeBlob", "openxr_loader", "lua", "TracyClient" }
links {
"PhysX_static_64", "PhysXCommon_static_64", "PhysXFoundation_static_64", "PhysXExtensions_static_64",
"PhysXPvdSDK_static_64", "PhysXCooking_static_64", "PhysXVehicle2_static_64", "PhysXCharacterKinematic_static_64"
Expand All @@ -162,7 +170,7 @@ function spartan_project_configuration()
links { "dxcompiler" }

filter { "configurations:debug", "system:windows" }
links { "assimp_debug", "FreeImageLib_debug", "freetype_debug", "SDL3_debug", "Compressonator_MT_debug", "meshoptimizer_debug", "NRD_debug", "ShaderMakeBlob_debug", "openxr_loader_debug", "lua_debug" }
links { "assimp_debug", "FreeImageLib_debug", "freetype_debug", "SDL3_debug", "Compressonator_MT_debug", "meshoptimizer_debug", "NRD_debug", "ShaderMakeBlob_debug", "openxr_loader_debug", "lua_debug", "TracyClient", }
links {
"PhysX_static_64_debug", "PhysXCommon_static_64_debug", "PhysXFoundation_static_64_debug", "PhysXExtensions_static_64_debug",
"PhysXPvdSDK_static_64_debug", "PhysXCooking_static_64_debug", "PhysXVehicle2_static_64_debug", "PhysXCharacterKinematic_static_64_debug"
Expand Down
6 changes: 6 additions & 0 deletions source/editor/Editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//= INCLUDES ====================================
#include "pch.h"
#include "Editor.h"

#include <tracy/Tracy.hpp>

#include "GeneralWindows.h"
#include "Widgets/MenuBar.h"
#include "Core/Engine.h"
Expand Down Expand Up @@ -125,6 +128,8 @@ void Editor::Tick()
// main loop
while (!spartan::Window::WantsToClose())
{
FrameMark;
ZoneScoped;
bool render_editor = spartan::Engine::IsFlagSet(spartan::EngineMode::EditorVisible);

// logic
Expand All @@ -144,6 +149,7 @@ void Editor::Tick()
{
BeginWindow();

ZoneScopedN("Tick Widgets");
for (shared_ptr<Widget>& widget : m_widgets)
{
widget->Tick();
Expand Down
12 changes: 12 additions & 0 deletions source/editor/Widgets/MenuBar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,18 @@ namespace
cursor_pos_x
);

// renderdoc button
static auto tracy_visible = [](Widget*) { return false; };
static auto tracy_press = [](Widget*)
{
spartan::FileSystem::OpenUrl(std::filesystem::absolute("../third_party/Tracy/tracy-profiler.exe").generic_string().c_str());
};
toolbar_button(spartan::ResourceCache::GetIcon(spartan::IconType::Compressed), "Opens the tracy profiler",
tracy_visible,
tracy_press,
nullptr
);

// renderdoc button
static auto renderdoc_visible = [](Widget*) { return false; };
static auto renderdoc_press = [](Widget*)
Expand Down
Loading
Loading