nv2a/vk: Add debug helper function for inserting markers

This commit is contained in:
Matt Borgerson 2024-07-26 17:21:01 -07:00 committed by mborgerson
parent 49ae576006
commit 7018f379b3
2 changed files with 14 additions and 0 deletions

View File

@ -57,3 +57,16 @@ void pgraph_vk_debug_frame_terminator(void)
}
#endif
}
void pgraph_vk_insert_debug_marker(PGRAPHVkState *r, VkCommandBuffer cmd,
const char *name, float color[4])
{
if (r->debug_utils_extension_enabled) {
VkDebugUtilsLabelEXT label_info = {
.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT,
.pLabelName = name,
};
memcpy(label_info.color, color, 4 * sizeof(float));
vkCmdInsertDebugUtilsLabelEXT(cmd, &label_info);
}
}

View File

@ -380,6 +380,7 @@ void pgraph_vk_check_memory_budget(PGRAPHState *pg);
// debug.c
void pgraph_vk_debug_init(void);
void pgraph_vk_insert_debug_marker(PGRAPHVkState *r, VkCommandBuffer cmd, const char* name, float color[4]);
// instance.c
void pgraph_vk_init_instance(PGRAPHState *pg, Error **errp);