Vulkan: Provide utilities to put markers and labels where needed in the GPUmodule #106098
|
@ -16,6 +16,7 @@
|
|||
#include "vk_mem_alloc.h"
|
||||
|
||||
#include "gpu_texture_private.hh"
|
||||
#include <typeinfo>
|
||||
vnapdv marked this conversation as resolved
Outdated
|
||||
|
||||
namespace blender::gpu {
|
||||
|
||||
|
@ -25,11 +26,11 @@ VkComponentMapping to_vk_component_mapping(const eGPUTextureFormat format);
|
|||
VkImageViewType to_vk_image_view_type(const eGPUTextureType type);
|
||||
VkImageType to_vk_image_type(const eGPUTextureType type);
|
||||
#ifdef __cplusplus
|
||||
template<typename T> VkObjectType to_vk_object_type(T vk_obj)
|
||||
template<typename T> VkObjectType to_vk_object_type(T /*vk_obj*/)
|
||||
{
|
||||
const type_info &tid = typeid(T);
|
||||
const std::type_info &tid = typeid(T);
|
||||
#define VK_EQ_TYPEID(name, name2) \
|
||||
if (tid == typeid(name##)) { \
|
||||
if (tid == typeid(name)) { \
|
||||
return VK_OBJECT_TYPE_##name2; \
|
||||
}
|
||||
|
||||
|
|
|
@ -79,7 +79,6 @@ namespace blender {
|
|||
bool init_vk_callbacks(VKContext* ctx, PFN_vkGetInstanceProcAddr instload)
|
||||
{
|
||||
CLOG_ENSURE(&LOG);
|
||||
VKDebuggingTools tools = ctx->debuggingtools_get();
|
||||
if (instload ) {
|
||||
vulkan_dynamic_debug_functions(ctx, instload);
|
||||
return true;
|
||||
|
|
|
@ -34,16 +34,19 @@ namespace blender {
|
|||
}VKDebuggingTools;
|
||||
bool init_vk_callbacks(VKContext* ctx, PFN_vkGetInstanceProcAddr instload);
|
||||
vnapdv marked this conversation as resolved
Outdated
Jeroen Bakker
commented
we should remove vk from the function names it is redundant in these cases we should remove vk from the function names it is redundant in these cases
|
||||
void destroy_vk_callbacks(VKContext* ctx);
|
||||
void object_vk_label(VKContext* ctx, VkObjectType objType, uint64_t obj, const char* name);
|
||||
template<typename T> void object_vk_label(VKContext* ctx, T obj, const char* name) {
|
||||
if (!(G.debug & G_DEBUG_GPU)) {
|
||||
Jeroen Bakker
commented
`obj` -> `object_handle`
|
||||
return;
|
||||
//return;
|
||||
}
|
||||
char label[64];
|
||||
const size_t label_size = 64;
|
||||
char label[label_size];
|
||||
memset(label,0,label_size);
|
||||
static int stats = 0;
|
||||
SNPRINTF(label, "%s_%d", name, stats++);
|
||||
object_vk_label(ctx, to_vk_object_type(obj), (uint64_t)obj, label);
|
||||
object_vk_label(ctx, to_vk_object_type(obj), (uint64_t)obj, (const char*)label);
|
||||
};
|
||||
void object_vk_label(VKContext* ctx, VkObjectType objType, uint64_t obj, const char* name);
|
||||
|
||||
void pushMarker(VKContext *ctx, VkCommandBuffer cmd, const char *name);
|
||||
void setMarker(VKContext *ctx, VkCommandBuffer cmd, const char *name);
|
||||
void popMarker(VKContext *ctx, VkCommandBuffer cmd);
|
||||
vnapdv marked this conversation as resolved
Outdated
Jeroen Bakker
commented
`push_marker` / `pop_marker` / `set_marker`
Jeroen Bakker
commented
Also update the definitions to match the parameter names of the implementation. Also update the definitions to match the parameter names of the implementation.
|
||||
|
|
Loading…
Reference in New Issue
Add one line between imports of different categories. Put system includes on top.