Vulkan: Add debug group for swapchain

Improves debugging swapchains when using renderdoc.

Pull Request: https://projects.blender.org/blender/blender/pulls/133190
This commit is contained in:
Jeroen Bakker
2025-01-17 11:40:11 +01:00
parent d4d046a673
commit 2f18e4fe29
2 changed files with 10 additions and 3 deletions

View File

@@ -89,6 +89,9 @@ static inline ColorTheme4f get_debug_group_color(StringRefNull name)
else if (name == "Cycles") {
return ColorTheme4f(0.0, 0.5, 1.0, 1.0);
}
else if (name == "BackBuffer.Blit") {
return ColorTheme4f(0.5, 0.7, 1.0, 1.0);
}
else {
return GPU_DEBUG_GROUP_COLOR_DEFAULT;
}

View File

@@ -5,10 +5,12 @@
/** \file
* \ingroup gpu
*/
#include "vk_context.hh"
#include "vk_debug.hh"
#include "GPU_debug.hh"
#include "vk_backend.hh"
#include "vk_context.hh"
#include "vk_debug.hh"
#include "vk_framebuffer.hh"
#include "vk_immediate.hh"
#include "vk_shader.hh"
@@ -321,6 +323,8 @@ void VKContext::swap_buffers_post_callback()
void VKContext::swap_buffers_pre_handler(const GHOST_VulkanSwapChainData &swap_chain_data)
{
GPU_debug_group_begin("BackBuffer.Blit");
VKFrameBuffer &framebuffer = *unwrap(back_left);
VKTexture *color_attachment = unwrap(unwrap(framebuffer.color_tex(0)));
@@ -357,9 +361,9 @@ void VKContext::swap_buffers_pre_handler(const GHOST_VulkanSwapChainData &swap_c
framebuffer.rendering_end(*this);
render_graph.add_node(blit_image);
GPU_debug_group_end();
descriptor_set_get().upload_descriptor_sets();
render_graph.submit_for_present(swap_chain_data.image);
device.resources.remove_image(swap_chain_data.image);
#if 0
device.debug_print();