Toast Engine
Loading...
Searching...
No Matches
vulkan_debug.hpp
Go to the documentation of this file.
1
4
5#pragma once
6#include "vulkan_core.hpp"
7
8#include <string>
9#include <string_view>
10#include <toast/log.hpp>
11
12namespace renderer {
13
14template<typename VkHandle>
15void setDebugName(const VulkanCore& core, const VkHandle& handle, std::string_view name) {
16 if (!core.debugUtilsEnabled() || !handle) {
17 return;
18 }
19
20 try {
21 core.getDevice().setDebugUtilsObjectNameEXT(handle, std::string(name));
22 } catch (const std::exception& e) { TOAST_WARN("Render", "Failed to set debug name '{}': {}", name, e.what()); }
23}
24
25}
Definition vulkan_core.hpp:48
Public logging interface for the engine.
#define TOAST_WARN(sink,...)
Indicates possible code missuse.
Definition log.hpp:94