Vulkan: Provide utilities to put markers and labels where needed in the GPUmodule #106098
|
@ -107,56 +107,68 @@ namespace blender {
|
|||
}
|
||||
void pushMarker(blender::gpu::VKContext *ctx, VkCommandBuffer cmd, const char *name)
|
||||
{
|
||||
VKDebuggingTools tools = ctx->debuggingtools_get();
|
||||
if (tools.enabled) {
|
||||
VkDebugUtilsLabelEXT info = {};
|
||||
info.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT;
|
||||
info.pLabelName = name;
|
||||
tools.vkCmdBeginDebugUtilsLabelEXT_r(cmd, &info);
|
||||
if (G.debug & G_DEBUG_GPU) {
|
||||
VKDebuggingTools tools = ctx->debuggingtools_get();
|
||||
if (tools.enabled) {
|
||||
VkDebugUtilsLabelEXT info = {};
|
||||
info.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT;
|
||||
info.pLabelName = name;
|
||||
tools.vkCmdBeginDebugUtilsLabelEXT_r(cmd, &info);
|
||||
}
|
||||
}
|
||||
}
|
||||
vnapdv marked this conversation as resolved
|
||||
void setMarker(blender::gpu::VKContext *ctx, VkCommandBuffer cmd, const char *name)
|
||||
{
|
||||
VKDebuggingTools tools = ctx->debuggingtools_get();
|
||||
if (tools.enabled) {
|
||||
VkDebugUtilsLabelEXT info = {};
|
||||
info.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT;
|
||||
info.pLabelName = name;
|
||||
tools.vkCmdInsertDebugUtilsLabelEXT_r(cmd, &info);
|
||||
if (G.debug & G_DEBUG_GPU) {
|
||||
VKDebuggingTools tools = ctx->debuggingtools_get();
|
||||
if (tools.enabled) {
|
||||
VkDebugUtilsLabelEXT info = {};
|
||||
vnapdv marked this conversation as resolved
Outdated
Jeroen Bakker
commented
`/home/jeroen/blender-git/blender/source/blender/gpu/vulkan/vk_debug.cc:125:26: warning: variable ‘tools’ set but not used [-Wunused-but-set-variable]`
|
||||
info.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT;
|
||||
info.pLabelName = name;
|
||||
tools.vkCmdInsertDebugUtilsLabelEXT_r(cmd, &info);
|
||||
}
|
||||
}
|
||||
Jeroen Bakker
commented
`obj` isn't very useful. would use `object_handle`
|
||||
}
|
||||
Jeroen Bakker
commented
`objType` -> `vk_object_type`
|
||||
void popMarker(blender::gpu::VKContext *ctx, VkCommandBuffer cmd)
|
||||
vnapdv marked this conversation as resolved
Outdated
Jeroen Bakker
commented
Add empty line between each function. Add empty line between each function.
|
||||
{
|
||||
VKDebuggingTools tools = ctx->debuggingtools_get();
|
||||
if (tools.enabled) {
|
||||
tools.vkCmdEndDebugUtilsLabelEXT_r(cmd);
|
||||
if (G.debug & G_DEBUG_GPU) {
|
||||
VKDebuggingTools tools = ctx->debuggingtools_get();
|
||||
if (tools.enabled) {
|
||||
tools.vkCmdEndDebugUtilsLabelEXT_r(cmd);
|
||||
}
|
||||
}
|
||||
}
|
||||
void pushMarker(blender::gpu::VKContext *ctx, VkQueue q, const char *name)
|
||||
{
|
||||
VKDebuggingTools tools = ctx->debuggingtools_get();
|
||||
if (tools.enabled) {
|
||||
VkDebugUtilsLabelEXT info = {};
|
||||
info.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT;
|
||||
info.pLabelName = name;
|
||||
tools.vkQueueBeginDebugUtilsLabelEXT_r(q, &info);
|
||||
if (G.debug & G_DEBUG_GPU) {
|
||||
VKDebuggingTools tools = ctx->debuggingtools_get();
|
||||
if (tools.enabled) {
|
||||
Jeroen Bakker
commented
Also check the other functions. `cmd` -> `vk_command_buffer`. No need to confuse readers with incorrect abbreviations.
Also check the other functions.
|
||||
VkDebugUtilsLabelEXT info = {};
|
||||
info.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT;
|
||||
info.pLabelName = name;
|
||||
tools.vkQueueBeginDebugUtilsLabelEXT_r(q, &info);
|
||||
}
|
||||
}
|
||||
}
|
||||
void setMarker(blender::gpu::VKContext *ctx, VkQueue q, const char *name)
|
||||
{
|
||||
VKDebuggingTools tools = ctx->debuggingtools_get();
|
||||
if (tools.enabled) {
|
||||
VkDebugUtilsLabelEXT info = {};
|
||||
info.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT;
|
||||
info.pLabelName = name;
|
||||
tools.vkQueueInsertDebugUtilsLabelEXT_r(q, &info);
|
||||
if (G.debug & G_DEBUG_GPU) {
|
||||
VKDebuggingTools tools = ctx->debuggingtools_get();
|
||||
if (tools.enabled) {
|
||||
VkDebugUtilsLabelEXT info = {};
|
||||
info.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT;
|
||||
info.pLabelName = name;
|
||||
tools.vkQueueInsertDebugUtilsLabelEXT_r(q, &info);
|
||||
}
|
||||
}
|
||||
}
|
||||
void popMarker(blender::gpu::VKContext *ctx, VkQueue q)
|
||||
{
|
||||
VKDebuggingTools tools = ctx->debuggingtools_get();
|
||||
if (tools.enabled) {
|
||||
tools.vkQueueEndDebugUtilsLabelEXT_r(q);
|
||||
if (G.debug & G_DEBUG_GPU) {
|
||||
VKDebuggingTools tools = ctx->debuggingtools_get();
|
||||
if (tools.enabled) {
|
||||
tools.vkQueueEndDebugUtilsLabelEXT_r(q);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
use
context
when referring toVKContext
(be consistent with other areas of the code-base)When referring to instances of the Vulkan API it is used. Eg VkCommandBuffer parameters should be named
vk_command_buffer
VKCommandBuffer (internal class) should be referred to ascommand_buffer
.Abbreviations like
q
should not be used, just call them what they arequeue
.etc