Skip to content

Commit

Permalink
igl | More profiling coverage
Browse files Browse the repository at this point in the history
Summary: More Tracy profiling coverage. Vulkan draw ops now have distinct colors.

Reviewed By: EricGriffith

Differential Revision: D50949872

fbshipit-source-id: 9f6864bc555b69b26c88559c4d884e666b96c942
  • Loading branch information
corporateshark authored and facebook-github-bot committed Nov 3, 2023
1 parent 414bbc3 commit 73ca85a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 2 additions & 0 deletions shell/windows/vulkan/App.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@ std::shared_ptr<igl::shell::PlatformWin> createPlatform(GLFWwindow* window) {
}

igl::SurfaceTextures getVulkanSurfaceTextures(igl::IDevice& device) {
IGL_PROFILER_FUNCTION();

const auto& vkPlatformDevice = device.getPlatformDevice<igl::vulkan::PlatformDevice>();

IGL_ASSERT(vkPlatformDevice != nullptr);
Expand Down
1 change: 1 addition & 0 deletions src/igl/Macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
10 changes: 5 additions & 5 deletions src/igl/vulkan/RenderCommandEncoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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_;

Expand All @@ -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_;

Expand Down Expand Up @@ -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);
Expand All @@ -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();

Expand All @@ -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();

Expand Down

0 comments on commit 73ca85a

Please sign in to comment.