#pragma once
#include <cstdint>

// Convenience macros for Tracy profiling zones.
// No-op when TRACY_ENABLE is not defined.
// Usage: FN_ZONE("my function") at the top of a scope.

#ifdef TRACY_ENABLE
#include "tracy/Tracy.hpp"

// Named zone (appears as-is in Tracy timeline)
#define FN_ZONE(name)              ZoneScopedN(name)
// Named zone with explicit ARGB color
#define FN_ZONE_COLOR(name, color) ZoneScopedNC(name, color)
// Frame boundary marker
#define FN_FRAME_MARK              FrameMark
// Plot a scalar value in Tracy's plot view
#define FN_PLOT(name, val)         TracyPlot(name, val)

#else

#define FN_ZONE(name)              (void)0
#define FN_ZONE_COLOR(name, color) (void)0
#define FN_FRAME_MARK              (void)0
#define FN_PLOT(name, val)         (void)0

#endif

// Preset ARGB colors for common zone categories.
namespace fn_tracy {
    constexpr uint32_t COLOR_RENDER  = 0x2196F3; // blue
    constexpr uint32_t COLOR_UPDATE  = 0x4CAF50; // green
    constexpr uint32_t COLOR_IO      = 0xFF9800; // orange
    constexpr uint32_t COLOR_NETWORK = 0xF44336; // red
    constexpr uint32_t COLOR_COMPUTE = 0x9C27B0; // purple
}
