Hash :
bc4ec4c1
Author :
Date :
2020-10-05T17:10:18
Vulkan: Plumb OpenGL ES commands to AGI/debuggers Use vkCmd*DebugUtilsLabelEXT() calls to delimit all GLES commands, and group them under GLES draw/dispatch calls. Plumb calls from the EVENT macro (for every GL entrypoint) to vkCmd*DebugUtilsLabelEXT() via a newly-implemented DebugAnnotatorVk class. Use a new dirty bit so that cached entrypoints are associated with a triggering draw/dispatch command. The DebugAnnotatorVk::beginEvent() method saves a string in a vector of all GL commands in ContextVk. The dirty bit converts the strings into begin-end vkCmd*DebugUtilsLabelEXT() pairs. The DebugAnnotatorVk::endEvent() method makes the final vkCmdEndDebugUtilsLabelEXT() call for a draw/dispatch command. Enable the OGL->VK mapping feature by setting "angle_enable_trace = true" in GN args. Bug: b/162068318 Bug: b/169243237 Change-Id: I61b6a8d113168c0ce578d6efd002d8a393659aba Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2451517 Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Ian Elliott <ianelliott@google.com>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
//
// 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,
gl::EntryPoint entryPoint,
const char *eventName,
const char *eventMessage) override;
void endEvent(gl::Context *context, const char *eventName, gl::EntryPoint entryPoint) override;
bool getStatus() override;
private:
bool isDrawOrDispatchEntryPoint(gl::EntryPoint entryPoint) const;
// 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_