mirror of https://github.com/xemu-project/xemu.git
nv2a/vk: Make pgraph_vk_insert_debug_marker format strings
This commit is contained in:
parent
ca42f0f2df
commit
9ab1f96911
|
@ -59,14 +59,25 @@ void pgraph_vk_debug_frame_terminator(void)
|
|||
}
|
||||
|
||||
void pgraph_vk_insert_debug_marker(PGRAPHVkState *r, VkCommandBuffer cmd,
|
||||
const char *name, float color[4])
|
||||
float color[4], const char *format, ...)
|
||||
{
|
||||
if (r->debug_utils_extension_enabled) {
|
||||
if (!r->debug_utils_extension_enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
char *buf = NULL;
|
||||
|
||||
va_list args;
|
||||
va_start(args, format);
|
||||
int err = vasprintf(&buf, format, args);
|
||||
assert(err >= 0);
|
||||
va_end(args);
|
||||
|
||||
VkDebugUtilsLabelEXT label_info = {
|
||||
.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT,
|
||||
.pLabelName = name,
|
||||
.pLabelName = buf,
|
||||
};
|
||||
memcpy(label_info.color, color, 4 * sizeof(float));
|
||||
vkCmdInsertDebugUtilsLabelEXT(cmd, &label_info);
|
||||
}
|
||||
free(buf);
|
||||
}
|
||||
|
|
|
@ -392,7 +392,8 @@ 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]);
|
||||
void pgraph_vk_insert_debug_marker(PGRAPHVkState *r, VkCommandBuffer cmd,
|
||||
float color[4], const char *format, ...) __attribute__ ((format (printf, 4, 5)));
|
||||
|
||||
// instance.c
|
||||
void pgraph_vk_init_instance(PGRAPHState *pg, Error **errp);
|
||||
|
|
Loading…
Reference in New Issue