From e646096180f25cbaf690451c2acec370b6400a22 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Thu, 11 Apr 2024 22:45:33 +1000 Subject: [PATCH] VulkanDevice: Fix validation errors --- src/util/vulkan_device.cpp | 5 +++-- src/util/vulkan_device.h | 1 + src/util/vulkan_pipeline.cpp | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/util/vulkan_device.cpp b/src/util/vulkan_device.cpp index 794641afa..eca673fd2 100644 --- a/src/util/vulkan_device.cpp +++ b/src/util/vulkan_device.cpp @@ -395,6 +395,8 @@ bool VulkanDevice::SelectDeviceExtensions(ExtensionList* extension_list, bool en m_optional_extensions.vk_khr_dynamic_rendering && SupportsExtension(VK_KHR_DYNAMIC_RENDERING_LOCAL_READ_EXTENSION_NAME, false); m_optional_extensions.vk_khr_push_descriptor = SupportsExtension(VK_KHR_PUSH_DESCRIPTOR_EXTENSION_NAME, false); + m_optional_extensions.vk_khr_shader_non_semantic_info = + SupportsExtension(VK_KHR_SHADER_NON_SEMANTIC_INFO_EXTENSION_NAME, false); m_optional_extensions.vk_ext_external_memory_host = SupportsExtension(VK_EXT_EXTERNAL_MEMORY_HOST_EXTENSION_NAME, false); @@ -849,8 +851,7 @@ bool VulkanDevice::CreateCommandBuffers() pool_sizes[num_pools++] = {VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT, MAX_INPUT_ATTACHMENT_DESCRIPTORS_PER_FRAME}; VkDescriptorPoolCreateInfo pool_create_info = { - VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO, nullptr, 0, MAX_DESCRIPTOR_SETS_PER_FRAME, - static_cast(std::size(pool_sizes)), pool_sizes}; + VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO, nullptr, 0, MAX_DESCRIPTOR_SETS_PER_FRAME, num_pools, pool_sizes}; res = vkCreateDescriptorPool(m_device, &pool_create_info, nullptr, &resources.descriptor_pool); if (res != VK_SUCCESS) diff --git a/src/util/vulkan_device.h b/src/util/vulkan_device.h index 0c41b2d4d..0df690cef 100644 --- a/src/util/vulkan_device.h +++ b/src/util/vulkan_device.h @@ -53,6 +53,7 @@ public: bool vk_khr_dynamic_rendering : 1; bool vk_khr_dynamic_rendering_local_read : 1; bool vk_khr_push_descriptor : 1; + bool vk_khr_shader_non_semantic_info : 1; bool vk_ext_external_memory_host : 1; }; diff --git a/src/util/vulkan_pipeline.cpp b/src/util/vulkan_pipeline.cpp index f46d7eed1..13f44c54e 100644 --- a/src/util/vulkan_pipeline.cpp +++ b/src/util/vulkan_pipeline.cpp @@ -66,7 +66,8 @@ std::unique_ptr VulkanDevice::CreateShaderFromSource(GPUShaderStage s if (m_debug_device) { options.SetOptimizationLevel(shaderc_optimization_level_zero); - options.SetGenerateDebugInfo(); + if (m_optional_extensions.vk_khr_shader_non_semantic_info) + options.SetGenerateDebugInfo(); } else {