Skip to content

Commit

Permalink
Create debug marker guards to avoid forgetting to pop
Browse files Browse the repository at this point in the history
Summary: ^

Reviewed By: EricGriffith

Differential Revision: D50613042

fbshipit-source-id: c435b33de9221e965ba65be40129402b47c2a612
  • Loading branch information
francoiscoulombe authored and facebook-github-bot committed Oct 25, 2023
1 parent 1a1f1ce commit 520cb33
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/igl/CommandBuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,12 @@ class ICommandBuffer {
#if IGL_DEBUG && !defined(IGL_DISABLE_DEBUG_BUFFER_LABEL)
#define IGL_DEBUG_BUFFER_LABEL_START(buffer, x) (buffer).pushDebugGroupLabel(x)
#define IGL_DEBUG_BUFFER_LABEL_END(buffer) (buffer).popDebugGroupLabel()
#define IGL_DEBUG_BUFFER_LABEL_START_GUARD(buffer, x) \
IGL_DEBUG_BUFFER_LABEL_START(buffer, x); \
auto popDebugGroupLabelScope = \
folly::makeGuard([&cmdBuffer = (buffer)]() { IGL_DEBUG_BUFFER_LABEL_END(cmdBuffer); });
#else
#define IGL_DEBUG_BUFFER_LABEL_START(buffer, x)
#define IGL_DEBUG_BUFFER_LABEL_END(buffer)
#define IGL_DEBUG_BUFFER_LABEL_START_GUARD(buffer, x)
#endif // IGL_DEBUG && !defined(IGL_DISABLE_DEBUG_BUFFER_LABEL)

0 comments on commit 520cb33

Please sign in to comment.