wolfpld / tracy

Frame profiler
https://tracy.nereid.pl/
Other
9.24k stars 640 forks source link

On some macro issues #863

Open Mrkol opened 3 weeks ago

Mrkol commented 3 weeks ago

First, CPU tracing macros are a huge landgrab due to not having a prefix. E.g. ZoneScoped instead of TracyZoneScoped is just asking for trouble. FrameMark, FrameImage, LockMark... You name it! I don't see any reason to not prefix these macros when things like TracyVkZone are prefixed.

Second, TracyVkContext and all other context-related macros have a ; at the end of it, which is very weird. Code like someSmartPtr.reset(TracyVkContext(...)); does not compile because of it, and TracyVkDestroy(ptr) without an additional ; compiles, which is a bit unexpected when all zone macros require a ; after them. I feel like the extra ; should be removed from all the context-related macros, including other graphics API integrations if there are similar problems there (I only care about vulkan though).

Mrkol commented 2 weeks ago

One more issue: the !defined TRACY_ENABLE branch of TracyVulkan.hpp defines TracyVkContext without any respect to TRACY_VK_USE_SYMBOL_TABLE. Maybe it should be redefined as a variadic macro when tracy is disabled? Just so that you don't have to add new branches and fix the argument count all the time