From 39fc0b5af67aa2dc0763394b0727e919840f9f57 Mon Sep 17 00:00:00 2001 From: quou Date: Sun, 29 Dec 2024 23:06:39 +1100 Subject: debug markers --- video.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'video.cpp') diff --git a/video.cpp b/video.cpp index 586a78e..165dd9b 100644 --- a/video.cpp +++ b/video.cpp @@ -2303,6 +2303,25 @@ void Context::transition(Texture_Id id, Resource_State state) { ); } +void Context::debug_push(const char* name) { +#ifdef DEBUG + VkDebugUtilsLabelEXT l{}; + Context_Vk* ctx = (Context_Vk*)this; + l.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT; + l.pLabelName = name; + vkCmdBeginDebugUtilsLabelEXT(ctx->cb, &l); +#else + (void)name; +#endif +} + +void Context::debug_pop() { +#ifdef DEBUG + Context_Vk* ctx = (Context_Vk*)this; + vkCmdEndDebugUtilsLabelEXT(ctx->cb); +#endif +} + std::pair Context_Vk::begin_rp( const Render_Pass& rp ) { -- cgit v1.2.3-54-g00ecf