@@ -41,15 +41,15 @@ const tracy_stub = struct {
4141 }
4242 };
4343
44- pub inline fn SetThreadName (name : [* :0 ]const u8 ) void {
44+ pub inline fn SetThreadName (comptime name : [* :0 ]const u8 ) void {
4545 _ = name ;
4646 }
4747
4848 pub inline fn Zone (comptime src : Src ) ZoneCtx {
4949 _ = src ;
5050 return .{};
5151 }
52- pub inline fn ZoneN (comptime src : Src , name : [* :0 ]const u8 ) ZoneCtx {
52+ pub inline fn ZoneN (comptime src : Src , comptime name : [* :0 ]const u8 ) ZoneCtx {
5353 _ = src ;
5454 _ = name ;
5555 return .{};
@@ -59,7 +59,7 @@ const tracy_stub = struct {
5959 _ = color ;
6060 return .{};
6161 }
62- pub inline fn ZoneNC (comptime src : Src , name : [* :0 ]const u8 , color : u32 ) ZoneCtx {
62+ pub inline fn ZoneNC (comptime src : Src , comptime name : [* :0 ]const u8 , color : u32 ) ZoneCtx {
6363 _ = src ;
6464 _ = name ;
6565 _ = color ;
@@ -70,7 +70,7 @@ const tracy_stub = struct {
7070 _ = depth ;
7171 return .{};
7272 }
73- pub inline fn ZoneNS (comptime src : Src , name : [* :0 ]const u8 , depth : i32 ) ZoneCtx {
73+ pub inline fn ZoneNS (comptime src : Src , comptime name : [* :0 ]const u8 , depth : i32 ) ZoneCtx {
7474 _ = src ;
7575 _ = name ;
7676 _ = depth ;
@@ -82,7 +82,7 @@ const tracy_stub = struct {
8282 _ = depth ;
8383 return .{};
8484 }
85- pub inline fn ZoneNCS (comptime src : Src , name : [* :0 ]const u8 , color : u32 , depth : i32 ) ZoneCtx {
85+ pub inline fn ZoneNCS (comptime src : Src , comptime name : [* :0 ]const u8 , color : u32 , depth : i32 ) ZoneCtx {
8686 _ = src ;
8787 _ = name ;
8888 _ = color ;
@@ -123,42 +123,42 @@ const tracy_stub = struct {
123123 _ = depth ;
124124 }
125125
126- pub inline fn AllocN (ptr : ? * const anyopaque , size : usize , name : [* :0 ]const u8 ) void {
126+ pub inline fn AllocN (ptr : ? * const anyopaque , size : usize , comptime name : [* :0 ]const u8 ) void {
127127 _ = ptr ;
128128 _ = size ;
129129 _ = name ;
130130 }
131- pub inline fn FreeN (ptr : ? * const anyopaque , name : [* :0 ]const u8 ) void {
131+ pub inline fn FreeN (ptr : ? * const anyopaque , comptime name : [* :0 ]const u8 ) void {
132132 _ = ptr ;
133133 _ = name ;
134134 }
135- pub inline fn SecureAllocN (ptr : ? * const anyopaque , size : usize , name : [* :0 ]const u8 ) void {
135+ pub inline fn SecureAllocN (ptr : ? * const anyopaque , size : usize , comptime name : [* :0 ]const u8 ) void {
136136 _ = ptr ;
137137 _ = size ;
138138 _ = name ;
139139 }
140- pub inline fn SecureFreeN (ptr : ? * const anyopaque , name : [* :0 ]const u8 ) void {
140+ pub inline fn SecureFreeN (ptr : ? * const anyopaque , comptime name : [* :0 ]const u8 ) void {
141141 _ = ptr ;
142142 _ = name ;
143143 }
144- pub inline fn AllocNS (ptr : ? * const anyopaque , size : usize , depth : c_int , name : [* :0 ]const u8 ) void {
144+ pub inline fn AllocNS (ptr : ? * const anyopaque , size : usize , depth : c_int , comptime name : [* :0 ]const u8 ) void {
145145 _ = ptr ;
146146 _ = size ;
147147 _ = depth ;
148148 _ = name ;
149149 }
150- pub inline fn FreeNS (ptr : ? * const anyopaque , depth : c_int , name : [* :0 ]const u8 ) void {
150+ pub inline fn FreeNS (ptr : ? * const anyopaque , depth : c_int , comptime name : [* :0 ]const u8 ) void {
151151 _ = ptr ;
152152 _ = depth ;
153153 _ = name ;
154154 }
155- pub inline fn SecureAllocNS (ptr : ? * const anyopaque , size : usize , depth : c_int , name : [* :0 ]const u8 ) void {
155+ pub inline fn SecureAllocNS (ptr : ? * const anyopaque , size : usize , depth : c_int , comptime name : [* :0 ]const u8 ) void {
156156 _ = ptr ;
157157 _ = size ;
158158 _ = depth ;
159159 _ = name ;
160160 }
161- pub inline fn SecureFreeNS (ptr : ? * const anyopaque , depth : c_int , name : [* :0 ]const u8 ) void {
161+ pub inline fn SecureFreeNS (ptr : ? * const anyopaque , depth : c_int , comptime name : [* :0 ]const u8 ) void {
162162 _ = ptr ;
163163 _ = depth ;
164164 _ = name ;
@@ -167,22 +167,22 @@ const tracy_stub = struct {
167167 pub inline fn Message (text : []const u8 ) void {
168168 _ = text ;
169169 }
170- pub inline fn MessageL (text : [* :0 ]const u8 ) void {
170+ pub inline fn MessageL (comptime text : [* :0 ]const u8 ) void {
171171 _ = text ;
172172 }
173173 pub inline fn MessageC (text : []const u8 , color : u32 ) void {
174174 _ = text ;
175175 _ = color ;
176176 }
177- pub inline fn MessageLC (text : [* :0 ]const u8 , color : u32 ) void {
177+ pub inline fn MessageLC (comptime text : [* :0 ]const u8 , color : u32 ) void {
178178 _ = text ;
179179 _ = color ;
180180 }
181181 pub inline fn MessageS (text : []const u8 , depth : c_int ) void {
182182 _ = text ;
183183 _ = depth ;
184184 }
185- pub inline fn MessageLS (text : [* :0 ]const u8 , depth : c_int ) void {
185+ pub inline fn MessageLS (comptime text : [* :0 ]const u8 , depth : c_int ) void {
186186 _ = text ;
187187 _ = depth ;
188188 }
@@ -191,20 +191,20 @@ const tracy_stub = struct {
191191 _ = color ;
192192 _ = depth ;
193193 }
194- pub inline fn MessageLCS (text : [* :0 ]const u8 , color : u32 , depth : c_int ) void {
194+ pub inline fn MessageLCS (comptime text : [* :0 ]const u8 , color : u32 , depth : c_int ) void {
195195 _ = text ;
196196 _ = color ;
197197 _ = depth ;
198198 }
199199
200200 pub inline fn FrameMark () void {}
201- pub inline fn FrameMarkNamed (name : [* :0 ]const u8 ) void {
201+ pub inline fn FrameMarkNamed (comptime name : [* :0 ]const u8 ) void {
202202 _ = name ;
203203 }
204- pub inline fn FrameMarkStart (name : [* :0 ]const u8 ) void {
204+ pub inline fn FrameMarkStart (comptime name : [* :0 ]const u8 ) void {
205205 _ = name ;
206206 }
207- pub inline fn FrameMarkEnd (name : [* :0 ]const u8 ) void {
207+ pub inline fn FrameMarkEnd (comptime name : [* :0 ]const u8 ) void {
208208 _ = name ;
209209 }
210210 pub inline fn FrameImage (image : ? * const anyopaque , width : u16 , height : u16 , offset : u8 , flip : c_int ) void {
@@ -215,20 +215,20 @@ const tracy_stub = struct {
215215 _ = flip ;
216216 }
217217
218- pub inline fn FiberEnter (name : [* :0 ]const u8 ) void {
218+ pub inline fn FiberEnter (comptime name : [* :0 ]const u8 ) void {
219219 _ = name ;
220220 }
221221 pub inline fn FiberLeave () void {}
222222
223- pub inline fn PlotF (name : [* :0 ]const u8 , val : f64 ) void {
223+ pub inline fn PlotF (comptime name : [* :0 ]const u8 , val : f64 ) void {
224224 _ = name ;
225225 _ = val ;
226226 }
227- pub inline fn PlotU (name : [* :0 ]const u8 , val : u64 ) void {
227+ pub inline fn PlotU (comptime name : [* :0 ]const u8 , val : u64 ) void {
228228 _ = name ;
229229 _ = val ;
230230 }
231- pub inline fn PlotI (name : [* :0 ]const u8 , val : i64 ) void {
231+ pub inline fn PlotI (comptime name : [* :0 ]const u8 , val : i64 ) void {
232232 _ = name ;
233233 _ = val ;
234234 }
@@ -309,27 +309,19 @@ const tracy_full = struct {
309309 }
310310 };
311311
312- inline fn initZone (comptime src : Src , name : ? [* :0 ]const u8 , color : u32 , depth : c_int ) ZoneCtx {
312+ inline fn initZone (comptime src : Src , comptime name : ? [* :0 ]const u8 , comptime color : u32 , comptime depth : c_int ) ZoneCtx {
313313 // Tracy uses pointer identity to identify contexts.
314314 // The `src` parameter being comptime ensures that
315315 // each zone gets its own unique global location for this
316316 // struct.
317317 const static = struct {
318- var loc : c.___tracy_source_location_data = undefined ;
319-
320- // Ensure that a unique struct type is generated for each unique `src`. See
321- // https://github.com/ziglang/zig/issues/18816
322- comptime {
323- // https://github.com/ziglang/zig/issues/19274
324- _ = @sizeOf (@TypeOf (src ));
325- }
326- };
327- static .loc = .{
328- .name = name ,
329- .function = src .fn_name .ptr ,
330- .file = src .file .ptr ,
331- .line = src .line ,
332- .color = color ,
318+ const loc : c.___tracy_source_location_data = .{
319+ .name = name ,
320+ .function = src .fn_name .ptr ,
321+ .file = src .file .ptr ,
322+ .line = src .line ,
323+ .color = color ,
324+ };
333325 };
334326
335327 const zone = if (has_callstack_support )
@@ -345,32 +337,32 @@ const tracy_full = struct {
345337 }
346338 }
347339
348- pub inline fn SetThreadName (name : [* :0 ]const u8 ) void {
340+ pub inline fn SetThreadName (comptime name : [* :0 ]const u8 ) void {
349341 c .___tracy_set_thread_name (name );
350342 }
351343
352344 pub inline fn Zone (comptime src : Src ) ZoneCtx {
353345 return initZone (src , null , 0 , callstack_depth );
354346 }
355- pub inline fn ZoneN (comptime src : Src , name : [* :0 ]const u8 ) ZoneCtx {
347+ pub inline fn ZoneN (comptime src : Src , comptime name : [* :0 ]const u8 ) ZoneCtx {
356348 return initZone (src , name , 0 , callstack_depth );
357349 }
358350 pub inline fn ZoneC (comptime src : Src , color : u32 ) ZoneCtx {
359351 return initZone (src , null , color , callstack_depth );
360352 }
361- pub inline fn ZoneNC (comptime src : Src , name : [* :0 ]const u8 , color : u32 ) ZoneCtx {
353+ pub inline fn ZoneNC (comptime src : Src , comptime name : [* :0 ]const u8 , color : u32 ) ZoneCtx {
362354 return initZone (src , name , color , callstack_depth );
363355 }
364356 pub inline fn ZoneS (comptime src : Src , depth : i32 ) ZoneCtx {
365357 return initZone (src , null , 0 , depth );
366358 }
367- pub inline fn ZoneNS (comptime src : Src , name : [* :0 ]const u8 , depth : i32 ) ZoneCtx {
359+ pub inline fn ZoneNS (comptime src : Src , comptime name : [* :0 ]const u8 , depth : i32 ) ZoneCtx {
368360 return initZone (src , name , 0 , depth );
369361 }
370362 pub inline fn ZoneCS (comptime src : Src , color : u32 , depth : i32 ) ZoneCtx {
371363 return initZone (src , null , color , depth );
372364 }
373- pub inline fn ZoneNCS (comptime src : Src , name : [* :0 ]const u8 , color : u32 , depth : i32 ) ZoneCtx {
365+ pub inline fn ZoneNCS (comptime src : Src , comptime name : [* :0 ]const u8 , color : u32 , depth : i32 ) ZoneCtx {
374366 return initZone (src , name , color , depth );
375367 }
376368
@@ -431,56 +423,56 @@ const tracy_full = struct {
431423 }
432424 }
433425
434- pub inline fn AllocN (ptr : ? * const anyopaque , size : usize , name : [* :0 ]const u8 ) void {
426+ pub inline fn AllocN (ptr : ? * const anyopaque , size : usize , comptime name : [* :0 ]const u8 ) void {
435427 if (has_callstack_support ) {
436428 c .___tracy_emit_memory_alloc_callstack_named (ptr , size , callstack_depth , 0 , name );
437429 } else {
438430 c .___tracy_emit_memory_alloc_named (ptr , size , 0 , name );
439431 }
440432 }
441- pub inline fn FreeN (ptr : ? * const anyopaque , name : [* :0 ]const u8 ) void {
433+ pub inline fn FreeN (ptr : ? * const anyopaque , comptime name : [* :0 ]const u8 ) void {
442434 if (has_callstack_support ) {
443435 c .___tracy_emit_memory_free_callstack_named (ptr , callstack_depth , 0 , name );
444436 } else {
445437 c .___tracy_emit_memory_free_named (ptr , 0 , name );
446438 }
447439 }
448- pub inline fn SecureAllocN (ptr : ? * const anyopaque , size : usize , name : [* :0 ]const u8 ) void {
440+ pub inline fn SecureAllocN (ptr : ? * const anyopaque , size : usize , comptime name : [* :0 ]const u8 ) void {
449441 if (has_callstack_support ) {
450442 c .___tracy_emit_memory_alloc_callstack_named (ptr , size , callstack_depth , 1 , name );
451443 } else {
452444 c .___tracy_emit_memory_alloc_named (ptr , size , 1 , name );
453445 }
454446 }
455- pub inline fn SecureFreeN (ptr : ? * const anyopaque , name : [* :0 ]const u8 ) void {
447+ pub inline fn SecureFreeN (ptr : ? * const anyopaque , comptime name : [* :0 ]const u8 ) void {
456448 if (has_callstack_support ) {
457449 c .___tracy_emit_memory_free_callstack_named (ptr , callstack_depth , 1 , name );
458450 } else {
459451 c .___tracy_emit_memory_free_named (ptr , 1 , name );
460452 }
461453 }
462- pub inline fn AllocNS (ptr : ? * const anyopaque , size : usize , depth : c_int , name : [* :0 ]const u8 ) void {
454+ pub inline fn AllocNS (ptr : ? * const anyopaque , size : usize , depth : c_int , comptime name : [* :0 ]const u8 ) void {
463455 if (has_callstack_support ) {
464456 c .___tracy_emit_memory_alloc_callstack_named (ptr , size , depth , 0 , name );
465457 } else {
466458 c .___tracy_emit_memory_alloc_named (ptr , size , 0 , name );
467459 }
468460 }
469- pub inline fn FreeNS (ptr : ? * const anyopaque , depth : c_int , name : [* :0 ]const u8 ) void {
461+ pub inline fn FreeNS (ptr : ? * const anyopaque , depth : c_int , comptime name : [* :0 ]const u8 ) void {
470462 if (has_callstack_support ) {
471463 c .___tracy_emit_memory_free_callstack_named (ptr , depth , 0 , name );
472464 } else {
473465 c .___tracy_emit_memory_free_named (ptr , 0 , name );
474466 }
475467 }
476- pub inline fn SecureAllocNS (ptr : ? * const anyopaque , size : usize , depth : c_int , name : [* :0 ]const u8 ) void {
468+ pub inline fn SecureAllocNS (ptr : ? * const anyopaque , size : usize , depth : c_int , comptime name : [* :0 ]const u8 ) void {
477469 if (has_callstack_support ) {
478470 c .___tracy_emit_memory_alloc_callstack_named (ptr , size , depth , 1 , name );
479471 } else {
480472 c .___tracy_emit_memory_alloc_named (ptr , size , 1 , name );
481473 }
482474 }
483- pub inline fn SecureFreeNS (ptr : ? * const anyopaque , depth : c_int , name : [* :0 ]const u8 ) void {
475+ pub inline fn SecureFreeNS (ptr : ? * const anyopaque , depth : c_int , comptime name : [* :0 ]const u8 ) void {
484476 if (has_callstack_support ) {
485477 c .___tracy_emit_memory_free_callstack_named (ptr , depth , 1 , name );
486478 } else {
@@ -491,62 +483,62 @@ const tracy_full = struct {
491483 pub inline fn Message (text : []const u8 ) void {
492484 c .___tracy_emit_message (text .ptr , text .len , callstack_depth );
493485 }
494- pub inline fn MessageL (text : [* :0 ]const u8 , color : u32 ) void {
486+ pub inline fn MessageL (comptime text : [* :0 ]const u8 , color : u32 ) void {
495487 c .___tracy_emit_messageL (text , color , callstack_depth );
496488 }
497489 pub inline fn MessageC (text : []const u8 , color : u32 ) void {
498490 c .___tracy_emit_messageC (text .ptr , text .len , color , callstack_depth );
499491 }
500- pub inline fn MessageLC (text : [* :0 ]const u8 , color : u32 ) void {
492+ pub inline fn MessageLC (comptime text : [* :0 ]const u8 , color : u32 ) void {
501493 c .___tracy_emit_messageLC (text , color , callstack_depth );
502494 }
503495 pub inline fn MessageS (text : []const u8 , depth : c_int ) void {
504496 const inner_depth : c_int = if (has_callstack_support ) depth else 0 ;
505497 c .___tracy_emit_message (text .ptr , text .len , inner_depth );
506498 }
507- pub inline fn MessageLS (text : [* :0 ]const u8 , depth : c_int ) void {
499+ pub inline fn MessageLS (comptime text : [* :0 ]const u8 , depth : c_int ) void {
508500 const inner_depth : c_int = if (has_callstack_support ) depth else 0 ;
509501 c .___tracy_emit_messageL (text , inner_depth );
510502 }
511503 pub inline fn MessageCS (text : []const u8 , color : u32 , depth : c_int ) void {
512504 const inner_depth : c_int = if (has_callstack_support ) depth else 0 ;
513505 c .___tracy_emit_messageC (text .ptr , text .len , color , inner_depth );
514506 }
515- pub inline fn MessageLCS (text : [* :0 ]const u8 , color : u32 , depth : c_int ) void {
507+ pub inline fn MessageLCS (comptime text : [* :0 ]const u8 , color : u32 , depth : c_int ) void {
516508 const inner_depth : c_int = if (has_callstack_support ) depth else 0 ;
517509 c .___tracy_emit_messageLC (text , color , inner_depth );
518510 }
519511
520512 pub inline fn FrameMark () void {
521513 c .___tracy_emit_frame_mark (null );
522514 }
523- pub inline fn FrameMarkNamed (name : [* :0 ]const u8 ) void {
515+ pub inline fn FrameMarkNamed (comptime name : [* :0 ]const u8 ) void {
524516 c .___tracy_emit_frame_mark (name );
525517 }
526- pub inline fn FrameMarkStart (name : [* :0 ]const u8 ) void {
518+ pub inline fn FrameMarkStart (comptime name : [* :0 ]const u8 ) void {
527519 c .___tracy_emit_frame_mark_start (name );
528520 }
529- pub inline fn FrameMarkEnd (name : [* :0 ]const u8 ) void {
521+ pub inline fn FrameMarkEnd (comptime name : [* :0 ]const u8 ) void {
530522 c .___tracy_emit_frame_mark_end (name );
531523 }
532524 pub inline fn FrameImage (image : ? * const anyopaque , width : u16 , height : u16 , offset : u8 , flip : c_int ) void {
533525 c .___tracy_emit_frame_image (image , width , height , offset , flip );
534526 }
535527
536- pub inline fn FiberEnter (name : [* :0 ]const u8 ) void {
528+ pub inline fn FiberEnter (comptime name : [* :0 ]const u8 ) void {
537529 c .___tracy_fiber_enter (name );
538530 }
539531 pub inline fn FiberLeave () void {
540532 c .___tracy_fiber_leave ();
541533 }
542534
543- pub inline fn PlotF (name : [* :0 ]const u8 , val : f64 ) void {
535+ pub inline fn PlotF (comptime name : [* :0 ]const u8 , val : f64 ) void {
544536 c .___tracy_emit_plot (name , val );
545537 }
546- pub inline fn PlotU (name : [* :0 ]const u8 , val : u64 ) void {
538+ pub inline fn PlotU (comptime name : [* :0 ]const u8 , val : u64 ) void {
547539 c .___tracy_emit_plot (name , @as (f64 , @floatFromInt (val )));
548540 }
549- pub inline fn PlotI (name : [* :0 ]const u8 , val : i64 ) void {
541+ pub inline fn PlotI (comptime name : [* :0 ]const u8 , val : i64 ) void {
550542 c .___tracy_emit_plot (name , @as (f64 , @floatFromInt (val )));
551543 }
552544 pub inline fn AppInfo (text : []const u8 ) void {
0 commit comments