Commit 6534a6f8 by Jamie Madill Committed by Commit Bot

Revert "Vulkan:Add debug labels for OpenGL calls"

This reverts commit 3705fc41. Reason for revert: Causes errors on Debug bots. See bug. Bug: angleproject:5121 Original change's description: > Vulkan:Add debug labels for OpenGL calls > > Implement the DebugAnnotatorVk class, and plumb the EVENT macro in the > GL entrypoints to save a string of call info in the vector of all > GL calls in ContextVk. > > Then add a vkCmdBeginDebugUtilsLabelEXT() call that includes the > OpenGL draw/dispatch call prior to any Vulkan Draw or Dispatch calls. > Also embedded under that label add a second > vkCmdBeginDebugUtilsLabelEXT() call labeled "OpenGL Commands" that > includes all of the OpenGL calls leading up to the draw/dispatch. > Each individual OpenGL call is then given its own > vkCmdBegin/EndDebugUtilsLabelEXT() pair so that the complete sequence > of GL calls leading up to a draw call is visible for each Draw. > > Enable the OGL->VK mapping feature by setting > "angle_enable_trace = true" in GN args. > > Note: This will create an ANGLE APK on Android that generally won't > work with games, unless launched by AGI (which provides the debug > utils extension). A future version will disable these labels unless > the debug utils extension is found. > > Bug: b/162068318 > Bug: b/169243237 > Change-Id: I09886f17fa9287528c12552698738ea1fe2a4b8c > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2427557 > Commit-Queue: Ian Elliott <ianelliott@google.com> > Reviewed-by: Tim Van Patten <timvp@google.com> > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> TBR=courtneygo@google.com,ianelliott@google.com,timvp@google.com,syoussefi@chromium.org,jmadill@chromium.org # Not skipping CQ checks because original CL landed > 1 day ago. Bug: b/162068318 Bug: b/169243237 Change-Id: I772d549213e1ad64ae58a1937e5de0f7ea740084 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2444094Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarYuly Novikov <ynovikov@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
parent 7b25b643
......@@ -81,7 +81,7 @@ std::ostream *gSwallowStream;
bool DebugAnnotationsActive()
{
#if defined(ANGLE_ENABLE_DEBUG_ANNOTATIONS) || defined(ANGLE_ENABLE_DEBUG_TRACE)
#if defined(ANGLE_ENABLE_DEBUG_ANNOTATIONS)
return g_debugAnnotator != nullptr && g_debugAnnotator->getStatus();
#else
return false;
......
......@@ -27,8 +27,6 @@ _vulkan_backend_sources = [
"CompilerVk.h",
"ContextVk.cpp",
"ContextVk.h",
"DebugAnnotatorVk.cpp",
"DebugAnnotatorVk.h",
"DeviceVk.cpp",
"DeviceVk.h",
"DisplayVk.cpp",
......
......@@ -261,9 +261,6 @@ class ContextVk : public ContextImpl, public vk::Context
const std::string &message) override;
angle::Result popDebugGroup(const gl::Context *context) override;
// Record GL API calls for debuggers
void logEvent(const char *eventString) { mEventLog.push_back(eventString); }
bool isViewportFlipEnabledForDrawFBO() const;
bool isViewportFlipEnabledForReadFBO() const;
// When the device/surface is rotated such that the surface's aspect ratio is different than
......@@ -955,9 +952,6 @@ class ContextVk : public ContextImpl, public vk::Context
bool shouldSwitchToReadOnlyDepthFeedbackLoopMode(const gl::Context *context,
gl::Texture *texture) const;
// Record GL API calls for debuggers
void writeEventLog(const gl::Context *context, vk::CommandBuffer *commandBuffer);
std::array<DirtyBitHandler, DIRTY_BIT_MAX> mGraphicsDirtyBitHandlers;
std::array<DirtyBitHandler, DIRTY_BIT_MAX> mComputeDirtyBitHandlers;
......@@ -1155,9 +1149,6 @@ class ContextVk : public ContextImpl, public vk::Context
vk::DynamicBuffer mStagingBuffer;
std::vector<std::string> mCommandBufferDiagnostics;
// Record GL API calls for debuggers
std::vector<std::string> mEventLog;
};
ANGLE_INLINE angle::Result ContextVk::endRenderPassIfTransformFeedbackBuffer(
......
//
// Copyright 2020 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// DebugAnnotatorVk.cpp: Vulkan helpers for adding trace annotations.
//
#include "libANGLE/renderer/vulkan/DebugAnnotatorVk.h"
#include "libANGLE/Context.h"
#include "libANGLE/renderer/vulkan/ContextVk.h"
namespace rx
{
DebugAnnotatorVk::DebugAnnotatorVk() {}
DebugAnnotatorVk::~DebugAnnotatorVk() {}
void DebugAnnotatorVk::beginEvent(gl::Context *context,
const char *eventName,
const char *eventMessage)
{
angle::LoggingAnnotator::beginEvent(context, eventName, eventMessage);
if (context)
{
ContextVk *contextVk = vk::GetImpl(static_cast<gl::Context *>(context));
contextVk->logEvent(eventMessage);
}
}
void DebugAnnotatorVk::endEvent(const char *eventName)
{
angle::LoggingAnnotator::endEvent(eventName);
}
bool DebugAnnotatorVk::getStatus()
{
return true;
}
} // namespace rx
//
// Copyright 2020 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// DebugAnnotatorVk.h: Vulkan helpers for adding trace annotations.
//
#ifndef LIBANGLE_RENDERER_VULKAN_DEBUGANNOTATORVK_H_
#define LIBANGLE_RENDERER_VULKAN_DEBUGANNOTATORVK_H_
#include "libANGLE/LoggingAnnotator.h"
namespace rx
{
class DebugAnnotatorVk : public angle::LoggingAnnotator
{
public:
DebugAnnotatorVk();
~DebugAnnotatorVk() override;
void beginEvent(gl::Context *context, const char *eventName, const char *eventMessage) override;
void endEvent(const char *eventName) override;
bool getStatus() override;
// Note: To avoid any race conditions between threads, this class has no private data; all
// events are stored in ContextVk.
};
} // namespace rx
#endif // LIBANGLE_RENDERER_VULKAN_DEBUGANNOTATORVK_H_
......@@ -902,14 +902,11 @@ angle::Result RendererVk::initialize(DisplayVk *displayVk,
// Initialize the format table.
mFormatTable.initialize(this, &mNativeTextureCaps, &mNativeCaps.compressedTextureFormats);
gl::InitializeDebugAnnotations(&mAnnotator);
if (getFeatures().enableCommandProcessingThread.enabled)
{
mCommandProcessorThread =
std::thread(&CommandProcessor::processCommandProcessorTasks, &mCommandProcessor);
}
return angle::Result::Continue;
}
......
......@@ -27,7 +27,6 @@
#include "libANGLE/BlobCache.h"
#include "libANGLE/Caps.h"
#include "libANGLE/renderer/vulkan/CommandProcessor.h"
#include "libANGLE/renderer/vulkan/DebugAnnotatorVk.h"
#include "libANGLE/renderer/vulkan/QueryVk.h"
#include "libANGLE/renderer/vulkan/ResourceVk.h"
#include "libANGLE/renderer/vulkan/UtilsVk.h"
......@@ -370,8 +369,6 @@ class RendererVk : angle::NonCopyable
std::string mLastValidationMessage;
uint32_t mValidationMessageCount;
DebugAnnotatorVk mAnnotator;
// How close to VkPhysicalDeviceLimits::maxMemoryAllocationCount we allow ourselves to get
static constexpr double kPercentMaxMemoryAllocationCount = 0.3;
// How many objects to garbage collect before issuing a flush()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment