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/RendererVk.cpp b/src/libANGLE/renderer/vulkan/RendererVk.cpp
index 75e5bf1..177c2f3 100644
--- a/src/libANGLE/renderer/vulkan/RendererVk.cpp
+++ b/src/libANGLE/renderer/vulkan/RendererVk.cpp
@@ -220,16 +220,6 @@
const VkDebugUtilsMessengerCallbackDataEXT *callbackData,
void *userData)
{
- constexpr VkDebugUtilsMessageSeverityFlagsEXT kSeveritiesToLog =
- VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT |
- VK_DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT;
-
- // Check if we even care about this message.
- if ((messageSeverity & kSeveritiesToLog) == 0)
- {
- return VK_FALSE;
- }
-
// See if it's an issue we are aware of and don't want to be spammed about.
if (IsIgnoredDebugMessage(callbackData->pMessageIdName))
{
@@ -753,12 +743,18 @@
// Create the messenger callback.
VkDebugUtilsMessengerCreateInfoEXT messengerInfo = {};
+ constexpr VkDebugUtilsMessageSeverityFlagsEXT kSeveritiesToLog =
+ VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT |
+ VK_DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT;
+
+ constexpr VkDebugUtilsMessageTypeFlagsEXT kMessagesToLog =
+ VK_DEBUG_UTILS_MESSAGE_TYPE_GENERAL_BIT_EXT |
+ VK_DEBUG_UTILS_MESSAGE_TYPE_VALIDATION_BIT_EXT |
+ VK_DEBUG_UTILS_MESSAGE_TYPE_PERFORMANCE_BIT_EXT;
+
messengerInfo.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT;
- messengerInfo.messageSeverity = VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT |
- VK_DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT;
- messengerInfo.messageType = VK_DEBUG_UTILS_MESSAGE_TYPE_GENERAL_BIT_EXT |
- VK_DEBUG_UTILS_MESSAGE_TYPE_VALIDATION_BIT_EXT |
- VK_DEBUG_UTILS_MESSAGE_TYPE_PERFORMANCE_BIT_EXT;
+ messengerInfo.messageSeverity = kSeveritiesToLog;
+ messengerInfo.messageType = kMessagesToLog;
messengerInfo.pfnUserCallback = &DebugUtilsMessenger;
messengerInfo.pUserData = this;
@@ -1834,6 +1830,21 @@
return hasFormatFeatureBits<&VkFormatProperties::bufferFeatures>(format, featureBits);
}
+void RendererVk::insertDebugMarker(GLenum source, GLuint id, std::string &&marker)
+{
+ mCommandGraph.insertDebugMarker(source, std::move(marker));
+}
+
+void RendererVk::pushDebugMarker(GLenum source, GLuint id, std::string &&marker)
+{
+ mCommandGraph.pushDebugMarker(source, std::move(marker));
+}
+
+void RendererVk::popDebugMarker()
+{
+ mCommandGraph.popDebugMarker();
+}
+
angle::Result RendererVk::synchronizeCpuGpuTime(vk::Context *context)
{
ASSERT(mGpuEventsEnabled);