Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #10342 from JosJuice/vulkan-shader-crash
Vulkan: Check for vkSetDebugUtilsObjectNameEXT before using it
  • Loading branch information
JMC47 committed Jan 4, 2022
2 parents 500e02d + 2ab6639 commit 3feea70
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Source/Core/VideoBackends/Vulkan/VKShader.cpp
Expand Up @@ -17,7 +17,7 @@ VKShader::VKShader(ShaderStage stage, std::vector<u32> spv, VkShaderModule mod,
: AbstractShader(stage), m_spv(std::move(spv)), m_module(mod),
m_compute_pipeline(VK_NULL_HANDLE), m_name(name)
{
if (!m_name.empty())
if (!m_name.empty() && vkSetDebugUtilsObjectNameEXT)
{
VkDebugUtilsObjectNameInfoEXT name_info = {};
name_info.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT;
Expand All @@ -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),
m_compute_pipeline(compute_pipeline), m_name(name)
{
if (!m_name.empty())
if (!m_name.empty() && vkSetDebugUtilsObjectNameEXT)
{
VkDebugUtilsObjectNameInfoEXT name_info = {};
name_info.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT;
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/VideoBackends/Vulkan/VKTexture.cpp
Expand Up @@ -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),
m_compute_layout(compute_layout), m_name(name)
{
if (!m_name.empty())
if (!m_name.empty() && vkSetDebugUtilsObjectNameEXT)
{
VkDebugUtilsObjectNameInfoEXT name_info = {};
name_info.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT;
Expand Down

0 comments on commit 3feea70

Please sign in to comment.