Merge pull request #10342 from JosJuice/vulkan-shader-crash

Vulkan: Check for vkSetDebugUtilsObjectNameEXT before using it
This commit is contained in:
JMC47 2022-01-04 10:47:55 -05:00 committed by GitHub
commit 3feea704e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -17,7 +17,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() && vkSetDebugUtilsObjectNameEXT)
{ {
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 +32,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() && vkSetDebugUtilsObjectNameEXT)
{ {
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;

View File

@ -29,7 +29,7 @@ VKTexture::VKTexture(const TextureConfig& tex_config, VkDeviceMemory device_memo
: AbstractTexture(tex_config), m_device_memory(device_memory), m_image(image), m_layout(layout), : AbstractTexture(tex_config), m_device_memory(device_memory), m_image(image), m_layout(layout),
m_compute_layout(compute_layout), m_name(name) m_compute_layout(compute_layout), m_name(name)
{ {
if (!m_name.empty()) if (!m_name.empty() && vkSetDebugUtilsObjectNameEXT)
{ {
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;