Skip to content
Snippets Groups Projects
Commit 68b587bf authored by Alex Laptop's avatar Alex Laptop
Browse files

[#114] Add separate macro for vulkan debug labels, so labels can be used in Release mode

parent 3dd21e3a
No related branches found
No related tags found
1 merge request!98Resolve "Voxelization auf AMD iGPU broken"
Pipeline #27279 passed
...@@ -45,6 +45,9 @@ endif() ...@@ -45,6 +45,9 @@ endif()
# configure everything to use the required dependencies # configure everything to use the required dependencies
include(${vkcv_config}/Libraries.cmake) include(${vkcv_config}/Libraries.cmake)
# set macro to enable vulkan debug labels
list(APPEND vkcv_definitions VULKAN_DEBUG_LABELS)
# set the compile definitions aka preprocessor variables # set the compile definitions aka preprocessor variables
add_compile_definitions(${vkcv_definitions}) add_compile_definitions(${vkcv_definitions})
......
...@@ -443,7 +443,7 @@ namespace vkcv ...@@ -443,7 +443,7 @@ namespace vkcv
void Core::recordBeginDebugLabel(const CommandStreamHandle &cmdStream, void Core::recordBeginDebugLabel(const CommandStreamHandle &cmdStream,
const std::string& label, const std::string& label,
const std::array<float, 4>& color) { const std::array<float, 4>& color) {
#ifndef NDEBUG #ifdef VULKAN_DEBUG_LABELS
static PFN_vkCmdBeginDebugUtilsLabelEXT beginDebugLabel = reinterpret_cast<PFN_vkCmdBeginDebugUtilsLabelEXT>( static PFN_vkCmdBeginDebugUtilsLabelEXT beginDebugLabel = reinterpret_cast<PFN_vkCmdBeginDebugUtilsLabelEXT>(
m_Context.getDevice().getProcAddr("vkCmdBeginDebugUtilsLabelEXT") m_Context.getDevice().getProcAddr("vkCmdBeginDebugUtilsLabelEXT")
); );
...@@ -462,11 +462,11 @@ namespace vkcv ...@@ -462,11 +462,11 @@ namespace vkcv
}; };
recordCommandsToStream(cmdStream, submitFunction, nullptr); recordCommandsToStream(cmdStream, submitFunction, nullptr);
#endif #endif
} }
void Core::recordEndDebugLabel(const CommandStreamHandle &cmdStream) { void Core::recordEndDebugLabel(const CommandStreamHandle &cmdStream) {
#ifndef NDEBUG #ifdef VULKAN_DEBUG_LABELS
static PFN_vkCmdEndDebugUtilsLabelEXT endDebugLabel = reinterpret_cast<PFN_vkCmdEndDebugUtilsLabelEXT>( static PFN_vkCmdEndDebugUtilsLabelEXT endDebugLabel = reinterpret_cast<PFN_vkCmdEndDebugUtilsLabelEXT>(
m_Context.getDevice().getProcAddr("vkCmdEndDebugUtilsLabelEXT") m_Context.getDevice().getProcAddr("vkCmdEndDebugUtilsLabelEXT")
); );
...@@ -480,7 +480,7 @@ namespace vkcv ...@@ -480,7 +480,7 @@ namespace vkcv
}; };
recordCommandsToStream(cmdStream, submitFunction, nullptr); recordCommandsToStream(cmdStream, submitFunction, nullptr);
#endif #endif
} }
void Core::recordComputeIndirectDispatchToCmdStream( void Core::recordComputeIndirectDispatchToCmdStream(
...@@ -864,7 +864,7 @@ namespace vkcv ...@@ -864,7 +864,7 @@ namespace vkcv
static void setDebugObjectLabel(const vk::Device& device, const vk::ObjectType& type, static void setDebugObjectLabel(const vk::Device& device, const vk::ObjectType& type,
uint64_t handle, const std::string& label) { uint64_t handle, const std::string& label) {
#ifndef NDEBUG #ifndef VULKAN_DEBUG_LABELS
static PFN_vkSetDebugUtilsObjectNameEXT setDebugLabel = reinterpret_cast<PFN_vkSetDebugUtilsObjectNameEXT>( static PFN_vkSetDebugUtilsObjectNameEXT setDebugLabel = reinterpret_cast<PFN_vkSetDebugUtilsObjectNameEXT>(
device.getProcAddr("vkSetDebugUtilsObjectNameEXT") device.getProcAddr("vkSetDebugUtilsObjectNameEXT")
); );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment