Make tracy optional
This commit is contained in:
@@ -15,7 +15,10 @@
|
|||||||
#include <thread>
|
#include <thread>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
|
||||||
#include <tracy/Tracy.hpp>
|
#if __has_include("tracy/Tracy.hpp")
|
||||||
|
#include <tracy/Tracy.hpp>
|
||||||
|
#define HAS_TRACY
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace OpenVulkano
|
namespace OpenVulkano
|
||||||
{
|
{
|
||||||
@@ -23,7 +26,10 @@ namespace OpenVulkano
|
|||||||
: app(app), renderApi(renderApi)
|
: app(app), renderApi(renderApi)
|
||||||
{
|
{
|
||||||
Utils::SetThreadName("Main");
|
Utils::SetThreadName("Main");
|
||||||
|
#ifdef HAS_TRACY
|
||||||
ZoneScoped;
|
ZoneScoped;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
Logger::SetupLogger();
|
Logger::SetupLogger();
|
||||||
if (!app)
|
if (!app)
|
||||||
@@ -43,7 +49,9 @@ namespace OpenVulkano
|
|||||||
: app(app), renderApi(renderApi)
|
: app(app), renderApi(renderApi)
|
||||||
{
|
{
|
||||||
Utils::SetThreadName("Main");
|
Utils::SetThreadName("Main");
|
||||||
|
#ifdef HAS_TRACY
|
||||||
ZoneScoped;
|
ZoneScoped;
|
||||||
|
#endif
|
||||||
|
|
||||||
Logger::SetupLogger();
|
Logger::SetupLogger();
|
||||||
if (!app)
|
if (!app)
|
||||||
@@ -96,7 +104,9 @@ namespace OpenVulkano
|
|||||||
|
|
||||||
void GraphicsAppManager::StartUp()
|
void GraphicsAppManager::StartUp()
|
||||||
{
|
{
|
||||||
|
#ifdef HAS_TRACY
|
||||||
ZoneScoped;
|
ZoneScoped;
|
||||||
|
#endif
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Logger::MANAGER->info("Initializing ...");
|
Logger::MANAGER->info("Initializing ...");
|
||||||
@@ -129,8 +139,11 @@ namespace OpenVulkano
|
|||||||
|
|
||||||
void GraphicsAppManager::LoopTick()
|
void GraphicsAppManager::LoopTick()
|
||||||
{
|
{
|
||||||
|
#ifdef HAS_TRACY
|
||||||
FrameMark;
|
FrameMark;
|
||||||
ZoneScoped;
|
ZoneScoped;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (platform) platform->Tick();
|
if (platform) platform->Tick();
|
||||||
if (paused)
|
if (paused)
|
||||||
{ // The rendering is paused
|
{ // The rendering is paused
|
||||||
@@ -152,7 +165,9 @@ namespace OpenVulkano
|
|||||||
|
|
||||||
void GraphicsAppManager::ShutDown()
|
void GraphicsAppManager::ShutDown()
|
||||||
{
|
{
|
||||||
|
#ifdef HAS_TRACY
|
||||||
ZoneScoped;
|
ZoneScoped;
|
||||||
|
#endif
|
||||||
Logger::MANAGER->info("Shutting down ...");
|
Logger::MANAGER->info("Shutting down ...");
|
||||||
app->Close();
|
app->Close();
|
||||||
renderer->Close();
|
renderer->Close();
|
||||||
|
|||||||
Reference in New Issue
Block a user