A lot of files were missing copyright field in the header and
the Blender Foundation contributed to them in a sense of bug
fixing and general maintenance.
This change makes it explicit that those files are at least
partially copyrighted by the Blender Foundation.
Note that this does not make it so the Blender Foundation is
the only holder of the copyright in those files, and developers
who do not have a signed contract with the foundation still
hold the copyright as well.
Another aspect of this change is using SPDX format for the
header. We already used it for the license specification,
and now we state it for the copyright as well, following the
FAQ:
https://reuse.software/faq/
63 lines
2.2 KiB
C++
63 lines
2.2 KiB
C++
/* SPDX-FileCopyrightText: 2023 Blender Foundation. All rights reserved.
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
|
|
/** \file
|
|
* \ingroup gpu
|
|
*/
|
|
#pragma once
|
|
|
|
#include "BKE_global.h"
|
|
#include "BLI_string.h"
|
|
|
|
#include "vk_common.hh"
|
|
|
|
#include <typeindex>
|
|
|
|
namespace blender::gpu {
|
|
class VKContext;
|
|
class VKDevice;
|
|
|
|
namespace debug {
|
|
struct VKDebuggingTools {
|
|
bool enabled = false;
|
|
/* Function pointer definitions. */
|
|
PFN_vkCreateDebugUtilsMessengerEXT vkCreateDebugUtilsMessengerEXT_r = nullptr;
|
|
PFN_vkDestroyDebugUtilsMessengerEXT vkDestroyDebugUtilsMessengerEXT_r = nullptr;
|
|
PFN_vkSubmitDebugUtilsMessageEXT vkSubmitDebugUtilsMessageEXT_r = nullptr;
|
|
PFN_vkCmdBeginDebugUtilsLabelEXT vkCmdBeginDebugUtilsLabelEXT_r = nullptr;
|
|
PFN_vkCmdEndDebugUtilsLabelEXT vkCmdEndDebugUtilsLabelEXT_r = nullptr;
|
|
PFN_vkCmdInsertDebugUtilsLabelEXT vkCmdInsertDebugUtilsLabelEXT_r = nullptr;
|
|
PFN_vkQueueBeginDebugUtilsLabelEXT vkQueueBeginDebugUtilsLabelEXT_r = nullptr;
|
|
PFN_vkQueueEndDebugUtilsLabelEXT vkQueueEndDebugUtilsLabelEXT_r = nullptr;
|
|
PFN_vkQueueInsertDebugUtilsLabelEXT vkQueueInsertDebugUtilsLabelEXT_r = nullptr;
|
|
PFN_vkSetDebugUtilsObjectNameEXT vkSetDebugUtilsObjectNameEXT_r = nullptr;
|
|
PFN_vkSetDebugUtilsObjectTagEXT vkSetDebugUtilsObjectTagEXT_r = nullptr;
|
|
|
|
void init(VkInstance vk_instance);
|
|
void deinit();
|
|
};
|
|
|
|
void object_label(VkObjectType vk_object_type, uint64_t object_handle, const char *name);
|
|
template<typename T> void object_label(T vk_object_type, const char *name)
|
|
{
|
|
if (!(G.debug & G_DEBUG_GPU)) {
|
|
return;
|
|
}
|
|
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_label(to_vk_object_type(vk_object_type), (uint64_t)vk_object_type, (const char *)label);
|
|
};
|
|
|
|
void push_marker(VkCommandBuffer vk_command_buffer, const char *name);
|
|
void set_marker(VkCommandBuffer vk_command_buffer, const char *name);
|
|
void pop_marker(VkCommandBuffer vk_command_buffer);
|
|
void push_marker(const VKDevice &device, const char *name);
|
|
void set_marker(const VKDevice &device, const char *name);
|
|
void pop_marker(const VKDevice &device);
|
|
} // namespace debug
|
|
} // namespace blender::gpu
|