mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-08-04 08:22:32 +00:00
vk_platform: Always assign names to resources
This commit is contained in:
parent
0675f5a554
commit
ea206be2e2
@ -3,11 +3,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <memory>
|
|
||||||
#include <variant>
|
|
||||||
#include <fmt/format.h>
|
#include <fmt/format.h>
|
||||||
|
|
||||||
#include "common/config.h"
|
|
||||||
#include "common/logging/log.h"
|
#include "common/logging/log.h"
|
||||||
#include "common/types.h"
|
#include "common/types.h"
|
||||||
#include "video_core/renderer_vulkan/vk_common.h"
|
#include "video_core/renderer_vulkan/vk_common.h"
|
||||||
@ -33,9 +30,6 @@ concept VulkanHandleType = vk::isVulkanHandleType<T>::value;
|
|||||||
|
|
||||||
template <VulkanHandleType HandleType>
|
template <VulkanHandleType HandleType>
|
||||||
void SetObjectName(vk::Device device, const HandleType& handle, std::string_view debug_name) {
|
void SetObjectName(vk::Device device, const HandleType& handle, std::string_view debug_name) {
|
||||||
if (!Config::getVkHostMarkersEnabled()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const vk::DebugUtilsObjectNameInfoEXT name_info = {
|
const vk::DebugUtilsObjectNameInfoEXT name_info = {
|
||||||
.objectType = HandleType::objectType,
|
.objectType = HandleType::objectType,
|
||||||
.objectHandle = reinterpret_cast<u64>(static_cast<typename HandleType::NativeType>(handle)),
|
.objectHandle = reinterpret_cast<u64>(static_cast<typename HandleType::NativeType>(handle)),
|
||||||
@ -50,9 +44,6 @@ void SetObjectName(vk::Device device, const HandleType& handle, std::string_view
|
|||||||
template <VulkanHandleType HandleType, typename... Args>
|
template <VulkanHandleType HandleType, typename... Args>
|
||||||
void SetObjectName(vk::Device device, const HandleType& handle, const char* format,
|
void SetObjectName(vk::Device device, const HandleType& handle, const char* format,
|
||||||
const Args&... args) {
|
const Args&... args) {
|
||||||
if (!Config::getVkHostMarkersEnabled()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const std::string debug_name = fmt::vformat(format, fmt::make_format_args(args...));
|
const std::string debug_name = fmt::vformat(format, fmt::make_format_args(args...));
|
||||||
SetObjectName(device, handle, debug_name);
|
SetObjectName(device, handle, debug_name);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user