diff --git a/kraken/KRDevice.cpp b/kraken/KRDevice.cpp index 93e17a6..9d43ea3 100644 --- a/kraken/KRDevice.cpp +++ b/kraken/KRDevice.cpp @@ -557,6 +557,7 @@ void KRDevice::getQueueFamiliesForSharing(uint32_t* queueFamilyIndices, uint32_t } #if KRENGINE_DEBUG_GPU_LABELS + void KRDevice::setDebugLabel(uint64_t objectHandle, VkObjectType objectType, const char* debugLabel) { VkDebugUtilsObjectNameInfoEXT debugInfo{}; diff --git a/kraken/KRRenderPass.cpp b/kraken/KRRenderPass.cpp index 427e238..0567b0b 100644 --- a/kraken/KRRenderPass.cpp +++ b/kraken/KRRenderPass.cpp @@ -72,6 +72,19 @@ void KRRenderPass::destroy(KRDevice& device) void KRRenderPass::begin(VkCommandBuffer& commandBuffer, KRSurface& surface) { + +#if KRENGINE_DEBUG_GPU_LABELS + VkDebugUtilsLabelEXT debugLabel{}; + debugLabel.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT; + debugLabel.color[0] = 0.0f; + debugLabel.color[1] = 0.0f; + debugLabel.color[2] = 0.0f; + debugLabel.color[3] = 0.0f; + debugLabel.pNext = nullptr; + debugLabel.pLabelName = m_info.debugLabel; + vkCmdBeginDebugUtilsLabelEXT(commandBuffer, &debugLabel); +#endif + int attachmentCount = 0; std::array clearValues{}; if (m_info.depthAttachment.id != 0) { @@ -100,9 +113,11 @@ void KRRenderPass::begin(VkCommandBuffer& commandBuffer, KRSurface& surface) void KRRenderPass::end(VkCommandBuffer& commandBuffer) { vkCmdEndRenderPass(commandBuffer); +#if KRENGINE_DEBUG_GPU_LABELS + vkCmdEndDebugUtilsLabelEXT(commandBuffer); +#endif } - RenderPassType KRRenderPass::getType() const { return m_info.type;