Hash :
d64c54e3
Author :
Date :
2022-09-26T21:25:18
D3D11: Make DebugAnnotator11 thread safe. Bug: chromium:1366778 Change-Id: I50662895be8ec40de4ded8c4f84bde59ae40e98b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3917936 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Quyen Le <lehoangquyen@chromium.org>
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 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
//
// 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 "common/entry_points_enum_autogen.h"
#include "libANGLE/Context.h"
#include "libANGLE/renderer/vulkan/ContextVk.h"
namespace rx
{
DebugAnnotatorVk::DebugAnnotatorVk() {}
DebugAnnotatorVk::~DebugAnnotatorVk() {}
void DebugAnnotatorVk::beginEvent(gl::Context *context,
angle::EntryPoint entryPoint,
const char *eventName,
const char *eventMessage)
{
angle::LoggingAnnotator::beginEvent(context, entryPoint, eventName, eventMessage);
if (vkCmdBeginDebugUtilsLabelEXT && context)
{
ContextVk *contextVk = vk::GetImpl(static_cast<gl::Context *>(context));
contextVk->logEvent(eventMessage);
}
}
void DebugAnnotatorVk::endEvent(gl::Context *context,
const char *eventName,
angle::EntryPoint entryPoint)
{
angle::LoggingAnnotator::endEvent(context, eventName, entryPoint);
if (vkCmdBeginDebugUtilsLabelEXT && context)
{
ContextVk *contextVk = vk::GetImpl(static_cast<gl::Context *>(context));
if (angle::IsDrawEntryPoint(entryPoint))
{
contextVk->endEventLog(entryPoint, PipelineType::Graphics);
}
else if (angle::IsDispatchEntryPoint(entryPoint))
{
contextVk->endEventLog(entryPoint, PipelineType::Compute);
}
else if (angle::IsClearEntryPoint(entryPoint) || angle::IsQueryEntryPoint(entryPoint))
{
contextVk->endEventLogForClearOrQuery();
}
}
}
bool DebugAnnotatorVk::getStatus(const gl::Context *context)
{
return true;
}
} // namespace rx