Commit b50541b2 by Tobin Ehlis Committed by Commit Bot

Vulkan:Adding key perf trace markers

Adding trace markers in performance-critical functions. Primary areas of interest are command buffer processing and cleanup and memory mapping. Bug: b/156403378 Change-Id: Icba53024771711d79f7eee7085bf4dae0e033e63 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2002689Reviewed-by: 's avatarCharlie Lao <cclao@google.com> Reviewed-by: 's avatarTobin Ehlis <tobine@google.com> Commit-Queue: Tobin Ehlis <tobine@google.com>
parent d8074714
...@@ -344,6 +344,7 @@ angle::Result BufferVk::mapRange(const gl::Context *context, ...@@ -344,6 +344,7 @@ angle::Result BufferVk::mapRange(const gl::Context *context,
GLbitfield access, GLbitfield access,
void **mapPtr) void **mapPtr)
{ {
ANGLE_TRACE_EVENT0("gpu.angle", "BufferVk::mapRange");
return mapRangeImpl(vk::GetImpl(context), offset, length, access, mapPtr); return mapRangeImpl(vk::GetImpl(context), offset, length, access, mapPtr);
} }
......
...@@ -347,6 +347,7 @@ angle::Result CommandQueue::init(vk::Context *context) ...@@ -347,6 +347,7 @@ angle::Result CommandQueue::init(vk::Context *context)
angle::Result CommandQueue::checkCompletedCommands(vk::Context *context) angle::Result CommandQueue::checkCompletedCommands(vk::Context *context)
{ {
ANGLE_TRACE_EVENT0("gpu.angle", "CommandQueue::checkCompletedCommands");
RendererVk *renderer = context->getRenderer(); RendererVk *renderer = context->getRenderer();
VkDevice device = renderer->getDevice(); VkDevice device = renderer->getDevice();
...@@ -1863,6 +1864,7 @@ void ContextVk::flushGpuEvents(double nextSyncGpuTimestampS, double nextSyncCpuT ...@@ -1863,6 +1864,7 @@ void ContextVk::flushGpuEvents(double nextSyncGpuTimestampS, double nextSyncCpuT
void ContextVk::clearAllGarbage() void ContextVk::clearAllGarbage()
{ {
ANGLE_TRACE_EVENT0("gpu.angle", "ContextVk::clearAllGarbage");
for (vk::GarbageObject &garbage : mCurrentGarbage) for (vk::GarbageObject &garbage : mCurrentGarbage)
{ {
garbage.destroy(mRenderer); garbage.destroy(mRenderer);
......
...@@ -164,6 +164,7 @@ angle::Result FramebufferVk::invalidateSub(const gl::Context *context, ...@@ -164,6 +164,7 @@ angle::Result FramebufferVk::invalidateSub(const gl::Context *context,
angle::Result FramebufferVk::clear(const gl::Context *context, GLbitfield mask) angle::Result FramebufferVk::clear(const gl::Context *context, GLbitfield mask)
{ {
ANGLE_TRACE_EVENT0("gpu.angle", "FramebufferVk::clear");
ContextVk *contextVk = vk::GetImpl(context); ContextVk *contextVk = vk::GetImpl(context);
bool clearColor = IsMaskFlagSet(mask, static_cast<GLbitfield>(GL_COLOR_BUFFER_BIT)); bool clearColor = IsMaskFlagSet(mask, static_cast<GLbitfield>(GL_COLOR_BUFFER_BIT));
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include "libANGLE/renderer/vulkan/SecondaryCommandBuffer.h" #include "libANGLE/renderer/vulkan/SecondaryCommandBuffer.h"
#include "common/debug.h" #include "common/debug.h"
#include "libANGLE/renderer/vulkan/vk_utils.h" #include "libANGLE/renderer/vulkan/vk_utils.h"
#include "libANGLE/trace.h"
namespace rx namespace rx
{ {
...@@ -144,6 +145,7 @@ void SecondaryCommandBuffer::executeQueuedResetQueryPoolCommands(VkCommandBuffer ...@@ -144,6 +145,7 @@ void SecondaryCommandBuffer::executeQueuedResetQueryPoolCommands(VkCommandBuffer
// Parse the cmds in this cmd buffer into given primary cmd buffer // Parse the cmds in this cmd buffer into given primary cmd buffer
void SecondaryCommandBuffer::executeCommands(VkCommandBuffer cmdBuffer) void SecondaryCommandBuffer::executeCommands(VkCommandBuffer cmdBuffer)
{ {
ANGLE_TRACE_EVENT0("gpu.angle", "SecondaryCommandBuffer::executeCommands");
for (const CommandHeader *command : mCommands) for (const CommandHeader *command : mCommands)
{ {
for (const CommandHeader *currentCommand = command; for (const CommandHeader *currentCommand = command;
......
...@@ -593,6 +593,7 @@ GarbageObject &GarbageObject::operator=(GarbageObject &&rhs) ...@@ -593,6 +593,7 @@ GarbageObject &GarbageObject::operator=(GarbageObject &&rhs)
// which fails to compile with reinterpret_cast, requiring static_cast. // which fails to compile with reinterpret_cast, requiring static_cast.
void GarbageObject::destroy(RendererVk *renderer) void GarbageObject::destroy(RendererVk *renderer)
{ {
ANGLE_TRACE_EVENT0("gpu.angle", "GarbageObject::destroy");
VkDevice device = renderer->getDevice(); VkDevice device = renderer->getDevice();
switch (mHandleType) switch (mHandleType)
{ {
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include "libANGLE/renderer/renderer_utils.h" #include "libANGLE/renderer/renderer_utils.h"
#include "libANGLE/renderer/vulkan/vk_headers.h" #include "libANGLE/renderer/vulkan/vk_headers.h"
#include "libANGLE/renderer/vulkan/vk_mem_alloc_wrapper.h" #include "libANGLE/renderer/vulkan/vk_mem_alloc_wrapper.h"
#include "libANGLE/trace.h"
namespace rx namespace rx
{ {
...@@ -719,6 +720,7 @@ ANGLE_INLINE VkResult CommandBuffer::begin(const VkCommandBufferBeginInfo &info) ...@@ -719,6 +720,7 @@ ANGLE_INLINE VkResult CommandBuffer::begin(const VkCommandBufferBeginInfo &info)
ANGLE_INLINE VkResult CommandBuffer::end() ANGLE_INLINE VkResult CommandBuffer::end()
{ {
ANGLE_TRACE_EVENT0("gpu.angle", "CommandBuffer::end");
ASSERT(valid()); ASSERT(valid());
return vkEndCommandBuffer(mHandle); return vkEndCommandBuffer(mHandle);
} }
...@@ -1358,6 +1360,7 @@ ANGLE_INLINE VkResult DeviceMemory::map(VkDevice device, ...@@ -1358,6 +1360,7 @@ ANGLE_INLINE VkResult DeviceMemory::map(VkDevice device,
VkMemoryMapFlags flags, VkMemoryMapFlags flags,
uint8_t **mapPointer) const uint8_t **mapPointer) const
{ {
ANGLE_TRACE_EVENT0("gpu.angle", "DeviceMemory::map");
ASSERT(valid()); ASSERT(valid());
return vkMapMemory(device, mHandle, offset, size, flags, reinterpret_cast<void **>(mapPointer)); return vkMapMemory(device, mHandle, offset, size, flags, reinterpret_cast<void **>(mapPointer));
} }
......
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