Reland "Vulkan: Implement debug markers"
This reverts commit 0c01e36783b20a0177c653490cb4f8ea4a896075.
Reason for revert: Its dependency that was reverted has now relanded:
https://chromium-review.googlesource.com/c/angle/angle/+/1489153
Original change's description:
> Revert "Vulkan: Implement debug markers"
>
> This reverts commit 983e446921946734fe47217c345a8fe2f079319d.
>
> Reason for revert: Depends on a CL that's reverted: https://chromium-review.googlesource.com/c/angle/angle/+/1470605
>
> Original change's description:
> > Vulkan: Implement debug markers
> >
> > Covers both GL_KHR_debug and GL_EXT_debug_marker.
> >
> > Debug markers are used to specify events or hierarchically categorize a
> > set of commands within the command buffer. When debugging, this allows
> > for quicker navigation to the draw calls of interest, and otherwise
> > provides context to debug output.
> >
> > Bug: angleproject:2853
> > Change-Id: Id65e11fc877d9e70b6fd0fae7f0bbbcb1164bf10
> > Reviewed-on: https://chromium-review.googlesource.com/c/1403956
> > Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
> > Reviewed-by: Jamie Madill <jmadill@chromium.org>
> > Reviewed-by: Geoff Lang <geofflang@chromium.org>
>
> TBR=geofflang@chromium.org,jmadill@chromium.org,syoussefi@chromium.org
>
> Change-Id: I7fcfc8683195d396aec61848719f52c0fa049ece
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: angleproject:2853
> Reviewed-on: https://chromium-review.googlesource.com/c/1470606
> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
TBR=geofflang@chromium.org,jmadill@google.com,syoussefi@chromium.org
Bug: angleproject:2853
Change-Id: Ie19ae103244d54dcf7108d5f61c24e318fc44057
Reviewed-on: https://chromium-review.googlesource.com/c/1489154
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@google.com>
diff --git a/src/libANGLE/renderer/vulkan/CommandGraph.h b/src/libANGLE/renderer/vulkan/CommandGraph.h
index 14cf9c9..adf1993 100644
--- a/src/libANGLE/renderer/vulkan/CommandGraph.h
+++ b/src/libANGLE/renderer/vulkan/CommandGraph.h
@@ -31,6 +31,7 @@
Image,
Query,
FenceSync,
+ DebugMarker,
};
// Certain functionality cannot be put in secondary command buffers, so they are special-cased in
@@ -43,6 +44,9 @@
WriteTimestamp,
SetFenceSync,
WaitFenceSync,
+ InsertDebugMarker,
+ PushDebugMarker,
+ PopDebugMarker,
};
// Receives notifications when a command buffer is no longer able to record. Can be used with
@@ -131,6 +135,8 @@
void setQueryPool(const QueryPool *queryPool, uint32_t queryIndex);
void setFenceSync(const vk::Event &event);
+ void setDebugMarker(GLenum source, std::string &&marker);
+ const std::string &getDebugMarker() const { return mDebugMarker; }
ANGLE_INLINE void addGlobalMemoryBarrier(VkFlags srcAccess, VkFlags dstAccess)
{
@@ -177,6 +183,9 @@
uint32_t mQueryIndex;
// GLsync and EGLSync:
VkEvent mFenceSyncEvent;
+ // Debug markers:
+ GLenum mDebugMarkerSource;
+ std::string mDebugMarker;
// Parents are commands that must be submitted before 'this' CommandNode can be submitted.
std::vector<CommandGraphNode *> mParents;
@@ -369,6 +378,10 @@
// GLsync and EGLSync:
void setFenceSync(const vk::Event &event);
void waitFenceSync(const vk::Event &event);
+ // Debug markers:
+ void insertDebugMarker(GLenum source, std::string &&marker);
+ void pushDebugMarker(GLenum source, std::string &&marker);
+ void popDebugMarker();
private:
CommandGraphNode *allocateBarrierNode(CommandGraphResourceType resourceType,