VKShader: Only set shader name if supported

This commit is contained in:
OatmealDome 2022-01-30 21:57:52 -05:00
parent 28f3cb3d97
commit 4c7fe45475

View File

@ -10,6 +10,8 @@
#include "VideoBackends/Vulkan/ShaderCompiler.h" #include "VideoBackends/Vulkan/ShaderCompiler.h"
#include "VideoBackends/Vulkan/VulkanContext.h" #include "VideoBackends/Vulkan/VulkanContext.h"
#include "VideoCommon/VideoConfig.h"
namespace Vulkan namespace Vulkan
{ {
VKShader::VKShader(ShaderStage stage, std::vector<u32> spv, VkShaderModule mod, VKShader::VKShader(ShaderStage stage, std::vector<u32> spv, VkShaderModule mod,
@ -17,7 +19,7 @@ VKShader::VKShader(ShaderStage stage, std::vector<u32> spv, VkShaderModule mod,
: AbstractShader(stage), m_spv(std::move(spv)), m_module(mod), : AbstractShader(stage), m_spv(std::move(spv)), m_module(mod),
m_compute_pipeline(VK_NULL_HANDLE), m_name(name) m_compute_pipeline(VK_NULL_HANDLE), m_name(name)
{ {
if (!m_name.empty()) if (!m_name.empty() && g_ActiveConfig.backend_info.bSupportsSettingObjectNames)
{ {
VkDebugUtilsObjectNameInfoEXT name_info = {}; VkDebugUtilsObjectNameInfoEXT name_info = {};
name_info.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT; name_info.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT;
@ -32,7 +34,7 @@ VKShader::VKShader(std::vector<u32> spv, VkPipeline compute_pipeline, std::strin
: AbstractShader(ShaderStage::Compute), m_spv(std::move(spv)), m_module(VK_NULL_HANDLE), : AbstractShader(ShaderStage::Compute), m_spv(std::move(spv)), m_module(VK_NULL_HANDLE),
m_compute_pipeline(compute_pipeline), m_name(name) m_compute_pipeline(compute_pipeline), m_name(name)
{ {
if (!m_name.empty()) if (!m_name.empty() && g_ActiveConfig.backend_info.bSupportsSettingObjectNames)
{ {
VkDebugUtilsObjectNameInfoEXT name_info = {}; VkDebugUtilsObjectNameInfoEXT name_info = {};
name_info.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT; name_info.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT;