Fix tracy style errors
This commit is contained in:
parent
32d21757c1
commit
af03554260
@ -6,12 +6,11 @@ when ODIN_OS == .Darwin do foreign import tracy "tracy.dylib"
|
|||||||
when ODIN_OS == .Windows do foreign import tracy "tracy.lib"
|
when ODIN_OS == .Windows do foreign import tracy "tracy.lib"
|
||||||
when ODIN_OS == .Linux do foreign import tracy "tracy.so"
|
when ODIN_OS == .Linux do foreign import tracy "tracy.so"
|
||||||
|
|
||||||
TracyPlotFormatEnum :: enum i32
|
TracyPlotFormatEnum :: enum i32 {
|
||||||
{
|
|
||||||
TracyPlotFormatNumber,
|
TracyPlotFormatNumber,
|
||||||
TracyPlotFormatMemory,
|
TracyPlotFormatMemory,
|
||||||
TracyPlotFormatPercentage,
|
TracyPlotFormatPercentage,
|
||||||
TracyPlotFormatWatt
|
TracyPlotFormatWatt,
|
||||||
}
|
}
|
||||||
|
|
||||||
___tracy_source_location_data :: struct {
|
___tracy_source_location_data :: struct {
|
||||||
@ -74,7 +73,7 @@ ___tracy_gpu_calibration_data :: struct {
|
|||||||
___tracy_gpu_time_sync_data :: struct {
|
___tracy_gpu_time_sync_data :: struct {
|
||||||
gpuTime: i64,
|
gpuTime: i64,
|
||||||
_context: u8, // NOTE(oskar): `context` is a reserved identifier in Odin.
|
_context: u8, // NOTE(oskar): `context` is a reserved identifier in Odin.
|
||||||
};
|
}
|
||||||
|
|
||||||
__tracy_lockable_context_data :: struct {} // NOTE(oskar): opaque
|
__tracy_lockable_context_data :: struct {} // NOTE(oskar): opaque
|
||||||
|
|
||||||
@ -104,27 +103,27 @@ foreign tracy {
|
|||||||
___tracy_emit_zone_color :: proc(ctx: ___tracy_c_zone_context, color: u32) ---
|
___tracy_emit_zone_color :: proc(ctx: ___tracy_c_zone_context, color: u32) ---
|
||||||
___tracy_emit_zone_value :: proc(ctx: ___tracy_c_zone_context, value: u64) ---
|
___tracy_emit_zone_value :: proc(ctx: ___tracy_c_zone_context, value: u64) ---
|
||||||
|
|
||||||
___tracy_emit_gpu_zone_begin :: proc( ___tracy_gpu_zone_begin_data ) ---
|
___tracy_emit_gpu_zone_begin :: proc(_: ___tracy_gpu_zone_begin_data) ---
|
||||||
___tracy_emit_gpu_zone_begin_callstack :: proc( ___tracy_gpu_zone_begin_callstack_data ) ---
|
___tracy_emit_gpu_zone_begin_callstack :: proc(_: ___tracy_gpu_zone_begin_callstack_data) ---
|
||||||
___tracy_emit_gpu_zone_begin_alloc :: proc( ___tracy_gpu_zone_begin_data ) ---
|
___tracy_emit_gpu_zone_begin_alloc :: proc(_: ___tracy_gpu_zone_begin_data) ---
|
||||||
___tracy_emit_gpu_zone_begin_alloc_callstack :: proc( ___tracy_gpu_zone_begin_callstack_data ) ---
|
___tracy_emit_gpu_zone_begin_alloc_callstack :: proc(_: ___tracy_gpu_zone_begin_callstack_data) ---
|
||||||
___tracy_emit_gpu_zone_end :: proc( ___tracy_gpu_zone_end_data ) ---
|
___tracy_emit_gpu_zone_end :: proc(_: ___tracy_gpu_zone_end_data) ---
|
||||||
___tracy_emit_gpu_time :: proc( ___tracy_gpu_time_data ) ---
|
___tracy_emit_gpu_time :: proc(_: ___tracy_gpu_time_data) ---
|
||||||
___tracy_emit_gpu_new_context :: proc( ___tracy_gpu_new_context_data ) ---
|
___tracy_emit_gpu_new_context :: proc(_: ___tracy_gpu_new_context_data) ---
|
||||||
___tracy_emit_gpu_context_name :: proc( ___tracy_gpu_context_name_data ) ---
|
___tracy_emit_gpu_context_name :: proc(_: ___tracy_gpu_context_name_data) ---
|
||||||
___tracy_emit_gpu_calibration :: proc( ___tracy_gpu_calibration_data ) ---
|
___tracy_emit_gpu_calibration :: proc(_: ___tracy_gpu_calibration_data) ---
|
||||||
___tracy_emit_gpu_time_sync :: proc( ___tracy_gpu_time_sync_data ) ---
|
___tracy_emit_gpu_time_sync :: proc(_: ___tracy_gpu_time_sync_data) ---
|
||||||
|
|
||||||
___tracy_emit_gpu_zone_begin_serial :: proc( ___tracy_gpu_zone_begin_data ) ---
|
___tracy_emit_gpu_zone_begin_serial :: proc(_: ___tracy_gpu_zone_begin_data) ---
|
||||||
___tracy_emit_gpu_zone_begin_callstack_serial :: proc( ___tracy_gpu_zone_begin_callstack_data ) ---
|
___tracy_emit_gpu_zone_begin_callstack_serial :: proc(_: ___tracy_gpu_zone_begin_callstack_data) ---
|
||||||
___tracy_emit_gpu_zone_begin_alloc_serial :: proc( ___tracy_gpu_zone_begin_data ) ---
|
___tracy_emit_gpu_zone_begin_alloc_serial :: proc(_: ___tracy_gpu_zone_begin_data) ---
|
||||||
___tracy_emit_gpu_zone_begin_alloc_callstack_serial :: proc( ___tracy_gpu_zone_begin_callstack_data ) ---
|
___tracy_emit_gpu_zone_begin_alloc_callstack_serial :: proc(_: ___tracy_gpu_zone_begin_callstack_data) ---
|
||||||
___tracy_emit_gpu_zone_end_serial :: proc( ___tracy_gpu_zone_end_data ) ---
|
___tracy_emit_gpu_zone_end_serial :: proc(_: ___tracy_gpu_zone_end_data) ---
|
||||||
___tracy_emit_gpu_time_serial :: proc( ___tracy_gpu_time_data ) ---
|
___tracy_emit_gpu_time_serial :: proc(_: ___tracy_gpu_time_data) ---
|
||||||
___tracy_emit_gpu_new_context_serial :: proc( ___tracy_gpu_new_context_data ) ---
|
___tracy_emit_gpu_new_context_serial :: proc(_: ___tracy_gpu_new_context_data) ---
|
||||||
___tracy_emit_gpu_context_name_serial :: proc( ___tracy_gpu_context_name_data ) ---
|
___tracy_emit_gpu_context_name_serial :: proc(_: ___tracy_gpu_context_name_data) ---
|
||||||
___tracy_emit_gpu_calibration_serial :: proc( ___tracy_gpu_calibration_data ) ---
|
___tracy_emit_gpu_calibration_serial :: proc(_: ___tracy_gpu_calibration_data) ---
|
||||||
___tracy_emit_gpu_time_sync_serial :: proc( ___tracy_gpu_time_sync_data ) ---
|
___tracy_emit_gpu_time_sync_serial :: proc(_: ___tracy_gpu_time_sync_data) ---
|
||||||
|
|
||||||
___tracy_connected :: proc() -> b32 ---
|
___tracy_connected :: proc() -> b32 ---
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
package tracy
|
package tracy
|
||||||
|
|
||||||
import "core:c"
|
import "core:c"
|
||||||
import "core:strings"
|
|
||||||
|
|
||||||
TRACY_ENABLE :: #config(TRACY_ENABLE, false)
|
TRACY_ENABLE :: #config(TRACY_ENABLE, false)
|
||||||
TRACY_CALLSTACK :: #config(TRACY_CALLSTACK, 5)
|
TRACY_CALLSTACK :: #config(TRACY_CALLSTACK, 5)
|
||||||
@ -15,10 +14,45 @@ LockCtx :: ^__tracy_lockable_context_data
|
|||||||
// Zone markup
|
// Zone markup
|
||||||
|
|
||||||
// NOTE: These automatically calls ZoneEnd() at end of scope.
|
// NOTE: These automatically calls ZoneEnd() at end of scope.
|
||||||
@(deferred_out=ZoneEnd) Zone :: #force_inline proc(active := true, depth: i32 = TRACY_CALLSTACK, loc := #caller_location) -> (ctx: ZoneCtx) { when TRACY_ENABLE { ctx = ZoneBegin(active, depth, loc) } return }
|
@(deferred_out = ZoneEnd)
|
||||||
@(deferred_out=ZoneEnd) ZoneN :: #force_inline proc(name: string, active := true, depth: i32 = TRACY_CALLSTACK, loc := #caller_location) -> (ctx: ZoneCtx) { when TRACY_ENABLE { ctx = ZoneBegin(active, depth, loc); ZoneName(ctx, name) } return }
|
Zone :: #force_inline proc(
|
||||||
@(deferred_out=ZoneEnd) ZoneC :: #force_inline proc(color: u32, active := true, depth: i32 = TRACY_CALLSTACK, loc := #caller_location) -> (ctx: ZoneCtx) { when TRACY_ENABLE { ctx = ZoneBegin(active, depth, loc); ZoneColor(ctx, color) } return }
|
active := true,
|
||||||
@(deferred_out=ZoneEnd) ZoneNC :: #force_inline proc(name: string, color: u32, active := true, depth: i32 = TRACY_CALLSTACK, loc := #caller_location) -> (ctx: ZoneCtx) { when TRACY_ENABLE { ctx = ZoneBegin(active, depth, loc); ZoneName(ctx, name); ZoneColor(ctx, color) } return }
|
depth: i32 = TRACY_CALLSTACK,
|
||||||
|
loc := #caller_location,
|
||||||
|
) -> (
|
||||||
|
ctx: ZoneCtx,
|
||||||
|
) {when TRACY_ENABLE {ctx = ZoneBegin(active, depth, loc)};return}
|
||||||
|
@(deferred_out = ZoneEnd)
|
||||||
|
ZoneN :: #force_inline proc(
|
||||||
|
name: string,
|
||||||
|
active := true,
|
||||||
|
depth: i32 = TRACY_CALLSTACK,
|
||||||
|
loc := #caller_location,
|
||||||
|
) -> (
|
||||||
|
ctx: ZoneCtx,
|
||||||
|
) {when TRACY_ENABLE {ctx = ZoneBegin(active, depth, loc);ZoneName(ctx, name)};return}
|
||||||
|
@(deferred_out = ZoneEnd)
|
||||||
|
ZoneC :: #force_inline proc(
|
||||||
|
color: u32,
|
||||||
|
active := true,
|
||||||
|
depth: i32 = TRACY_CALLSTACK,
|
||||||
|
loc := #caller_location,
|
||||||
|
) -> (
|
||||||
|
ctx: ZoneCtx,
|
||||||
|
) {when TRACY_ENABLE {ctx = ZoneBegin(active, depth, loc);ZoneColor(ctx, color)};return}
|
||||||
|
@(deferred_out = ZoneEnd)
|
||||||
|
ZoneNC :: #force_inline proc(
|
||||||
|
name: string,
|
||||||
|
color: u32,
|
||||||
|
active := true,
|
||||||
|
depth: i32 = TRACY_CALLSTACK,
|
||||||
|
loc := #caller_location,
|
||||||
|
) -> (
|
||||||
|
ctx: ZoneCtx,
|
||||||
|
) {when TRACY_ENABLE {ctx = ZoneBegin(active, depth, loc)
|
||||||
|
ZoneName(ctx, name)
|
||||||
|
ZoneColor(ctx, color)}
|
||||||
|
return}
|
||||||
|
|
||||||
// Dummy aliases to match C API (only difference is the `depth` parameter,
|
// Dummy aliases to match C API (only difference is the `depth` parameter,
|
||||||
// which we declare as optional for the non-S procs.)
|
// which we declare as optional for the non-S procs.)
|
||||||
@ -27,10 +61,20 @@ ZoneNS :: ZoneN
|
|||||||
ZoneCS :: ZoneC
|
ZoneCS :: ZoneC
|
||||||
ZoneNCS :: ZoneNC
|
ZoneNCS :: ZoneNC
|
||||||
|
|
||||||
@(disabled=!TRACY_ENABLE) ZoneText :: #force_inline proc(ctx: ZoneCtx, text: string) { ___tracy_emit_zone_text(ctx, _sl(text)) }
|
@(disabled = !TRACY_ENABLE)
|
||||||
@(disabled=!TRACY_ENABLE) ZoneName :: #force_inline proc(ctx: ZoneCtx, name: string) { ___tracy_emit_zone_name(ctx, _sl(name)) }
|
ZoneText :: #force_inline proc(ctx: ZoneCtx, text: string) {___tracy_emit_zone_text(
|
||||||
@(disabled=!TRACY_ENABLE) ZoneColor :: #force_inline proc(ctx: ZoneCtx, color: u32) { ___tracy_emit_zone_color(ctx, color) }
|
ctx,
|
||||||
@(disabled=!TRACY_ENABLE) ZoneValue :: #force_inline proc(ctx: ZoneCtx, value: u64) { ___tracy_emit_zone_value(ctx, value) }
|
_sl(text),
|
||||||
|
)}
|
||||||
|
@(disabled = !TRACY_ENABLE)
|
||||||
|
ZoneName :: #force_inline proc(ctx: ZoneCtx, name: string) {___tracy_emit_zone_name(
|
||||||
|
ctx,
|
||||||
|
_sl(name),
|
||||||
|
)}
|
||||||
|
@(disabled = !TRACY_ENABLE)
|
||||||
|
ZoneColor :: #force_inline proc(ctx: ZoneCtx, color: u32) {___tracy_emit_zone_color(ctx, color)}
|
||||||
|
@(disabled = !TRACY_ENABLE)
|
||||||
|
ZoneValue :: #force_inline proc(ctx: ZoneCtx, value: u64) {___tracy_emit_zone_value(ctx, value)}
|
||||||
|
|
||||||
// NOTE: scoped Zone*() procs also exists, no need of calling this directly.
|
// NOTE: scoped Zone*() procs also exists, no need of calling this directly.
|
||||||
ZoneBegin :: proc(active: bool, depth: i32, loc := #caller_location) -> (ctx: ZoneCtx) {
|
ZoneBegin :: proc(active: bool, depth: i32, loc := #caller_location) -> (ctx: ZoneCtx) {
|
||||||
@ -53,18 +97,99 @@ ZoneBegin :: proc(active: bool, depth: i32, loc := #caller_location) -> (ctx: Zo
|
|||||||
}
|
}
|
||||||
|
|
||||||
// NOTE: scoped Zone*() procs also exists, no need of calling this directly.
|
// NOTE: scoped Zone*() procs also exists, no need of calling this directly.
|
||||||
@(disabled=!TRACY_ENABLE) ZoneEnd :: #force_inline proc(ctx: ZoneCtx) { ___tracy_emit_zone_end(ctx) }
|
@(disabled = !TRACY_ENABLE)
|
||||||
|
ZoneEnd :: #force_inline proc(ctx: ZoneCtx) {___tracy_emit_zone_end(ctx)}
|
||||||
|
|
||||||
// Memory profiling
|
// Memory profiling
|
||||||
// (See allocator.odin for an implementation of an Odin custom allocator using memory profiling.)
|
// (See allocator.odin for an implementation of an Odin custom allocator using memory profiling.)
|
||||||
@(disabled=!TRACY_ENABLE) Alloc :: #force_inline proc(ptr: rawptr, size: c.size_t, depth: i32 = TRACY_CALLSTACK) { when TRACY_HAS_CALLSTACK { ___tracy_emit_memory_alloc_callstack(ptr, size, depth, false) } else { ___tracy_emit_memory_alloc(ptr, size, false) } }
|
@(disabled = !TRACY_ENABLE)
|
||||||
@(disabled=!TRACY_ENABLE) Free :: #force_inline proc(ptr: rawptr, depth: i32 = TRACY_CALLSTACK) { when TRACY_HAS_CALLSTACK { ___tracy_emit_memory_free_callstack(ptr, depth, false) } else { ___tracy_emit_memory_free(ptr, false) } }
|
Alloc :: #force_inline proc(
|
||||||
@(disabled=!TRACY_ENABLE) SecureAlloc :: #force_inline proc(ptr: rawptr, size: c.size_t, depth: i32 = TRACY_CALLSTACK) { when TRACY_HAS_CALLSTACK { ___tracy_emit_memory_alloc_callstack(ptr, size, depth, true) } else { ___tracy_emit_memory_alloc(ptr, size, true) } }
|
ptr: rawptr,
|
||||||
@(disabled=!TRACY_ENABLE) SecureFree :: #force_inline proc(ptr: rawptr, depth: i32 = TRACY_CALLSTACK) { when TRACY_HAS_CALLSTACK { ___tracy_emit_memory_free_callstack(ptr, depth, true) } else { ___tracy_emit_memory_free(ptr, true) } }
|
size: c.size_t,
|
||||||
@(disabled=!TRACY_ENABLE) AllocN :: #force_inline proc(ptr: rawptr, size: c.size_t, name: cstring, depth: i32 = TRACY_CALLSTACK) { when TRACY_HAS_CALLSTACK { ___tracy_emit_memory_alloc_callstack_named(ptr, size, depth, false, name) } else { ___tracy_emit_memory_alloc_named(ptr, size, false, name) } }
|
depth: i32 = TRACY_CALLSTACK,
|
||||||
@(disabled=!TRACY_ENABLE) FreeN :: #force_inline proc(ptr: rawptr, name: cstring, depth: i32 = TRACY_CALLSTACK) { when TRACY_HAS_CALLSTACK { ___tracy_emit_memory_free_callstack_named(ptr, depth, false, name) } else { ___tracy_emit_memory_free_named(ptr, false, name) } }
|
) {when TRACY_HAS_CALLSTACK {___tracy_emit_memory_alloc_callstack(
|
||||||
@(disabled=!TRACY_ENABLE) SecureAllocN :: #force_inline proc(ptr: rawptr, size: c.size_t, name: cstring, depth: i32 = TRACY_CALLSTACK) { when TRACY_HAS_CALLSTACK { ___tracy_emit_memory_alloc_callstack_named(ptr, size, depth, true, name) } else { ___tracy_emit_memory_alloc_named(ptr, size, true, name) } }
|
ptr,
|
||||||
@(disabled=!TRACY_ENABLE) SecureFreeN :: #force_inline proc(ptr: rawptr, name: cstring, depth: i32 = TRACY_CALLSTACK) { when TRACY_HAS_CALLSTACK { ___tracy_emit_memory_free_callstack_named(ptr, depth, true, name) } else { ___tracy_emit_memory_free_named(ptr, true, name) } }
|
size,
|
||||||
|
depth,
|
||||||
|
false,
|
||||||
|
)} else {___tracy_emit_memory_alloc(ptr, size, false)}}
|
||||||
|
@(disabled = !TRACY_ENABLE)
|
||||||
|
Free :: #force_inline proc(
|
||||||
|
ptr: rawptr,
|
||||||
|
depth: i32 = TRACY_CALLSTACK,
|
||||||
|
) {when TRACY_HAS_CALLSTACK {___tracy_emit_memory_free_callstack(
|
||||||
|
ptr,
|
||||||
|
depth,
|
||||||
|
false,
|
||||||
|
)} else {___tracy_emit_memory_free(ptr, false)}}
|
||||||
|
@(disabled = !TRACY_ENABLE)
|
||||||
|
SecureAlloc :: #force_inline proc(
|
||||||
|
ptr: rawptr,
|
||||||
|
size: c.size_t,
|
||||||
|
depth: i32 = TRACY_CALLSTACK,
|
||||||
|
) {when TRACY_HAS_CALLSTACK {___tracy_emit_memory_alloc_callstack(
|
||||||
|
ptr,
|
||||||
|
size,
|
||||||
|
depth,
|
||||||
|
true,
|
||||||
|
)} else {___tracy_emit_memory_alloc(ptr, size, true)}}
|
||||||
|
@(disabled = !TRACY_ENABLE)
|
||||||
|
SecureFree :: #force_inline proc(
|
||||||
|
ptr: rawptr,
|
||||||
|
depth: i32 = TRACY_CALLSTACK,
|
||||||
|
) {when TRACY_HAS_CALLSTACK {___tracy_emit_memory_free_callstack(
|
||||||
|
ptr,
|
||||||
|
depth,
|
||||||
|
true,
|
||||||
|
)} else {___tracy_emit_memory_free(ptr, true)}}
|
||||||
|
@(disabled = !TRACY_ENABLE)
|
||||||
|
AllocN :: #force_inline proc(
|
||||||
|
ptr: rawptr,
|
||||||
|
size: c.size_t,
|
||||||
|
name: cstring,
|
||||||
|
depth: i32 = TRACY_CALLSTACK,
|
||||||
|
) {when TRACY_HAS_CALLSTACK {___tracy_emit_memory_alloc_callstack_named(
|
||||||
|
ptr,
|
||||||
|
size,
|
||||||
|
depth,
|
||||||
|
false,
|
||||||
|
name,
|
||||||
|
)} else {___tracy_emit_memory_alloc_named(ptr, size, false, name)}}
|
||||||
|
@(disabled = !TRACY_ENABLE)
|
||||||
|
FreeN :: #force_inline proc(
|
||||||
|
ptr: rawptr,
|
||||||
|
name: cstring,
|
||||||
|
depth: i32 = TRACY_CALLSTACK,
|
||||||
|
) {when TRACY_HAS_CALLSTACK {___tracy_emit_memory_free_callstack_named(
|
||||||
|
ptr,
|
||||||
|
depth,
|
||||||
|
false,
|
||||||
|
name,
|
||||||
|
)} else {___tracy_emit_memory_free_named(ptr, false, name)}}
|
||||||
|
@(disabled = !TRACY_ENABLE)
|
||||||
|
SecureAllocN :: #force_inline proc(
|
||||||
|
ptr: rawptr,
|
||||||
|
size: c.size_t,
|
||||||
|
name: cstring,
|
||||||
|
depth: i32 = TRACY_CALLSTACK,
|
||||||
|
) {when TRACY_HAS_CALLSTACK {___tracy_emit_memory_alloc_callstack_named(
|
||||||
|
ptr,
|
||||||
|
size,
|
||||||
|
depth,
|
||||||
|
true,
|
||||||
|
name,
|
||||||
|
)} else {___tracy_emit_memory_alloc_named(ptr, size, true, name)}}
|
||||||
|
@(disabled = !TRACY_ENABLE)
|
||||||
|
SecureFreeN :: #force_inline proc(
|
||||||
|
ptr: rawptr,
|
||||||
|
name: cstring,
|
||||||
|
depth: i32 = TRACY_CALLSTACK,
|
||||||
|
) {when TRACY_HAS_CALLSTACK {___tracy_emit_memory_free_callstack_named(
|
||||||
|
ptr,
|
||||||
|
depth,
|
||||||
|
true,
|
||||||
|
name,
|
||||||
|
)} else {___tracy_emit_memory_free_named(ptr, true, name)}}
|
||||||
|
|
||||||
// Dummy aliases to match C API (only difference is the `depth` parameter,
|
// Dummy aliases to match C API (only difference is the `depth` parameter,
|
||||||
// which we declare as optional for the non-S procs.)
|
// which we declare as optional for the non-S procs.)
|
||||||
@ -78,28 +203,60 @@ SecureAllocNS :: SecureAllocN
|
|||||||
SecureFreeNS :: SecureFreeN
|
SecureFreeNS :: SecureFreeN
|
||||||
|
|
||||||
// Frame markup
|
// Frame markup
|
||||||
@(disabled=!TRACY_ENABLE) FrameMark :: #force_inline proc(name: cstring = nil) { ___tracy_emit_frame_mark(name) }
|
@(disabled = !TRACY_ENABLE)
|
||||||
@(disabled=!TRACY_ENABLE) FrameMarkStart :: #force_inline proc(name: cstring) { ___tracy_emit_frame_mark_start(name) }
|
FrameMark :: #force_inline proc(name: cstring = nil) {___tracy_emit_frame_mark(name)}
|
||||||
@(disabled=!TRACY_ENABLE) FrameMarkEnd :: #force_inline proc(name: cstring) { ___tracy_emit_frame_mark_end(name) }
|
@(disabled = !TRACY_ENABLE)
|
||||||
@(disabled=!TRACY_ENABLE) FrameImage :: #force_inline proc(image: rawptr, w, h: u16, offset: u8, flip: b32) { ___tracy_emit_frame_image(image, w, h, offset, flip) }
|
FrameMarkStart :: #force_inline proc(name: cstring) {___tracy_emit_frame_mark_start(name)}
|
||||||
|
@(disabled = !TRACY_ENABLE)
|
||||||
|
FrameMarkEnd :: #force_inline proc(name: cstring) {___tracy_emit_frame_mark_end(name)}
|
||||||
|
@(disabled = !TRACY_ENABLE)
|
||||||
|
FrameImage :: #force_inline proc(
|
||||||
|
image: rawptr,
|
||||||
|
w, h: u16,
|
||||||
|
offset: u8,
|
||||||
|
flip: b32,
|
||||||
|
) {___tracy_emit_frame_image(image, w, h, offset, flip)}
|
||||||
|
|
||||||
// Plots and messages
|
// Plots and messages
|
||||||
@(disabled=!TRACY_ENABLE) Plot :: #force_inline proc(name: cstring, value: f64) { ___tracy_emit_plot(name, value) }
|
@(disabled = !TRACY_ENABLE)
|
||||||
@(disabled=!TRACY_ENABLE) PlotF :: #force_inline proc(name: cstring, value: f32) { ___tracy_emit_plot_float(name, value) }
|
Plot :: #force_inline proc(name: cstring, value: f64) {___tracy_emit_plot(name, value)}
|
||||||
@(disabled=!TRACY_ENABLE) PlotI :: #force_inline proc(name: cstring, value: i64) { ___tracy_emit_plot_int(name, value) }
|
@(disabled = !TRACY_ENABLE)
|
||||||
@(disabled=!TRACY_ENABLE) PlotConfig :: #force_inline proc(name: cstring, type: TracyPlotFormatEnum, step, fill: b32, color: u32) { ___tracy_emit_plot_config(name, type, step, fill, color) }
|
PlotF :: #force_inline proc(name: cstring, value: f32) {___tracy_emit_plot_float(name, value)}
|
||||||
@(disabled=!TRACY_ENABLE) Message :: #force_inline proc(txt: string) { ___tracy_emit_message(_sl(txt), TRACY_CALLSTACK when TRACY_HAS_CALLSTACK else 0) }
|
@(disabled = !TRACY_ENABLE)
|
||||||
@(disabled=!TRACY_ENABLE) MessageC :: #force_inline proc(txt: string, color: u32) { ___tracy_emit_message(_sl(txt), TRACY_CALLSTACK when TRACY_HAS_CALLSTACK else 0) }
|
PlotI :: #force_inline proc(name: cstring, value: i64) {___tracy_emit_plot_int(name, value)}
|
||||||
@(disabled=!TRACY_ENABLE) AppInfo :: #force_inline proc(name: string) { ___tracy_emit_message_appinfo(_sl(name)) }
|
@(disabled = !TRACY_ENABLE)
|
||||||
|
PlotConfig :: #force_inline proc(
|
||||||
|
name: cstring,
|
||||||
|
type: TracyPlotFormatEnum,
|
||||||
|
step, fill: b32,
|
||||||
|
color: u32,
|
||||||
|
) {___tracy_emit_plot_config(name, type, step, fill, color)}
|
||||||
|
@(disabled = !TRACY_ENABLE)
|
||||||
|
Message :: #force_inline proc(txt: string) {___tracy_emit_message(
|
||||||
|
_sl(txt),
|
||||||
|
TRACY_CALLSTACK when TRACY_HAS_CALLSTACK else 0,
|
||||||
|
)}
|
||||||
|
@(disabled = !TRACY_ENABLE)
|
||||||
|
MessageC :: #force_inline proc(txt: string, color: u32) {___tracy_emit_message(
|
||||||
|
_sl(txt),
|
||||||
|
TRACY_CALLSTACK when TRACY_HAS_CALLSTACK else 0,
|
||||||
|
)}
|
||||||
|
@(disabled = !TRACY_ENABLE)
|
||||||
|
AppInfo :: #force_inline proc(name: string) {___tracy_emit_message_appinfo(_sl(name))}
|
||||||
|
|
||||||
@(disabled=!TRACY_ENABLE) SetThreadName :: #force_inline proc(name: cstring) { ___tracy_set_thread_name(name) }
|
@(disabled = !TRACY_ENABLE)
|
||||||
|
SetThreadName :: #force_inline proc(name: cstring) {___tracy_set_thread_name(name)}
|
||||||
|
|
||||||
// Connection status
|
// Connection status
|
||||||
IsConnected :: #force_inline proc() -> bool { return cast(bool)___tracy_connected() when TRACY_ENABLE else false }
|
IsConnected :: #force_inline proc() -> bool {return(
|
||||||
|
cast(bool)___tracy_connected() when TRACY_ENABLE else false \
|
||||||
|
)}
|
||||||
|
|
||||||
// Fibers
|
// Fibers
|
||||||
@(disabled=!TRACY_ENABLE) FiberEnter :: #force_inline proc(name: cstring) { when TRACY_FIBERS { ___tracy_fiber_enter(name) } }
|
@(disabled = !TRACY_ENABLE)
|
||||||
@(disabled=!TRACY_ENABLE) FiberLeave :: #force_inline proc() { when TRACY_FIBERS { ___tracy_fiber_leave() } }
|
FiberEnter :: #force_inline proc(name: cstring) {when TRACY_FIBERS {___tracy_fiber_enter(name)}}
|
||||||
|
@(disabled = !TRACY_ENABLE)
|
||||||
|
FiberLeave :: #force_inline proc() {when TRACY_FIBERS {___tracy_fiber_leave()}}
|
||||||
|
|
||||||
// GPU zones
|
// GPU zones
|
||||||
// These are also available but no higher level wrapper provided.
|
// These are also available but no higher level wrapper provided.
|
||||||
@ -141,18 +298,32 @@ LockAnnounce :: #force_inline proc(loc := #caller_location) -> (ctx: LockCtx) {
|
|||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@(disabled=!TRACY_ENABLE) LockTerminate :: #force_inline proc( lock: LockCtx ) { ___tracy_terminate_lockable_ctx( lock ) }
|
@(disabled = !TRACY_ENABLE)
|
||||||
@(disabled=!TRACY_ENABLE) LockBeforeLock :: #force_inline proc( lock: LockCtx ) { ___tracy_before_lock_lockable_ctx( lock ) }
|
LockTerminate :: #force_inline proc(lock: LockCtx) {___tracy_terminate_lockable_ctx(lock)}
|
||||||
@(disabled=!TRACY_ENABLE) LockAfterLock :: #force_inline proc( lock: LockCtx ) { ___tracy_after_lock_lockable_ctx( lock ) }
|
@(disabled = !TRACY_ENABLE)
|
||||||
@(disabled=!TRACY_ENABLE) LockAfterUnlock :: #force_inline proc( lock: LockCtx ) { ___tracy_after_unlock_lockable_ctx( lock ) }
|
LockBeforeLock :: #force_inline proc(lock: LockCtx) {___tracy_before_lock_lockable_ctx(lock)}
|
||||||
@(disabled=!TRACY_ENABLE) LockAfterTryLock :: #force_inline proc( lock: LockCtx, acquired: bool ) { ___tracy_after_try_lock_lockable_ctx( lock, b32(acquired) ) }
|
@(disabled = !TRACY_ENABLE)
|
||||||
@(disabled=!TRACY_ENABLE) LockMark :: #force_inline proc( lock: LockCtx, loc := #caller_location ) {
|
LockAfterLock :: #force_inline proc(lock: LockCtx) {___tracy_after_lock_lockable_ctx(lock)}
|
||||||
|
@(disabled = !TRACY_ENABLE)
|
||||||
|
LockAfterUnlock :: #force_inline proc(lock: LockCtx) {___tracy_after_unlock_lockable_ctx(lock)}
|
||||||
|
@(disabled = !TRACY_ENABLE)
|
||||||
|
LockAfterTryLock :: #force_inline proc(
|
||||||
|
lock: LockCtx,
|
||||||
|
acquired: bool,
|
||||||
|
) {___tracy_after_try_lock_lockable_ctx(lock, b32(acquired))}
|
||||||
|
@(disabled = !TRACY_ENABLE)
|
||||||
|
LockMark :: #force_inline proc(lock: LockCtx, loc := #caller_location) {
|
||||||
id := ___tracy_alloc_srcloc(u32(loc.line), _sl(loc.file_path), _sl(loc.procedure))
|
id := ___tracy_alloc_srcloc(u32(loc.line), _sl(loc.file_path), _sl(loc.procedure))
|
||||||
___tracy_mark_lockable_ctx(lock, (^___tracy_source_location_data)(uintptr(id)))
|
___tracy_mark_lockable_ctx(lock, (^___tracy_source_location_data)(uintptr(id)))
|
||||||
}
|
}
|
||||||
@(disabled=!TRACY_ENABLE) LockCustomName :: #force_inline proc( lock: LockCtx, name: string ) { ___tracy_custom_name_lockable_ctx( lock, _sl(name) ) }
|
@(disabled = !TRACY_ENABLE)
|
||||||
|
LockCustomName :: #force_inline proc(
|
||||||
|
lock: LockCtx,
|
||||||
|
name: string,
|
||||||
|
) {___tracy_custom_name_lockable_ctx(lock, _sl(name))}
|
||||||
|
|
||||||
// Helper for passing cstring+length to Tracy functions.
|
// Helper for passing cstring+length to Tracy functions.
|
||||||
@(private="file") _sl :: proc(s: string) -> (cstring, c.size_t) {
|
@(private = "file")
|
||||||
|
_sl :: proc(s: string) -> (cstring, c.size_t) {
|
||||||
return cstring(raw_data(s)), c.size_t(len(s))
|
return cstring(raw_data(s)), c.size_t(len(s))
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user