Skip to content

Commit

Permalink
reformat
Browse files Browse the repository at this point in the history
  • Loading branch information
Stepanov Igor committed Dec 27, 2024
1 parent c1b3de1 commit 52d48dc
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
6 changes: 3 additions & 3 deletions src/engine/Profiler.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include "Profiler.hpp"

#if defined(VOXELENGINE_PROFILER)
#if defined(VOXELENGINE_TRACY_PROFILER)
void* operator new(std ::size_t count) {
#if defined(VOXELENGINE_TRACY_PROFILER)
void* operator new(std::size_t count) {
auto ptr = malloc(count);
TracyAlloc(ptr, count);
return ptr;
Expand All @@ -11,5 +11,5 @@ void operator delete(void* ptr) noexcept {
TracyFree(ptr);
free(ptr);
}
#endif
#endif
#endif
44 changes: 22 additions & 22 deletions src/engine/Profiler.hpp
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
#pragma once

#if defined(VOXELENGINE_PROFILER)
#if defined(VOXELENGINE_TRACY_PROFILER)
#include <Tracy/Tracy.hpp>
#if defined(VOXELENGINE_TRACY_PROFILER)
#include <Tracy/Tracy.hpp>

#define VOXELENGINE_PROFILE ZoneScoped
#define VOXELENGINE_PROFILE_FRAME FrameMark
#define VOXELENGINE_PROFILE_SECTION(name) ZoneScopedN(name)
#define VOXELENGINE_PROFILE_TAG(tag) ZoneText(tag, strlen(tag))
#define VOXELENGINE_PROFILE_LOG(text) TracyMessage(text, strlen(text))
#define VOXELENGINE_PROFILE_VALUE(text, value) TracyPlot(text, value)
/// @warning Tracy can capture only one context
#define VOXELENGINE_GPU_CONTEXT TracyGpuContext
#define VOXELENGINE_GPU_ZONE(name) TracyGpuZone(name)
#else
#error "No active profiler"
#endif
#define VOXELENGINE_PROFILE ZoneScoped
#define VOXELENGINE_PROFILE_FRAME FrameMark
#define VOXELENGINE_PROFILE_SECTION(name) ZoneScopedN(name)
#define VOXELENGINE_PROFILE_TAG(tag) ZoneText(tag, strlen(tag))
#define VOXELENGINE_PROFILE_LOG(text) TracyMessage(text, strlen(text))
#define VOXELENGINE_PROFILE_VALUE(text, value) TracyPlot(text, value)
/// @warning Tracy can capture only one context
#define VOXELENGINE_GPU_CONTEXT TracyGpuContext
#define VOXELENGINE_GPU_ZONE(name) TracyGpuZone(name)
#else
#error "No active profiler"
#endif
// You can implement any your profiler with adding VOXELENGINE_{NAME}_PROFILER
// macros
#else
#define VOXELENGINE_PROFILE
#define VOXELENGINE_PROFILE_FRAME
#define VOXELENGINE_PROFILE_SECTION(name)
#define VOXELENGINE_PROFILE_TAG(tag)
#define VOXELENGINE_PROFILE_LOG(text)
#define VOXELENGINE_PROFILE_VALUE(text, value)
#define VOXELENGINE_GPU_CONTEXT
#define VOXELENGINE_GPU_ZONE(name)
#define VOXELENGINE_PROFILE
#define VOXELENGINE_PROFILE_FRAME
#define VOXELENGINE_PROFILE_SECTION(name)
#define VOXELENGINE_PROFILE_TAG(tag)
#define VOXELENGINE_PROFILE_LOG(text)
#define VOXELENGINE_PROFILE_VALUE(text, value)
#define VOXELENGINE_GPU_CONTEXT
#define VOXELENGINE_GPU_ZONE(name)
#endif

0 comments on commit 52d48dc

Please sign in to comment.