From 73ca85a36f3506a37c18936af3dbd15966685a66 Mon Sep 17 00:00:00 2001 From: Sergey Kosarevsky Date: Thu, 2 Nov 2023 22:36:42 -0700 Subject: [PATCH] igl | More profiling coverage Summary: More Tracy profiling coverage. Vulkan draw ops now have distinct colors. Reviewed By: EricGriffith Differential Revision: D50949872 fbshipit-source-id: 9f6864bc555b69b26c88559c4d884e666b96c942 --- shell/windows/vulkan/App.cpp | 2 ++ src/igl/Macros.h | 1 + src/igl/vulkan/RenderCommandEncoder.cpp | 10 +++++----- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/shell/windows/vulkan/App.cpp b/shell/windows/vulkan/App.cpp index 16d66a40d5..2a1fbfd087 100644 --- a/shell/windows/vulkan/App.cpp +++ b/shell/windows/vulkan/App.cpp @@ -163,6 +163,8 @@ std::shared_ptr createPlatform(GLFWwindow* window) { } igl::SurfaceTextures getVulkanSurfaceTextures(igl::IDevice& device) { + IGL_PROFILER_FUNCTION(); + const auto& vkPlatformDevice = device.getPlatformDevice(); IGL_ASSERT(vkPlatformDevice != nullptr); diff --git a/src/igl/Macros.h b/src/igl/Macros.h index 7d88cac8dd..2d200f20fc 100644 --- a/src/igl/Macros.h +++ b/src/igl/Macros.h @@ -358,6 +358,7 @@ #define IGL_PROFILER_COLOR_DESTROY 0xffa500 #define IGL_PROFILER_COLOR_TRANSITION 0xffffff #define IGL_PROFILER_COLOR_UPDATE 0xffa500 +#define IGL_PROFILER_COLOR_DRAW 0x00ff00 // #define IGL_PROFILER_FUNCTION() ZoneScoped #define IGL_PROFILER_FUNCTION_COLOR(color) ZoneScopedC(color) diff --git a/src/igl/vulkan/RenderCommandEncoder.cpp b/src/igl/vulkan/RenderCommandEncoder.cpp index c7d38eef20..ac327ca0df 100644 --- a/src/igl/vulkan/RenderCommandEncoder.cpp +++ b/src/igl/vulkan/RenderCommandEncoder.cpp @@ -582,7 +582,7 @@ void RenderCommandEncoder::bindPipeline() { void RenderCommandEncoder::draw(PrimitiveType primitiveType, size_t vertexStart, size_t vertexCount) { - IGL_PROFILER_FUNCTION(); + IGL_PROFILER_FUNCTION_COLOR(IGL_PROFILER_COLOR_DRAW); ctx_.drawCallCount_ += drawCallCountEnabled_; @@ -608,7 +608,7 @@ void RenderCommandEncoder::drawIndexed(PrimitiveType primitiveType, IndexFormat indexFormat, IBuffer& indexBuffer, size_t indexBufferOffset) { - IGL_PROFILER_FUNCTION(); + IGL_PROFILER_FUNCTION_COLOR(IGL_PROFILER_COLOR_DRAW); ctx_.drawCallCount_ += drawCallCountEnabled_; @@ -641,7 +641,7 @@ void RenderCommandEncoder::drawIndexedIndirect(PrimitiveType primitiveType, IBuffer& indexBuffer, IBuffer& indirectBuffer, size_t indirectBufferOffset) { - IGL_PROFILER_FUNCTION(); + IGL_PROFILER_FUNCTION_COLOR(IGL_PROFILER_COLOR_DRAW); multiDrawIndexedIndirect( primitiveType, indexFormat, indexBuffer, indirectBuffer, indirectBufferOffset, 1, 0); @@ -652,7 +652,7 @@ void RenderCommandEncoder::multiDrawIndirect(PrimitiveType primitiveType, size_t indirectBufferOffset, uint32_t drawCount, uint32_t stride) { - IGL_PROFILER_FUNCTION(); + IGL_PROFILER_FUNCTION_COLOR(IGL_PROFILER_COLOR_DRAW); ensureVertexBuffers(); @@ -678,7 +678,7 @@ void RenderCommandEncoder::multiDrawIndexedIndirect(PrimitiveType primitiveType, size_t indirectBufferOffset, uint32_t drawCount, uint32_t stride) { - IGL_PROFILER_FUNCTION(); + IGL_PROFILER_FUNCTION_COLOR(IGL_PROFILER_COLOR_DRAW); ensureVertexBuffers();