Skip to content

Commit

Permalink
Added profiler logs for bufferBarrier()
Browse files Browse the repository at this point in the history
  • Loading branch information
corporateshark committed Oct 29, 2023
1 parent 6edbd67 commit 9a8a7ce
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lvk/LVK.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#define LVK_PROFILER_COLOR_PRESENT 0x00ff00
#define LVK_PROFILER_COLOR_CREATE 0xff6600
#define LVK_PROFILER_COLOR_DESTROY 0xffa500
#define LVK_PROFILER_COLOR_TRANSITION 0xffffff
#define LVK_PROFILER_COLOR_BARRIER 0xffffff
//
#define LVK_PROFILER_FUNCTION() ZoneScoped
#define LVK_PROFILER_FUNCTION_COLOR(color) ZoneScopedC(color)
Expand Down
8 changes: 6 additions & 2 deletions lvk/vulkan/VulkanClasses.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1025,7 +1025,7 @@ void lvk::VulkanImage::transitionLayout(VkCommandBuffer commandBuffer,
VkPipelineStageFlags srcStageMask,
VkPipelineStageFlags dstStageMask,
const VkImageSubresourceRange& subresourceRange) const {
LVK_PROFILER_FUNCTION_COLOR(LVK_PROFILER_COLOR_TRANSITION);
LVK_PROFILER_FUNCTION_COLOR(LVK_PROFILER_COLOR_BARRIER);

VkAccessFlags srcAccessMask = 0;
VkAccessFlags dstAccessMask = 0;
Expand Down Expand Up @@ -2084,6 +2084,8 @@ void lvk::CommandBuffer::cmdBindComputePipeline(lvk::ComputePipelineHandle handl
}

void lvk::CommandBuffer::cmdDispatchThreadGroups(const Dimensions& threadgroupCount, const Dependencies& deps) {
LVK_PROFILER_FUNCTION();

LVK_ASSERT(!isRendering_);

for (uint32_t i = 0; i != Dependencies::LVK_MAX_SUBMIT_DEPENDENCIES && deps.textures[i]; i++) {
Expand Down Expand Up @@ -2141,7 +2143,7 @@ void lvk::CommandBuffer::cmdPopDebugGroupLabel() const {
}

void lvk::CommandBuffer::useComputeTexture(TextureHandle handle) {
LVK_PROFILER_FUNCTION();
LVK_PROFILER_FUNCTION_COLOR(LVK_PROFILER_COLOR_BARRIER);

LVK_ASSERT(!handle.empty());
lvk::VulkanTexture* tex = ctx_->texturesPool_.get(handle);
Expand All @@ -2164,6 +2166,8 @@ void lvk::CommandBuffer::useComputeTexture(TextureHandle handle) {
}

void lvk::CommandBuffer::bufferBarrier(BufferHandle handle, VkPipelineStageFlags srcStage, VkPipelineStageFlags dstStage) {
LVK_PROFILER_FUNCTION_COLOR(LVK_PROFILER_COLOR_BARRIER);

lvk::VulkanBuffer* buf = ctx_->buffersPool_.get(handle);

const VkBufferMemoryBarrier barrier = {
Expand Down

0 comments on commit 9a8a7ce

Please sign in to comment.