optick.patch 1.6 KB

12345678910111213141516171819202122232425262728
  1. diff --git a/src/optick.h b/src/optick.h
  2. index 96b28b9..8782d73 100644
  3. --- a/src/optick.h
  4. +++ b/src/optick.h
  5. @@ -787,6 +787,7 @@ struct OPTICK_API GPUContextScope
  6. };
  7. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  8. OPTICK_API const EventDescription* GetFrameDescription(FrameType::Type frame = FrameType::CPU);
  9. +OPTICK_API void AttachTag(EventStorage* storage, const EventDescription& description, uint32_t val, int64_t timestamp);
  10. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  11. typedef void* (*AllocateFn)(size_t);
  12. typedef void (*DeallocateFn)(void*);
  13. diff --git a/src/optick_core.cpp b/src/optick_core.cpp
  14. index a992c4f..b5b3537 100644
  15. --- a/src/optick_core.cpp
  16. +++ b/src/optick_core.cpp
  17. @@ -1823,6 +1823,11 @@ OPTICK_API const EventDescription* GetFrameDescription(FrameType::Type frame)
  18. return Core::Get().GetFrameDescription(frame);
  19. }
  20. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  21. +OPTICK_API void AttachTag(EventStorage* storage, const EventDescription& description, uint32_t val, int64_t timestamp)
  22. +{
  23. + storage->tagU32Buffer.Add(TagU32(description, val, timestamp));
  24. +}
  25. +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  26. OPTICK_API void SetAllocator(AllocateFn allocateFn, DeallocateFn deallocateFn, InitThreadCb initThreadCb)
  27. {
  28. Memory::SetAllocator(allocateFn, deallocateFn, initThreadCb);