diff options
Diffstat (limited to '')
18 files changed, 209 insertions, 165 deletions
diff --git a/externals/Vulkan-Headers b/externals/Vulkan-Headers | |||
| Subproject 33d4dd987fc8fc6475ff9ca2b4f0c3cc6e79333 | Subproject 2826791bed6a793f164bf534cd859968f13df8a | ||
diff --git a/src/video_core/renderer_vulkan/maxwell_to_vk.cpp b/src/video_core/renderer_vulkan/maxwell_to_vk.cpp index 430a84272..3e03c5cd6 100644 --- a/src/video_core/renderer_vulkan/maxwell_to_vk.cpp +++ b/src/video_core/renderer_vulkan/maxwell_to_vk.cpp | |||
| @@ -58,7 +58,7 @@ VkSamplerAddressMode WrapMode(const Device& device, Tegra::Texture::WrapMode wra | |||
| 58 | case Tegra::Texture::WrapMode::Border: | 58 | case Tegra::Texture::WrapMode::Border: |
| 59 | return VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER; | 59 | return VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER; |
| 60 | case Tegra::Texture::WrapMode::Clamp: | 60 | case Tegra::Texture::WrapMode::Clamp: |
| 61 | if (device.GetDriverID() == VK_DRIVER_ID_NVIDIA_PROPRIETARY_KHR) { | 61 | if (device.GetDriverID() == VK_DRIVER_ID_NVIDIA_PROPRIETARY) { |
| 62 | // Nvidia's Vulkan driver defaults to GL_CLAMP on invalid enumerations, we can hack this | 62 | // Nvidia's Vulkan driver defaults to GL_CLAMP on invalid enumerations, we can hack this |
| 63 | // by sending an invalid enumeration. | 63 | // by sending an invalid enumeration. |
| 64 | return static_cast<VkSamplerAddressMode>(0xcafe); | 64 | return static_cast<VkSamplerAddressMode>(0xcafe); |
diff --git a/src/video_core/renderer_vulkan/pipeline_helper.h b/src/video_core/renderer_vulkan/pipeline_helper.h index b7843e995..28b893e25 100644 --- a/src/video_core/renderer_vulkan/pipeline_helper.h +++ b/src/video_core/renderer_vulkan/pipeline_helper.h | |||
| @@ -44,17 +44,17 @@ public: | |||
| 44 | }); | 44 | }); |
| 45 | } | 45 | } |
| 46 | 46 | ||
| 47 | vk::DescriptorUpdateTemplateKHR CreateTemplate(VkDescriptorSetLayout descriptor_set_layout, | 47 | vk::DescriptorUpdateTemplate CreateTemplate(VkDescriptorSetLayout descriptor_set_layout, |
| 48 | VkPipelineLayout pipeline_layout, | 48 | VkPipelineLayout pipeline_layout, |
| 49 | bool use_push_descriptor) const { | 49 | bool use_push_descriptor) const { |
| 50 | if (entries.empty()) { | 50 | if (entries.empty()) { |
| 51 | return nullptr; | 51 | return nullptr; |
| 52 | } | 52 | } |
| 53 | const VkDescriptorUpdateTemplateType type = | 53 | const VkDescriptorUpdateTemplateType type = |
| 54 | use_push_descriptor ? VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR | 54 | use_push_descriptor ? VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR |
| 55 | : VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET_KHR; | 55 | : VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET; |
| 56 | return device->GetLogical().CreateDescriptorUpdateTemplateKHR({ | 56 | return device->GetLogical().CreateDescriptorUpdateTemplate({ |
| 57 | .sType = VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO_KHR, | 57 | .sType = VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO, |
| 58 | .pNext = nullptr, | 58 | .pNext = nullptr, |
| 59 | .flags = 0, | 59 | .flags = 0, |
| 60 | .descriptorUpdateEntryCount = static_cast<u32>(entries.size()), | 60 | .descriptorUpdateEntryCount = static_cast<u32>(entries.size()), |
| @@ -129,7 +129,7 @@ private: | |||
| 129 | const Device* device{}; | 129 | const Device* device{}; |
| 130 | bool is_compute{}; | 130 | bool is_compute{}; |
| 131 | boost::container::small_vector<VkDescriptorSetLayoutBinding, 32> bindings; | 131 | boost::container::small_vector<VkDescriptorSetLayoutBinding, 32> bindings; |
| 132 | boost::container::small_vector<VkDescriptorUpdateTemplateEntryKHR, 32> entries; | 132 | boost::container::small_vector<VkDescriptorUpdateTemplateEntry, 32> entries; |
| 133 | u32 binding{}; | 133 | u32 binding{}; |
| 134 | u32 num_descriptors{}; | 134 | u32 num_descriptors{}; |
| 135 | size_t offset{}; | 135 | size_t offset{}; |
diff --git a/src/video_core/renderer_vulkan/renderer_vulkan.cpp b/src/video_core/renderer_vulkan/renderer_vulkan.cpp index c2a95200b..18be54729 100644 --- a/src/video_core/renderer_vulkan/renderer_vulkan.cpp +++ b/src/video_core/renderer_vulkan/renderer_vulkan.cpp | |||
| @@ -45,14 +45,14 @@ std::string GetDriverVersion(const Device& device) { | |||
| 45 | // https://github.com/SaschaWillems/vulkan.gpuinfo.org/blob/5dddea46ea1120b0df14eef8f15ff8e318e35462/functions.php#L308-L314 | 45 | // https://github.com/SaschaWillems/vulkan.gpuinfo.org/blob/5dddea46ea1120b0df14eef8f15ff8e318e35462/functions.php#L308-L314 |
| 46 | const u32 version = device.GetDriverVersion(); | 46 | const u32 version = device.GetDriverVersion(); |
| 47 | 47 | ||
| 48 | if (device.GetDriverID() == VK_DRIVER_ID_NVIDIA_PROPRIETARY_KHR) { | 48 | if (device.GetDriverID() == VK_DRIVER_ID_NVIDIA_PROPRIETARY) { |
| 49 | const u32 major = (version >> 22) & 0x3ff; | 49 | const u32 major = (version >> 22) & 0x3ff; |
| 50 | const u32 minor = (version >> 14) & 0x0ff; | 50 | const u32 minor = (version >> 14) & 0x0ff; |
| 51 | const u32 secondary = (version >> 6) & 0x0ff; | 51 | const u32 secondary = (version >> 6) & 0x0ff; |
| 52 | const u32 tertiary = version & 0x003f; | 52 | const u32 tertiary = version & 0x003f; |
| 53 | return fmt::format("{}.{}.{}.{}", major, minor, secondary, tertiary); | 53 | return fmt::format("{}.{}.{}.{}", major, minor, secondary, tertiary); |
| 54 | } | 54 | } |
| 55 | if (device.GetDriverID() == VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS_KHR) { | 55 | if (device.GetDriverID() == VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS) { |
| 56 | const u32 major = version >> 14; | 56 | const u32 major = version >> 14; |
| 57 | const u32 minor = version & 0x3fff; | 57 | const u32 minor = version & 0x3fff; |
| 58 | return fmt::format("{}.{}", major, minor); | 58 | return fmt::format("{}.{}", major, minor); |
diff --git a/src/video_core/renderer_vulkan/vk_compute_pass.cpp b/src/video_core/renderer_vulkan/vk_compute_pass.cpp index 241d7573e..2c00979d7 100644 --- a/src/video_core/renderer_vulkan/vk_compute_pass.cpp +++ b/src/video_core/renderer_vulkan/vk_compute_pass.cpp | |||
| @@ -93,7 +93,7 @@ constexpr DescriptorBankInfo ASTC_BANK_INFO{ | |||
| 93 | .score = 2, | 93 | .score = 2, |
| 94 | }; | 94 | }; |
| 95 | 95 | ||
| 96 | constexpr VkDescriptorUpdateTemplateEntryKHR INPUT_OUTPUT_DESCRIPTOR_UPDATE_TEMPLATE{ | 96 | constexpr VkDescriptorUpdateTemplateEntry INPUT_OUTPUT_DESCRIPTOR_UPDATE_TEMPLATE{ |
| 97 | .dstBinding = 0, | 97 | .dstBinding = 0, |
| 98 | .dstArrayElement = 0, | 98 | .dstArrayElement = 0, |
| 99 | .descriptorCount = 2, | 99 | .descriptorCount = 2, |
| @@ -102,7 +102,7 @@ constexpr VkDescriptorUpdateTemplateEntryKHR INPUT_OUTPUT_DESCRIPTOR_UPDATE_TEMP | |||
| 102 | .stride = sizeof(DescriptorUpdateEntry), | 102 | .stride = sizeof(DescriptorUpdateEntry), |
| 103 | }; | 103 | }; |
| 104 | 104 | ||
| 105 | constexpr std::array<VkDescriptorUpdateTemplateEntryKHR, ASTC_NUM_BINDINGS> | 105 | constexpr std::array<VkDescriptorUpdateTemplateEntry, ASTC_NUM_BINDINGS> |
| 106 | ASTC_PASS_DESCRIPTOR_UPDATE_TEMPLATE_ENTRY{{ | 106 | ASTC_PASS_DESCRIPTOR_UPDATE_TEMPLATE_ENTRY{{ |
| 107 | { | 107 | { |
| 108 | .dstBinding = ASTC_BINDING_INPUT_BUFFER, | 108 | .dstBinding = ASTC_BINDING_INPUT_BUFFER, |
| @@ -134,7 +134,7 @@ struct AstcPushConstants { | |||
| 134 | 134 | ||
| 135 | ComputePass::ComputePass(const Device& device_, DescriptorPool& descriptor_pool, | 135 | ComputePass::ComputePass(const Device& device_, DescriptorPool& descriptor_pool, |
| 136 | vk::Span<VkDescriptorSetLayoutBinding> bindings, | 136 | vk::Span<VkDescriptorSetLayoutBinding> bindings, |
| 137 | vk::Span<VkDescriptorUpdateTemplateEntryKHR> templates, | 137 | vk::Span<VkDescriptorUpdateTemplateEntry> templates, |
| 138 | const DescriptorBankInfo& bank_info, | 138 | const DescriptorBankInfo& bank_info, |
| 139 | vk::Span<VkPushConstantRange> push_constants, std::span<const u32> code) | 139 | vk::Span<VkPushConstantRange> push_constants, std::span<const u32> code) |
| 140 | : device{device_} { | 140 | : device{device_} { |
| @@ -155,13 +155,13 @@ ComputePass::ComputePass(const Device& device_, DescriptorPool& descriptor_pool, | |||
| 155 | .pPushConstantRanges = push_constants.data(), | 155 | .pPushConstantRanges = push_constants.data(), |
| 156 | }); | 156 | }); |
| 157 | if (!templates.empty()) { | 157 | if (!templates.empty()) { |
| 158 | descriptor_template = device.GetLogical().CreateDescriptorUpdateTemplateKHR({ | 158 | descriptor_template = device.GetLogical().CreateDescriptorUpdateTemplate({ |
| 159 | .sType = VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO_KHR, | 159 | .sType = VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO, |
| 160 | .pNext = nullptr, | 160 | .pNext = nullptr, |
| 161 | .flags = 0, | 161 | .flags = 0, |
| 162 | .descriptorUpdateEntryCount = templates.size(), | 162 | .descriptorUpdateEntryCount = templates.size(), |
| 163 | .pDescriptorUpdateEntries = templates.data(), | 163 | .pDescriptorUpdateEntries = templates.data(), |
| 164 | .templateType = VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET_KHR, | 164 | .templateType = VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET, |
| 165 | .descriptorSetLayout = *descriptor_set_layout, | 165 | .descriptorSetLayout = *descriptor_set_layout, |
| 166 | .pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS, | 166 | .pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS, |
| 167 | .pipelineLayout = *layout, | 167 | .pipelineLayout = *layout, |
diff --git a/src/video_core/renderer_vulkan/vk_compute_pass.h b/src/video_core/renderer_vulkan/vk_compute_pass.h index dcc691a8e..5d32e3caf 100644 --- a/src/video_core/renderer_vulkan/vk_compute_pass.h +++ b/src/video_core/renderer_vulkan/vk_compute_pass.h | |||
| @@ -29,14 +29,14 @@ class ComputePass { | |||
| 29 | public: | 29 | public: |
| 30 | explicit ComputePass(const Device& device, DescriptorPool& descriptor_pool, | 30 | explicit ComputePass(const Device& device, DescriptorPool& descriptor_pool, |
| 31 | vk::Span<VkDescriptorSetLayoutBinding> bindings, | 31 | vk::Span<VkDescriptorSetLayoutBinding> bindings, |
| 32 | vk::Span<VkDescriptorUpdateTemplateEntryKHR> templates, | 32 | vk::Span<VkDescriptorUpdateTemplateEntry> templates, |
| 33 | const DescriptorBankInfo& bank_info, | 33 | const DescriptorBankInfo& bank_info, |
| 34 | vk::Span<VkPushConstantRange> push_constants, std::span<const u32> code); | 34 | vk::Span<VkPushConstantRange> push_constants, std::span<const u32> code); |
| 35 | ~ComputePass(); | 35 | ~ComputePass(); |
| 36 | 36 | ||
| 37 | protected: | 37 | protected: |
| 38 | const Device& device; | 38 | const Device& device; |
| 39 | vk::DescriptorUpdateTemplateKHR descriptor_template; | 39 | vk::DescriptorUpdateTemplate descriptor_template; |
| 40 | vk::PipelineLayout layout; | 40 | vk::PipelineLayout layout; |
| 41 | vk::Pipeline pipeline; | 41 | vk::Pipeline pipeline; |
| 42 | vk::DescriptorSetLayout descriptor_set_layout; | 42 | vk::DescriptorSetLayout descriptor_set_layout; |
diff --git a/src/video_core/renderer_vulkan/vk_compute_pipeline.cpp b/src/video_core/renderer_vulkan/vk_compute_pipeline.cpp index 7906e11a8..04a3a861e 100644 --- a/src/video_core/renderer_vulkan/vk_compute_pipeline.cpp +++ b/src/video_core/renderer_vulkan/vk_compute_pipeline.cpp | |||
| @@ -53,7 +53,7 @@ ComputePipeline::ComputePipeline(const Device& device_, DescriptorPool& descript | |||
| 53 | .requiredSubgroupSize = GuestWarpSize, | 53 | .requiredSubgroupSize = GuestWarpSize, |
| 54 | }; | 54 | }; |
| 55 | VkPipelineCreateFlags flags{}; | 55 | VkPipelineCreateFlags flags{}; |
| 56 | if (device.IsKhrPipelineEexecutablePropertiesEnabled()) { | 56 | if (device.IsKhrPipelineExecutablePropertiesEnabled()) { |
| 57 | flags |= VK_PIPELINE_CREATE_CAPTURE_STATISTICS_BIT_KHR; | 57 | flags |= VK_PIPELINE_CREATE_CAPTURE_STATISTICS_BIT_KHR; |
| 58 | } | 58 | } |
| 59 | pipeline = device.GetLogical().CreateComputePipeline({ | 59 | pipeline = device.GetLogical().CreateComputePipeline({ |
diff --git a/src/video_core/renderer_vulkan/vk_compute_pipeline.h b/src/video_core/renderer_vulkan/vk_compute_pipeline.h index 9879735fe..d70837fc5 100644 --- a/src/video_core/renderer_vulkan/vk_compute_pipeline.h +++ b/src/video_core/renderer_vulkan/vk_compute_pipeline.h | |||
| @@ -55,7 +55,7 @@ private: | |||
| 55 | vk::DescriptorSetLayout descriptor_set_layout; | 55 | vk::DescriptorSetLayout descriptor_set_layout; |
| 56 | DescriptorAllocator descriptor_allocator; | 56 | DescriptorAllocator descriptor_allocator; |
| 57 | vk::PipelineLayout pipeline_layout; | 57 | vk::PipelineLayout pipeline_layout; |
| 58 | vk::DescriptorUpdateTemplateKHR descriptor_update_template; | 58 | vk::DescriptorUpdateTemplate descriptor_update_template; |
| 59 | vk::Pipeline pipeline; | 59 | vk::Pipeline pipeline; |
| 60 | 60 | ||
| 61 | std::condition_variable build_condvar; | 61 | std::condition_variable build_condvar; |
diff --git a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp index ef75c126c..e77a57a4a 100644 --- a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp +++ b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp | |||
| @@ -830,7 +830,7 @@ void GraphicsPipeline::MakePipeline(VkRenderPass render_pass) { | |||
| 830 | */ | 830 | */ |
| 831 | } | 831 | } |
| 832 | VkPipelineCreateFlags flags{}; | 832 | VkPipelineCreateFlags flags{}; |
| 833 | if (device.IsKhrPipelineEexecutablePropertiesEnabled()) { | 833 | if (device.IsKhrPipelineExecutablePropertiesEnabled()) { |
| 834 | flags |= VK_PIPELINE_CREATE_CAPTURE_STATISTICS_BIT_KHR; | 834 | flags |= VK_PIPELINE_CREATE_CAPTURE_STATISTICS_BIT_KHR; |
| 835 | } | 835 | } |
| 836 | pipeline = device.GetLogical().CreateGraphicsPipeline({ | 836 | pipeline = device.GetLogical().CreateGraphicsPipeline({ |
diff --git a/src/video_core/renderer_vulkan/vk_graphics_pipeline.h b/src/video_core/renderer_vulkan/vk_graphics_pipeline.h index 6bf577d25..1ed2967be 100644 --- a/src/video_core/renderer_vulkan/vk_graphics_pipeline.h +++ b/src/video_core/renderer_vulkan/vk_graphics_pipeline.h | |||
| @@ -151,7 +151,7 @@ private: | |||
| 151 | vk::DescriptorSetLayout descriptor_set_layout; | 151 | vk::DescriptorSetLayout descriptor_set_layout; |
| 152 | DescriptorAllocator descriptor_allocator; | 152 | DescriptorAllocator descriptor_allocator; |
| 153 | vk::PipelineLayout pipeline_layout; | 153 | vk::PipelineLayout pipeline_layout; |
| 154 | vk::DescriptorUpdateTemplateKHR descriptor_update_template; | 154 | vk::DescriptorUpdateTemplate descriptor_update_template; |
| 155 | vk::Pipeline pipeline; | 155 | vk::Pipeline pipeline; |
| 156 | 156 | ||
| 157 | std::condition_variable build_condvar; | 157 | std::condition_variable build_condvar; |
diff --git a/src/video_core/renderer_vulkan/vk_master_semaphore.cpp b/src/video_core/renderer_vulkan/vk_master_semaphore.cpp index 4e81d3d28..8aa07ef9d 100644 --- a/src/video_core/renderer_vulkan/vk_master_semaphore.cpp +++ b/src/video_core/renderer_vulkan/vk_master_semaphore.cpp | |||
| @@ -11,10 +11,10 @@ | |||
| 11 | namespace Vulkan { | 11 | namespace Vulkan { |
| 12 | 12 | ||
| 13 | MasterSemaphore::MasterSemaphore(const Device& device) { | 13 | MasterSemaphore::MasterSemaphore(const Device& device) { |
| 14 | static constexpr VkSemaphoreTypeCreateInfoKHR semaphore_type_ci{ | 14 | static constexpr VkSemaphoreTypeCreateInfo semaphore_type_ci{ |
| 15 | .sType = VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO_KHR, | 15 | .sType = VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO, |
| 16 | .pNext = nullptr, | 16 | .pNext = nullptr, |
| 17 | .semaphoreType = VK_SEMAPHORE_TYPE_TIMELINE_KHR, | 17 | .semaphoreType = VK_SEMAPHORE_TYPE_TIMELINE, |
| 18 | .initialValue = 0, | 18 | .initialValue = 0, |
| 19 | }; | 19 | }; |
| 20 | static constexpr VkSemaphoreCreateInfo semaphore_ci{ | 20 | static constexpr VkSemaphoreCreateInfo semaphore_ci{ |
| @@ -28,7 +28,7 @@ MasterSemaphore::MasterSemaphore(const Device& device) { | |||
| 28 | return; | 28 | return; |
| 29 | } | 29 | } |
| 30 | // Validation layers have a bug where they fail to track resource usage when using timeline | 30 | // Validation layers have a bug where they fail to track resource usage when using timeline |
| 31 | // semaphores and synchronizing with GetSemaphoreCounterValueKHR. To workaround this issue, have | 31 | // semaphores and synchronizing with GetSemaphoreCounterValue. To workaround this issue, have |
| 32 | // a separate thread waiting for each timeline semaphore value. | 32 | // a separate thread waiting for each timeline semaphore value. |
| 33 | debug_thread = std::jthread([this](std::stop_token stop_token) { | 33 | debug_thread = std::jthread([this](std::stop_token stop_token) { |
| 34 | u64 counter = 0; | 34 | u64 counter = 0; |
diff --git a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp index 29da442fa..38a6b7488 100644 --- a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp | |||
| @@ -287,7 +287,7 @@ PipelineCache::PipelineCache(RasterizerVulkan& rasterizer_, const Device& device | |||
| 287 | workers(std::max(std::thread::hardware_concurrency(), 2U) - 1, "VkPipelineBuilder"), | 287 | workers(std::max(std::thread::hardware_concurrency(), 2U) - 1, "VkPipelineBuilder"), |
| 288 | serialization_thread(1, "VkPipelineSerialization") { | 288 | serialization_thread(1, "VkPipelineSerialization") { |
| 289 | const auto& float_control{device.FloatControlProperties()}; | 289 | const auto& float_control{device.FloatControlProperties()}; |
| 290 | const VkDriverIdKHR driver_id{device.GetDriverID()}; | 290 | const VkDriverId driver_id{device.GetDriverID()}; |
| 291 | profile = Shader::Profile{ | 291 | profile = Shader::Profile{ |
| 292 | .supported_spirv = device.SupportedSpirvVersion(), | 292 | .supported_spirv = device.SupportedSpirvVersion(), |
| 293 | .unified_descriptor_binding = true, | 293 | .unified_descriptor_binding = true, |
| @@ -297,10 +297,10 @@ PipelineCache::PipelineCache(RasterizerVulkan& rasterizer_, const Device& device | |||
| 297 | .support_int64 = device.IsShaderInt64Supported(), | 297 | .support_int64 = device.IsShaderInt64Supported(), |
| 298 | .support_vertex_instance_id = false, | 298 | .support_vertex_instance_id = false, |
| 299 | .support_float_controls = true, | 299 | .support_float_controls = true, |
| 300 | .support_separate_denorm_behavior = float_control.denormBehaviorIndependence == | 300 | .support_separate_denorm_behavior = |
| 301 | VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_ALL_KHR, | 301 | float_control.denormBehaviorIndependence == VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_ALL, |
| 302 | .support_separate_rounding_mode = | 302 | .support_separate_rounding_mode = |
| 303 | float_control.roundingModeIndependence == VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_ALL_KHR, | 303 | float_control.roundingModeIndependence == VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_ALL, |
| 304 | .support_fp16_denorm_preserve = float_control.shaderDenormPreserveFloat16 != VK_FALSE, | 304 | .support_fp16_denorm_preserve = float_control.shaderDenormPreserveFloat16 != VK_FALSE, |
| 305 | .support_fp32_denorm_preserve = float_control.shaderDenormPreserveFloat32 != VK_FALSE, | 305 | .support_fp32_denorm_preserve = float_control.shaderDenormPreserveFloat32 != VK_FALSE, |
| 306 | .support_fp16_denorm_flush = float_control.shaderDenormFlushToZeroFloat16 != VK_FALSE, | 306 | .support_fp16_denorm_flush = float_control.shaderDenormFlushToZeroFloat16 != VK_FALSE, |
| @@ -327,17 +327,17 @@ PipelineCache::PipelineCache(RasterizerVulkan& rasterizer_, const Device& device | |||
| 327 | .lower_left_origin_mode = false, | 327 | .lower_left_origin_mode = false, |
| 328 | .need_declared_frag_colors = false, | 328 | .need_declared_frag_colors = false, |
| 329 | 329 | ||
| 330 | .has_broken_spirv_clamp = driver_id == VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS_KHR, | 330 | .has_broken_spirv_clamp = driver_id == VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS, |
| 331 | .has_broken_unsigned_image_offsets = false, | 331 | .has_broken_unsigned_image_offsets = false, |
| 332 | .has_broken_signed_operations = false, | 332 | .has_broken_signed_operations = false, |
| 333 | .has_broken_fp16_float_controls = driver_id == VK_DRIVER_ID_NVIDIA_PROPRIETARY_KHR, | 333 | .has_broken_fp16_float_controls = driver_id == VK_DRIVER_ID_NVIDIA_PROPRIETARY, |
| 334 | .ignore_nan_fp_comparisons = false, | 334 | .ignore_nan_fp_comparisons = false, |
| 335 | }; | 335 | }; |
| 336 | host_info = Shader::HostTranslateInfo{ | 336 | host_info = Shader::HostTranslateInfo{ |
| 337 | .support_float16 = device.IsFloat16Supported(), | 337 | .support_float16 = device.IsFloat16Supported(), |
| 338 | .support_int64 = device.IsShaderInt64Supported(), | 338 | .support_int64 = device.IsShaderInt64Supported(), |
| 339 | .needs_demote_reorder = driver_id == VK_DRIVER_ID_AMD_PROPRIETARY_KHR || | 339 | .needs_demote_reorder = |
| 340 | driver_id == VK_DRIVER_ID_AMD_OPEN_SOURCE_KHR, | 340 | driver_id == VK_DRIVER_ID_AMD_PROPRIETARY || driver_id == VK_DRIVER_ID_AMD_OPEN_SOURCE, |
| 341 | .support_snorm_render_buffer = true, | 341 | .support_snorm_render_buffer = true, |
| 342 | .support_viewport_index_layer = device.IsExtShaderViewportIndexLayerSupported(), | 342 | .support_viewport_index_layer = device.IsExtShaderViewportIndexLayerSupported(), |
| 343 | }; | 343 | }; |
| @@ -408,7 +408,7 @@ void PipelineCache::LoadDiskResources(u64 title_id, std::stop_token stop_loading | |||
| 408 | std::unique_ptr<PipelineStatistics> statistics; | 408 | std::unique_ptr<PipelineStatistics> statistics; |
| 409 | } state; | 409 | } state; |
| 410 | 410 | ||
| 411 | if (device.IsKhrPipelineEexecutablePropertiesEnabled()) { | 411 | if (device.IsKhrPipelineExecutablePropertiesEnabled()) { |
| 412 | state.statistics = std::make_unique<PipelineStatistics>(device); | 412 | state.statistics = std::make_unique<PipelineStatistics>(device); |
| 413 | } | 413 | } |
| 414 | const auto load_compute{[&](std::ifstream& file, FileEnvironment env) { | 414 | const auto load_compute{[&](std::ifstream& file, FileEnvironment env) { |
diff --git a/src/video_core/renderer_vulkan/vk_query_cache.cpp b/src/video_core/renderer_vulkan/vk_query_cache.cpp index 4b15c0f85..929c8ece6 100644 --- a/src/video_core/renderer_vulkan/vk_query_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_query_cache.cpp | |||
| @@ -98,7 +98,7 @@ HostCounter::HostCounter(QueryCache& cache_, std::shared_ptr<HostCounter> depend | |||
| 98 | query{cache_.AllocateQuery(type_)}, tick{cache_.GetScheduler().CurrentTick()} { | 98 | query{cache_.AllocateQuery(type_)}, tick{cache_.GetScheduler().CurrentTick()} { |
| 99 | const vk::Device* logical = &cache.GetDevice().GetLogical(); | 99 | const vk::Device* logical = &cache.GetDevice().GetLogical(); |
| 100 | cache.GetScheduler().Record([logical, query = query](vk::CommandBuffer cmdbuf) { | 100 | cache.GetScheduler().Record([logical, query = query](vk::CommandBuffer cmdbuf) { |
| 101 | logical->ResetQueryPoolEXT(query.first, query.second, 1); | 101 | logical->ResetQueryPool(query.first, query.second, 1); |
| 102 | cmdbuf.BeginQuery(query.first, query.second, VK_QUERY_CONTROL_PRECISE_BIT); | 102 | cmdbuf.BeginQuery(query.first, query.second, VK_QUERY_CONTROL_PRECISE_BIT); |
| 103 | }); | 103 | }); |
| 104 | } | 104 | } |
diff --git a/src/video_core/renderer_vulkan/vk_scheduler.cpp b/src/video_core/renderer_vulkan/vk_scheduler.cpp index c09fb3e98..c2e53a5d5 100644 --- a/src/video_core/renderer_vulkan/vk_scheduler.cpp +++ b/src/video_core/renderer_vulkan/vk_scheduler.cpp | |||
| @@ -194,8 +194,8 @@ void Scheduler::SubmitExecution(VkSemaphore signal_semaphore, VkSemaphore wait_s | |||
| 194 | VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, | 194 | VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, |
| 195 | }; | 195 | }; |
| 196 | 196 | ||
| 197 | const VkTimelineSemaphoreSubmitInfoKHR timeline_si{ | 197 | const VkTimelineSemaphoreSubmitInfo timeline_si{ |
| 198 | .sType = VK_STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO_KHR, | 198 | .sType = VK_STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO, |
| 199 | .pNext = nullptr, | 199 | .pNext = nullptr, |
| 200 | .waitSemaphoreValueCount = num_wait_semaphores, | 200 | .waitSemaphoreValueCount = num_wait_semaphores, |
| 201 | .pWaitSemaphoreValues = wait_values.data(), | 201 | .pWaitSemaphoreValues = wait_values.data(), |
diff --git a/src/video_core/vulkan_common/vulkan_device.cpp b/src/video_core/vulkan_common/vulkan_device.cpp index 652329c38..33856fe59 100644 --- a/src/video_core/vulkan_common/vulkan_device.cpp +++ b/src/video_core/vulkan_common/vulkan_device.cpp | |||
| @@ -77,12 +77,6 @@ enum class NvidiaArchitecture { | |||
| 77 | constexpr std::array REQUIRED_EXTENSIONS{ | 77 | constexpr std::array REQUIRED_EXTENSIONS{ |
| 78 | VK_EXT_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME, | 78 | VK_EXT_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME, |
| 79 | VK_EXT_ROBUSTNESS_2_EXTENSION_NAME, | 79 | VK_EXT_ROBUSTNESS_2_EXTENSION_NAME, |
| 80 | |||
| 81 | // Core in 1.2, but required due to use of extension methods, | ||
| 82 | // and well-supported by drivers | ||
| 83 | VK_KHR_TIMELINE_SEMAPHORE_EXTENSION_NAME, | ||
| 84 | VK_KHR_DESCRIPTOR_UPDATE_TEMPLATE_EXTENSION_NAME, | ||
| 85 | VK_EXT_HOST_QUERY_RESET_EXTENSION_NAME, | ||
| 86 | #ifdef _WIN32 | 80 | #ifdef _WIN32 |
| 87 | VK_KHR_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME, | 81 | VK_KHR_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME, |
| 88 | #endif | 82 | #endif |
| @@ -311,10 +305,10 @@ NvidiaArchitecture GetNvidiaArchitecture(vk::PhysicalDevice physical, | |||
| 311 | VkPhysicalDeviceFragmentShadingRatePropertiesKHR shading_rate_props{}; | 305 | VkPhysicalDeviceFragmentShadingRatePropertiesKHR shading_rate_props{}; |
| 312 | shading_rate_props.sType = | 306 | shading_rate_props.sType = |
| 313 | VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_PROPERTIES_KHR; | 307 | VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_PROPERTIES_KHR; |
| 314 | VkPhysicalDeviceProperties2KHR physical_properties{}; | 308 | VkPhysicalDeviceProperties2 physical_properties{}; |
| 315 | physical_properties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR; | 309 | physical_properties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2; |
| 316 | physical_properties.pNext = &shading_rate_props; | 310 | physical_properties.pNext = &shading_rate_props; |
| 317 | physical.GetProperties2KHR(physical_properties); | 311 | physical.GetProperties2(physical_properties); |
| 318 | if (shading_rate_props.primitiveFragmentShadingRateWithMultipleViewports) { | 312 | if (shading_rate_props.primitiveFragmentShadingRateWithMultipleViewports) { |
| 319 | // Only Ampere and newer support this feature | 313 | // Only Ampere and newer support this feature |
| 320 | return NvidiaArchitecture::AmpereOrNewer; | 314 | return NvidiaArchitecture::AmpereOrNewer; |
| @@ -405,15 +399,15 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR | |||
| 405 | const void* first_next = &features2; | 399 | const void* first_next = &features2; |
| 406 | void** next = &features2.pNext; | 400 | void** next = &features2.pNext; |
| 407 | 401 | ||
| 408 | VkPhysicalDeviceTimelineSemaphoreFeaturesKHR timeline_semaphore{ | 402 | VkPhysicalDeviceTimelineSemaphoreFeatures timeline_semaphore{ |
| 409 | .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES_KHR, | 403 | .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES, |
| 410 | .pNext = nullptr, | 404 | .pNext = nullptr, |
| 411 | .timelineSemaphore = true, | 405 | .timelineSemaphore = true, |
| 412 | }; | 406 | }; |
| 413 | SetNext(next, timeline_semaphore); | 407 | SetNext(next, timeline_semaphore); |
| 414 | 408 | ||
| 415 | VkPhysicalDevice16BitStorageFeaturesKHR bit16_storage{ | 409 | VkPhysicalDevice16BitStorageFeatures bit16_storage{ |
| 416 | .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES_KHR, | 410 | .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES, |
| 417 | .pNext = nullptr, | 411 | .pNext = nullptr, |
| 418 | .storageBuffer16BitAccess = true, | 412 | .storageBuffer16BitAccess = true, |
| 419 | .uniformAndStorageBuffer16BitAccess = true, | 413 | .uniformAndStorageBuffer16BitAccess = true, |
| @@ -422,8 +416,8 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR | |||
| 422 | }; | 416 | }; |
| 423 | SetNext(next, bit16_storage); | 417 | SetNext(next, bit16_storage); |
| 424 | 418 | ||
| 425 | VkPhysicalDevice8BitStorageFeaturesKHR bit8_storage{ | 419 | VkPhysicalDevice8BitStorageFeatures bit8_storage{ |
| 426 | .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES_KHR, | 420 | .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES, |
| 427 | .pNext = nullptr, | 421 | .pNext = nullptr, |
| 428 | .storageBuffer8BitAccess = false, | 422 | .storageBuffer8BitAccess = false, |
| 429 | .uniformAndStorageBuffer8BitAccess = true, | 423 | .uniformAndStorageBuffer8BitAccess = true, |
| @@ -440,15 +434,15 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR | |||
| 440 | }; | 434 | }; |
| 441 | SetNext(next, robustness2); | 435 | SetNext(next, robustness2); |
| 442 | 436 | ||
| 443 | VkPhysicalDeviceHostQueryResetFeaturesEXT host_query_reset{ | 437 | VkPhysicalDeviceHostQueryResetFeatures host_query_reset{ |
| 444 | .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES_EXT, | 438 | .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES, |
| 445 | .pNext = nullptr, | 439 | .pNext = nullptr, |
| 446 | .hostQueryReset = true, | 440 | .hostQueryReset = true, |
| 447 | }; | 441 | }; |
| 448 | SetNext(next, host_query_reset); | 442 | SetNext(next, host_query_reset); |
| 449 | 443 | ||
| 450 | VkPhysicalDeviceVariablePointerFeaturesKHR variable_pointers{ | 444 | VkPhysicalDeviceVariablePointerFeatures variable_pointers{ |
| 451 | .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES_KHR, | 445 | .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES, |
| 452 | .pNext = nullptr, | 446 | .pNext = nullptr, |
| 453 | .variablePointersStorageBuffer = VK_TRUE, | 447 | .variablePointersStorageBuffer = VK_TRUE, |
| 454 | .variablePointers = VK_TRUE, | 448 | .variablePointers = VK_TRUE, |
| @@ -462,10 +456,17 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR | |||
| 462 | }; | 456 | }; |
| 463 | SetNext(next, demote); | 457 | SetNext(next, demote); |
| 464 | 458 | ||
| 465 | VkPhysicalDeviceFloat16Int8FeaturesKHR float16_int8; | 459 | VkPhysicalDeviceShaderDrawParametersFeatures draw_parameters{ |
| 460 | .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETER_FEATURES, | ||
| 461 | .pNext = nullptr, | ||
| 462 | .shaderDrawParameters = true, | ||
| 463 | }; | ||
| 464 | SetNext(next, draw_parameters); | ||
| 465 | |||
| 466 | VkPhysicalDeviceShaderFloat16Int8Features float16_int8; | ||
| 466 | if (is_int8_supported || is_float16_supported) { | 467 | if (is_int8_supported || is_float16_supported) { |
| 467 | float16_int8 = { | 468 | float16_int8 = { |
| 468 | .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT16_INT8_FEATURES_KHR, | 469 | .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES, |
| 469 | .pNext = nullptr, | 470 | .pNext = nullptr, |
| 470 | .shaderFloat16 = is_float16_supported, | 471 | .shaderFloat16 = is_float16_supported, |
| 471 | .shaderInt8 = is_int8_supported, | 472 | .shaderInt8 = is_int8_supported, |
| @@ -491,10 +492,10 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR | |||
| 491 | LOG_INFO(Render_Vulkan, "Device doesn't support passthrough geometry shaders"); | 492 | LOG_INFO(Render_Vulkan, "Device doesn't support passthrough geometry shaders"); |
| 492 | } | 493 | } |
| 493 | 494 | ||
| 494 | VkPhysicalDeviceUniformBufferStandardLayoutFeaturesKHR std430_layout; | 495 | VkPhysicalDeviceUniformBufferStandardLayoutFeatures std430_layout; |
| 495 | if (khr_uniform_buffer_standard_layout) { | 496 | if (khr_uniform_buffer_standard_layout) { |
| 496 | std430_layout = { | 497 | std430_layout = { |
| 497 | .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES_KHR, | 498 | .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES, |
| 498 | .pNext = nullptr, | 499 | .pNext = nullptr, |
| 499 | .uniformBufferStandardLayout = true, | 500 | .uniformBufferStandardLayout = true, |
| 500 | }; | 501 | }; |
| @@ -612,10 +613,10 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR | |||
| 612 | LOG_INFO(Render_Vulkan, "Device doesn't support vertex input dynamic state"); | 613 | LOG_INFO(Render_Vulkan, "Device doesn't support vertex input dynamic state"); |
| 613 | } | 614 | } |
| 614 | 615 | ||
| 615 | VkPhysicalDeviceShaderAtomicInt64FeaturesKHR atomic_int64; | 616 | VkPhysicalDeviceShaderAtomicInt64Features atomic_int64; |
| 616 | if (ext_shader_atomic_int64) { | 617 | if (ext_shader_atomic_int64) { |
| 617 | atomic_int64 = { | 618 | atomic_int64 = { |
| 618 | .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES_KHR, | 619 | .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES, |
| 619 | .pNext = nullptr, | 620 | .pNext = nullptr, |
| 620 | .shaderBufferInt64Atomics = VK_TRUE, | 621 | .shaderBufferInt64Atomics = VK_TRUE, |
| 621 | .shaderSharedInt64Atomics = VK_TRUE, | 622 | .shaderSharedInt64Atomics = VK_TRUE, |
| @@ -971,22 +972,42 @@ void Device::CheckSuitability(bool requires_swapchain) const { | |||
| 971 | demote.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES; | 972 | demote.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES; |
| 972 | demote.pNext = nullptr; | 973 | demote.pNext = nullptr; |
| 973 | 974 | ||
| 974 | VkPhysicalDeviceVariablePointerFeaturesKHR variable_pointers{}; | 975 | VkPhysicalDeviceVariablePointerFeatures variable_pointers{}; |
| 975 | variable_pointers.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES_KHR; | 976 | variable_pointers.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES; |
| 976 | variable_pointers.pNext = &demote; | 977 | variable_pointers.pNext = &demote; |
| 977 | 978 | ||
| 978 | VkPhysicalDeviceRobustness2FeaturesEXT robustness2{}; | 979 | VkPhysicalDeviceRobustness2FeaturesEXT robustness2{}; |
| 979 | robustness2.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_FEATURES_EXT; | 980 | robustness2.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_FEATURES_EXT; |
| 980 | robustness2.pNext = &variable_pointers; | 981 | robustness2.pNext = &variable_pointers; |
| 981 | 982 | ||
| 982 | VkPhysicalDeviceFeatures2KHR features2{}; | 983 | VkPhysicalDeviceTimelineSemaphoreFeatures timeline_semaphore{}; |
| 984 | timeline_semaphore.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES; | ||
| 985 | timeline_semaphore.pNext = &robustness2; | ||
| 986 | |||
| 987 | VkPhysicalDevice16BitStorageFeatures bit16_storage{}; | ||
| 988 | bit16_storage.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES; | ||
| 989 | bit16_storage.pNext = &timeline_semaphore; | ||
| 990 | |||
| 991 | VkPhysicalDevice8BitStorageFeatures bit8_storage{}; | ||
| 992 | bit8_storage.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES; | ||
| 993 | bit8_storage.pNext = &bit16_storage; | ||
| 994 | |||
| 995 | VkPhysicalDeviceHostQueryResetFeatures host_query_reset{}; | ||
| 996 | host_query_reset.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES; | ||
| 997 | host_query_reset.pNext = &bit8_storage; | ||
| 998 | |||
| 999 | VkPhysicalDeviceShaderDrawParametersFeatures draw_parameters{}; | ||
| 1000 | draw_parameters.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETER_FEATURES; | ||
| 1001 | draw_parameters.pNext = &host_query_reset; | ||
| 1002 | |||
| 1003 | VkPhysicalDeviceFeatures2 features2{}; | ||
| 983 | features2.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2; | 1004 | features2.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2; |
| 984 | features2.pNext = &robustness2; | 1005 | features2.pNext = &draw_parameters; |
| 985 | 1006 | ||
| 986 | physical.GetFeatures2KHR(features2); | 1007 | physical.GetFeatures2(features2); |
| 987 | 1008 | ||
| 988 | const VkPhysicalDeviceFeatures& features{features2.features}; | 1009 | const VkPhysicalDeviceFeatures& features{features2.features}; |
| 989 | std::vector feature_report{ | 1010 | std::array feature_report{ |
| 990 | std::make_pair(features.robustBufferAccess, "robustBufferAccess"), | 1011 | std::make_pair(features.robustBufferAccess, "robustBufferAccess"), |
| 991 | std::make_pair(features.vertexPipelineStoresAndAtomics, "vertexPipelineStoresAndAtomics"), | 1012 | std::make_pair(features.vertexPipelineStoresAndAtomics, "vertexPipelineStoresAndAtomics"), |
| 992 | std::make_pair(features.imageCubeArray, "imageCubeArray"), | 1013 | std::make_pair(features.imageCubeArray, "imageCubeArray"), |
| @@ -1002,6 +1023,7 @@ void Device::CheckSuitability(bool requires_swapchain) const { | |||
| 1002 | std::make_pair(features.tessellationShader, "tessellationShader"), | 1023 | std::make_pair(features.tessellationShader, "tessellationShader"), |
| 1003 | std::make_pair(features.sampleRateShading, "sampleRateShading"), | 1024 | std::make_pair(features.sampleRateShading, "sampleRateShading"), |
| 1004 | std::make_pair(features.dualSrcBlend, "dualSrcBlend"), | 1025 | std::make_pair(features.dualSrcBlend, "dualSrcBlend"), |
| 1026 | std::make_pair(features.logicOp, "logicOp"), | ||
| 1005 | std::make_pair(features.occlusionQueryPrecise, "occlusionQueryPrecise"), | 1027 | std::make_pair(features.occlusionQueryPrecise, "occlusionQueryPrecise"), |
| 1006 | std::make_pair(features.fragmentStoresAndAtomics, "fragmentStoresAndAtomics"), | 1028 | std::make_pair(features.fragmentStoresAndAtomics, "fragmentStoresAndAtomics"), |
| 1007 | std::make_pair(features.shaderImageGatherExtended, "shaderImageGatherExtended"), | 1029 | std::make_pair(features.shaderImageGatherExtended, "shaderImageGatherExtended"), |
| @@ -1016,6 +1038,14 @@ void Device::CheckSuitability(bool requires_swapchain) const { | |||
| 1016 | std::make_pair(robustness2.robustImageAccess2, "robustImageAccess2"), | 1038 | std::make_pair(robustness2.robustImageAccess2, "robustImageAccess2"), |
| 1017 | std::make_pair(robustness2.nullDescriptor, "nullDescriptor"), | 1039 | std::make_pair(robustness2.nullDescriptor, "nullDescriptor"), |
| 1018 | std::make_pair(demote.shaderDemoteToHelperInvocation, "shaderDemoteToHelperInvocation"), | 1040 | std::make_pair(demote.shaderDemoteToHelperInvocation, "shaderDemoteToHelperInvocation"), |
| 1041 | std::make_pair(timeline_semaphore.timelineSemaphore, "timelineSemaphore"), | ||
| 1042 | std::make_pair(bit16_storage.storageBuffer16BitAccess, "storageBuffer16BitAccess"), | ||
| 1043 | std::make_pair(bit16_storage.uniformAndStorageBuffer16BitAccess, | ||
| 1044 | "uniformAndStorageBuffer16BitAccess"), | ||
| 1045 | std::make_pair(bit8_storage.uniformAndStorageBuffer8BitAccess, | ||
| 1046 | "uniformAndStorageBuffer8BitAccess"), | ||
| 1047 | std::make_pair(host_query_reset.hostQueryReset, "hostQueryReset"), | ||
| 1048 | std::make_pair(draw_parameters.shaderDrawParameters, "shaderDrawParameters"), | ||
| 1019 | }; | 1049 | }; |
| 1020 | 1050 | ||
| 1021 | bool has_all_required_features = true; | 1051 | bool has_all_required_features = true; |
| @@ -1108,37 +1138,37 @@ std::vector<const char*> Device::LoadExtensions(bool requires_surface) { | |||
| 1108 | VK_KHR_PIPELINE_EXECUTABLE_PROPERTIES_EXTENSION_NAME, false); | 1138 | VK_KHR_PIPELINE_EXECUTABLE_PROPERTIES_EXTENSION_NAME, false); |
| 1109 | } | 1139 | } |
| 1110 | } | 1140 | } |
| 1111 | VkPhysicalDeviceFeatures2KHR features{}; | 1141 | VkPhysicalDeviceFeatures2 features{}; |
| 1112 | features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR; | 1142 | features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2; |
| 1113 | 1143 | ||
| 1114 | VkPhysicalDeviceProperties2KHR physical_properties{}; | 1144 | VkPhysicalDeviceProperties2 physical_properties{}; |
| 1115 | physical_properties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR; | 1145 | physical_properties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2; |
| 1116 | 1146 | ||
| 1117 | if (has_khr_shader_float16_int8) { | 1147 | if (has_khr_shader_float16_int8) { |
| 1118 | VkPhysicalDeviceFloat16Int8FeaturesKHR float16_int8_features; | 1148 | VkPhysicalDeviceShaderFloat16Int8Features float16_int8_features; |
| 1119 | float16_int8_features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT16_INT8_FEATURES_KHR; | 1149 | float16_int8_features.sType = |
| 1150 | VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES; | ||
| 1120 | float16_int8_features.pNext = nullptr; | 1151 | float16_int8_features.pNext = nullptr; |
| 1121 | features.pNext = &float16_int8_features; | 1152 | features.pNext = &float16_int8_features; |
| 1122 | 1153 | ||
| 1123 | physical.GetFeatures2KHR(features); | 1154 | physical.GetFeatures2(features); |
| 1124 | is_float16_supported = float16_int8_features.shaderFloat16; | 1155 | is_float16_supported = float16_int8_features.shaderFloat16; |
| 1125 | is_int8_supported = float16_int8_features.shaderInt8; | 1156 | is_int8_supported = float16_int8_features.shaderInt8; |
| 1126 | extensions.push_back(VK_KHR_SHADER_FLOAT16_INT8_EXTENSION_NAME); | 1157 | extensions.push_back(VK_KHR_SHADER_FLOAT16_INT8_EXTENSION_NAME); |
| 1127 | } | 1158 | } |
| 1128 | if (has_ext_subgroup_size_control) { | 1159 | if (has_ext_subgroup_size_control) { |
| 1129 | VkPhysicalDeviceSubgroupSizeControlFeaturesEXT subgroup_features; | 1160 | VkPhysicalDeviceSubgroupSizeControlFeatures subgroup_features; |
| 1130 | subgroup_features.sType = | 1161 | subgroup_features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES; |
| 1131 | VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES_EXT; | ||
| 1132 | subgroup_features.pNext = nullptr; | 1162 | subgroup_features.pNext = nullptr; |
| 1133 | features.pNext = &subgroup_features; | 1163 | features.pNext = &subgroup_features; |
| 1134 | physical.GetFeatures2KHR(features); | 1164 | physical.GetFeatures2(features); |
| 1135 | 1165 | ||
| 1136 | VkPhysicalDeviceSubgroupSizeControlPropertiesEXT subgroup_properties; | 1166 | VkPhysicalDeviceSubgroupSizeControlProperties subgroup_properties; |
| 1137 | subgroup_properties.sType = | 1167 | subgroup_properties.sType = |
| 1138 | VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES_EXT; | 1168 | VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES; |
| 1139 | subgroup_properties.pNext = nullptr; | 1169 | subgroup_properties.pNext = nullptr; |
| 1140 | physical_properties.pNext = &subgroup_properties; | 1170 | physical_properties.pNext = &subgroup_properties; |
| 1141 | physical.GetProperties2KHR(physical_properties); | 1171 | physical.GetProperties2(physical_properties); |
| 1142 | 1172 | ||
| 1143 | is_warp_potentially_bigger = subgroup_properties.maxSubgroupSize > GuestWarpSize; | 1173 | is_warp_potentially_bigger = subgroup_properties.maxSubgroupSize > GuestWarpSize; |
| 1144 | 1174 | ||
| @@ -1157,7 +1187,7 @@ std::vector<const char*> Device::LoadExtensions(bool requires_surface) { | |||
| 1157 | provoking_vertex.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_FEATURES_EXT; | 1187 | provoking_vertex.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_FEATURES_EXT; |
| 1158 | provoking_vertex.pNext = nullptr; | 1188 | provoking_vertex.pNext = nullptr; |
| 1159 | features.pNext = &provoking_vertex; | 1189 | features.pNext = &provoking_vertex; |
| 1160 | physical.GetFeatures2KHR(features); | 1190 | physical.GetFeatures2(features); |
| 1161 | 1191 | ||
| 1162 | if (provoking_vertex.provokingVertexLast && | 1192 | if (provoking_vertex.provokingVertexLast && |
| 1163 | provoking_vertex.transformFeedbackPreservesProvokingVertex) { | 1193 | provoking_vertex.transformFeedbackPreservesProvokingVertex) { |
| @@ -1171,7 +1201,7 @@ std::vector<const char*> Device::LoadExtensions(bool requires_surface) { | |||
| 1171 | VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT; | 1201 | VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT; |
| 1172 | vertex_input.pNext = nullptr; | 1202 | vertex_input.pNext = nullptr; |
| 1173 | features.pNext = &vertex_input; | 1203 | features.pNext = &vertex_input; |
| 1174 | physical.GetFeatures2KHR(features); | 1204 | physical.GetFeatures2(features); |
| 1175 | 1205 | ||
| 1176 | if (vertex_input.vertexInputDynamicState) { | 1206 | if (vertex_input.vertexInputDynamicState) { |
| 1177 | extensions.push_back(VK_EXT_VERTEX_INPUT_DYNAMIC_STATE_EXTENSION_NAME); | 1207 | extensions.push_back(VK_EXT_VERTEX_INPUT_DYNAMIC_STATE_EXTENSION_NAME); |
| @@ -1183,7 +1213,7 @@ std::vector<const char*> Device::LoadExtensions(bool requires_surface) { | |||
| 1183 | atomic_int64.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES; | 1213 | atomic_int64.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES; |
| 1184 | atomic_int64.pNext = nullptr; | 1214 | atomic_int64.pNext = nullptr; |
| 1185 | features.pNext = &atomic_int64; | 1215 | features.pNext = &atomic_int64; |
| 1186 | physical.GetFeatures2KHR(features); | 1216 | physical.GetFeatures2(features); |
| 1187 | 1217 | ||
| 1188 | if (atomic_int64.shaderBufferInt64Atomics && atomic_int64.shaderSharedInt64Atomics) { | 1218 | if (atomic_int64.shaderBufferInt64Atomics && atomic_int64.shaderSharedInt64Atomics) { |
| 1189 | extensions.push_back(VK_KHR_SHADER_ATOMIC_INT64_EXTENSION_NAME); | 1219 | extensions.push_back(VK_KHR_SHADER_ATOMIC_INT64_EXTENSION_NAME); |
| @@ -1195,13 +1225,13 @@ std::vector<const char*> Device::LoadExtensions(bool requires_surface) { | |||
| 1195 | tfb_features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT; | 1225 | tfb_features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT; |
| 1196 | tfb_features.pNext = nullptr; | 1226 | tfb_features.pNext = nullptr; |
| 1197 | features.pNext = &tfb_features; | 1227 | features.pNext = &tfb_features; |
| 1198 | physical.GetFeatures2KHR(features); | 1228 | physical.GetFeatures2(features); |
| 1199 | 1229 | ||
| 1200 | VkPhysicalDeviceTransformFeedbackPropertiesEXT tfb_properties; | 1230 | VkPhysicalDeviceTransformFeedbackPropertiesEXT tfb_properties; |
| 1201 | tfb_properties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_PROPERTIES_EXT; | 1231 | tfb_properties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_PROPERTIES_EXT; |
| 1202 | tfb_properties.pNext = nullptr; | 1232 | tfb_properties.pNext = nullptr; |
| 1203 | physical_properties.pNext = &tfb_properties; | 1233 | physical_properties.pNext = &tfb_properties; |
| 1204 | physical.GetProperties2KHR(physical_properties); | 1234 | physical.GetProperties2(physical_properties); |
| 1205 | 1235 | ||
| 1206 | if (tfb_features.transformFeedback && tfb_features.geometryStreams && | 1236 | if (tfb_features.transformFeedback && tfb_features.geometryStreams && |
| 1207 | tfb_properties.maxTransformFeedbackStreams >= 4 && | 1237 | tfb_properties.maxTransformFeedbackStreams >= 4 && |
| @@ -1216,7 +1246,7 @@ std::vector<const char*> Device::LoadExtensions(bool requires_surface) { | |||
| 1216 | border_features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_FEATURES_EXT; | 1246 | border_features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_FEATURES_EXT; |
| 1217 | border_features.pNext = nullptr; | 1247 | border_features.pNext = nullptr; |
| 1218 | features.pNext = &border_features; | 1248 | features.pNext = &border_features; |
| 1219 | physical.GetFeatures2KHR(features); | 1249 | physical.GetFeatures2(features); |
| 1220 | 1250 | ||
| 1221 | if (border_features.customBorderColors && border_features.customBorderColorWithoutFormat) { | 1251 | if (border_features.customBorderColors && border_features.customBorderColorWithoutFormat) { |
| 1222 | extensions.push_back(VK_EXT_CUSTOM_BORDER_COLOR_EXTENSION_NAME); | 1252 | extensions.push_back(VK_EXT_CUSTOM_BORDER_COLOR_EXTENSION_NAME); |
| @@ -1229,7 +1259,7 @@ std::vector<const char*> Device::LoadExtensions(bool requires_surface) { | |||
| 1229 | VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_FEATURES_EXT; | 1259 | VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_FEATURES_EXT; |
| 1230 | extended_dynamic_state.pNext = nullptr; | 1260 | extended_dynamic_state.pNext = nullptr; |
| 1231 | features.pNext = &extended_dynamic_state; | 1261 | features.pNext = &extended_dynamic_state; |
| 1232 | physical.GetFeatures2KHR(features); | 1262 | physical.GetFeatures2(features); |
| 1233 | 1263 | ||
| 1234 | if (extended_dynamic_state.extendedDynamicState) { | 1264 | if (extended_dynamic_state.extendedDynamicState) { |
| 1235 | extensions.push_back(VK_EXT_EXTENDED_DYNAMIC_STATE_EXTENSION_NAME); | 1265 | extensions.push_back(VK_EXT_EXTENDED_DYNAMIC_STATE_EXTENSION_NAME); |
| @@ -1241,7 +1271,7 @@ std::vector<const char*> Device::LoadExtensions(bool requires_surface) { | |||
| 1241 | line_raster.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_EXT; | 1271 | line_raster.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_EXT; |
| 1242 | line_raster.pNext = nullptr; | 1272 | line_raster.pNext = nullptr; |
| 1243 | features.pNext = &line_raster; | 1273 | features.pNext = &line_raster; |
| 1244 | physical.GetFeatures2KHR(features); | 1274 | physical.GetFeatures2(features); |
| 1245 | if (line_raster.rectangularLines && line_raster.smoothLines) { | 1275 | if (line_raster.rectangularLines && line_raster.smoothLines) { |
| 1246 | extensions.push_back(VK_EXT_LINE_RASTERIZATION_EXTENSION_NAME); | 1276 | extensions.push_back(VK_EXT_LINE_RASTERIZATION_EXTENSION_NAME); |
| 1247 | ext_line_rasterization = true; | 1277 | ext_line_rasterization = true; |
| @@ -1253,7 +1283,7 @@ std::vector<const char*> Device::LoadExtensions(bool requires_surface) { | |||
| 1253 | VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_FEATURES_KHR; | 1283 | VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_FEATURES_KHR; |
| 1254 | layout.pNext = nullptr; | 1284 | layout.pNext = nullptr; |
| 1255 | features.pNext = &layout; | 1285 | features.pNext = &layout; |
| 1256 | physical.GetFeatures2KHR(features); | 1286 | physical.GetFeatures2(features); |
| 1257 | 1287 | ||
| 1258 | if (layout.workgroupMemoryExplicitLayout && | 1288 | if (layout.workgroupMemoryExplicitLayout && |
| 1259 | layout.workgroupMemoryExplicitLayout8BitAccess && | 1289 | layout.workgroupMemoryExplicitLayout8BitAccess && |
| @@ -1269,7 +1299,7 @@ std::vector<const char*> Device::LoadExtensions(bool requires_surface) { | |||
| 1269 | VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_EXECUTABLE_PROPERTIES_FEATURES_KHR; | 1299 | VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_EXECUTABLE_PROPERTIES_FEATURES_KHR; |
| 1270 | executable_properties.pNext = nullptr; | 1300 | executable_properties.pNext = nullptr; |
| 1271 | features.pNext = &executable_properties; | 1301 | features.pNext = &executable_properties; |
| 1272 | physical.GetFeatures2KHR(features); | 1302 | physical.GetFeatures2(features); |
| 1273 | 1303 | ||
| 1274 | if (executable_properties.pipelineExecutableInfo) { | 1304 | if (executable_properties.pipelineExecutableInfo) { |
| 1275 | extensions.push_back(VK_KHR_PIPELINE_EXECUTABLE_PROPERTIES_EXTENSION_NAME); | 1305 | extensions.push_back(VK_KHR_PIPELINE_EXECUTABLE_PROPERTIES_EXTENSION_NAME); |
| @@ -1282,7 +1312,7 @@ std::vector<const char*> Device::LoadExtensions(bool requires_surface) { | |||
| 1282 | VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVE_TOPOLOGY_LIST_RESTART_FEATURES_EXT; | 1312 | VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVE_TOPOLOGY_LIST_RESTART_FEATURES_EXT; |
| 1283 | primitive_topology_list_restart.pNext = nullptr; | 1313 | primitive_topology_list_restart.pNext = nullptr; |
| 1284 | features.pNext = &primitive_topology_list_restart; | 1314 | features.pNext = &primitive_topology_list_restart; |
| 1285 | physical.GetFeatures2KHR(features); | 1315 | physical.GetFeatures2(features); |
| 1286 | 1316 | ||
| 1287 | is_topology_list_restart_supported = | 1317 | is_topology_list_restart_supported = |
| 1288 | primitive_topology_list_restart.primitiveTopologyListRestart; | 1318 | primitive_topology_list_restart.primitiveTopologyListRestart; |
| @@ -1300,7 +1330,7 @@ std::vector<const char*> Device::LoadExtensions(bool requires_surface) { | |||
| 1300 | push_descriptor.pNext = nullptr; | 1330 | push_descriptor.pNext = nullptr; |
| 1301 | 1331 | ||
| 1302 | physical_properties.pNext = &push_descriptor; | 1332 | physical_properties.pNext = &push_descriptor; |
| 1303 | physical.GetProperties2KHR(physical_properties); | 1333 | physical.GetProperties2(physical_properties); |
| 1304 | 1334 | ||
| 1305 | max_push_descriptors = push_descriptor.maxPushDescriptors; | 1335 | max_push_descriptors = push_descriptor.maxPushDescriptors; |
| 1306 | } | 1336 | } |
| @@ -1351,18 +1381,18 @@ void Device::SetupFeatures() { | |||
| 1351 | } | 1381 | } |
| 1352 | 1382 | ||
| 1353 | void Device::SetupProperties() { | 1383 | void Device::SetupProperties() { |
| 1354 | float_controls.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES_KHR; | 1384 | float_controls.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES; |
| 1355 | 1385 | ||
| 1356 | VkPhysicalDeviceProperties2KHR properties2{}; | 1386 | VkPhysicalDeviceProperties2KHR properties2{}; |
| 1357 | properties2.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR; | 1387 | properties2.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2; |
| 1358 | properties2.pNext = &float_controls; | 1388 | properties2.pNext = &float_controls; |
| 1359 | 1389 | ||
| 1360 | physical.GetProperties2KHR(properties2); | 1390 | physical.GetProperties2(properties2); |
| 1361 | } | 1391 | } |
| 1362 | 1392 | ||
| 1363 | void Device::CollectTelemetryParameters() { | 1393 | void Device::CollectTelemetryParameters() { |
| 1364 | VkPhysicalDeviceDriverPropertiesKHR driver{ | 1394 | VkPhysicalDeviceDriverProperties driver{ |
| 1365 | .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES_KHR, | 1395 | .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES, |
| 1366 | .pNext = nullptr, | 1396 | .pNext = nullptr, |
| 1367 | .driverID = {}, | 1397 | .driverID = {}, |
| 1368 | .driverName = {}, | 1398 | .driverName = {}, |
| @@ -1370,12 +1400,12 @@ void Device::CollectTelemetryParameters() { | |||
| 1370 | .conformanceVersion = {}, | 1400 | .conformanceVersion = {}, |
| 1371 | }; | 1401 | }; |
| 1372 | 1402 | ||
| 1373 | VkPhysicalDeviceProperties2KHR device_properties{ | 1403 | VkPhysicalDeviceProperties2 device_properties{ |
| 1374 | .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR, | 1404 | .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2, |
| 1375 | .pNext = &driver, | 1405 | .pNext = &driver, |
| 1376 | .properties = {}, | 1406 | .properties = {}, |
| 1377 | }; | 1407 | }; |
| 1378 | physical.GetProperties2KHR(device_properties); | 1408 | physical.GetProperties2(device_properties); |
| 1379 | 1409 | ||
| 1380 | driver_id = driver.driverID; | 1410 | driver_id = driver.driverID; |
| 1381 | vendor_name = driver.driverName; | 1411 | vendor_name = driver.driverName; |
| @@ -1431,23 +1461,10 @@ void Device::CollectToolingInfo() { | |||
| 1431 | if (!ext_tooling_info) { | 1461 | if (!ext_tooling_info) { |
| 1432 | return; | 1462 | return; |
| 1433 | } | 1463 | } |
| 1434 | const auto vkGetPhysicalDeviceToolPropertiesEXT = | 1464 | auto tools{physical.GetPhysicalDeviceToolProperties()}; |
| 1435 | reinterpret_cast<PFN_vkGetPhysicalDeviceToolPropertiesEXT>( | 1465 | for (const VkPhysicalDeviceToolProperties& tool : tools) { |
| 1436 | dld.vkGetInstanceProcAddr(instance, "vkGetPhysicalDeviceToolPropertiesEXT")); | ||
| 1437 | if (!vkGetPhysicalDeviceToolPropertiesEXT) { | ||
| 1438 | return; | ||
| 1439 | } | ||
| 1440 | u32 tool_count = 0; | ||
| 1441 | if (vkGetPhysicalDeviceToolPropertiesEXT(physical, &tool_count, nullptr) != VK_SUCCESS) { | ||
| 1442 | return; | ||
| 1443 | } | ||
| 1444 | std::vector<VkPhysicalDeviceToolPropertiesEXT> tools(tool_count); | ||
| 1445 | if (vkGetPhysicalDeviceToolPropertiesEXT(physical, &tool_count, tools.data()) != VK_SUCCESS) { | ||
| 1446 | return; | ||
| 1447 | } | ||
| 1448 | for (const VkPhysicalDeviceToolPropertiesEXT& tool : tools) { | ||
| 1449 | const std::string_view name = tool.name; | 1466 | const std::string_view name = tool.name; |
| 1450 | LOG_INFO(Render_Vulkan, "{}", name); | 1467 | LOG_INFO(Render_Vulkan, "Attached debugging tool: {}", name); |
| 1451 | has_renderdoc = has_renderdoc || name == "RenderDoc"; | 1468 | has_renderdoc = has_renderdoc || name == "RenderDoc"; |
| 1452 | has_nsight_graphics = has_nsight_graphics || name == "NVIDIA Nsight Graphics"; | 1469 | has_nsight_graphics = has_nsight_graphics || name == "NVIDIA Nsight Graphics"; |
| 1453 | } | 1470 | } |
diff --git a/src/video_core/vulkan_common/vulkan_device.h b/src/video_core/vulkan_common/vulkan_device.h index c85fbba77..db802437c 100644 --- a/src/video_core/vulkan_common/vulkan_device.h +++ b/src/video_core/vulkan_common/vulkan_device.h | |||
| @@ -217,7 +217,7 @@ public: | |||
| 217 | } | 217 | } |
| 218 | 218 | ||
| 219 | /// Returns true if VK_KHR_pipeline_executable_properties is enabled. | 219 | /// Returns true if VK_KHR_pipeline_executable_properties is enabled. |
| 220 | bool IsKhrPipelineEexecutablePropertiesEnabled() const { | 220 | bool IsKhrPipelineExecutablePropertiesEnabled() const { |
| 221 | return khr_pipeline_executable_properties; | 221 | return khr_pipeline_executable_properties; |
| 222 | } | 222 | } |
| 223 | 223 | ||
diff --git a/src/video_core/vulkan_common/vulkan_wrapper.cpp b/src/video_core/vulkan_common/vulkan_wrapper.cpp index 2ad98dcfe..e4a07813f 100644 --- a/src/video_core/vulkan_common/vulkan_wrapper.cpp +++ b/src/video_core/vulkan_common/vulkan_wrapper.cpp | |||
| @@ -130,7 +130,7 @@ void Load(VkDevice device, DeviceDispatch& dld) noexcept { | |||
| 130 | X(vkCreateComputePipelines); | 130 | X(vkCreateComputePipelines); |
| 131 | X(vkCreateDescriptorPool); | 131 | X(vkCreateDescriptorPool); |
| 132 | X(vkCreateDescriptorSetLayout); | 132 | X(vkCreateDescriptorSetLayout); |
| 133 | X(vkCreateDescriptorUpdateTemplateKHR); | 133 | X(vkCreateDescriptorUpdateTemplate); |
| 134 | X(vkCreateEvent); | 134 | X(vkCreateEvent); |
| 135 | X(vkCreateFence); | 135 | X(vkCreateFence); |
| 136 | X(vkCreateFramebuffer); | 136 | X(vkCreateFramebuffer); |
| @@ -149,7 +149,7 @@ void Load(VkDevice device, DeviceDispatch& dld) noexcept { | |||
| 149 | X(vkDestroyCommandPool); | 149 | X(vkDestroyCommandPool); |
| 150 | X(vkDestroyDescriptorPool); | 150 | X(vkDestroyDescriptorPool); |
| 151 | X(vkDestroyDescriptorSetLayout); | 151 | X(vkDestroyDescriptorSetLayout); |
| 152 | X(vkDestroyDescriptorUpdateTemplateKHR); | 152 | X(vkDestroyDescriptorUpdateTemplate); |
| 153 | X(vkDestroyEvent); | 153 | X(vkDestroyEvent); |
| 154 | X(vkDestroyFence); | 154 | X(vkDestroyFence); |
| 155 | X(vkDestroyFramebuffer); | 155 | X(vkDestroyFramebuffer); |
| @@ -180,18 +180,29 @@ void Load(VkDevice device, DeviceDispatch& dld) noexcept { | |||
| 180 | X(vkGetQueryPoolResults); | 180 | X(vkGetQueryPoolResults); |
| 181 | X(vkGetPipelineExecutablePropertiesKHR); | 181 | X(vkGetPipelineExecutablePropertiesKHR); |
| 182 | X(vkGetPipelineExecutableStatisticsKHR); | 182 | X(vkGetPipelineExecutableStatisticsKHR); |
| 183 | X(vkGetSemaphoreCounterValueKHR); | 183 | X(vkGetSemaphoreCounterValue); |
| 184 | X(vkMapMemory); | 184 | X(vkMapMemory); |
| 185 | X(vkQueueSubmit); | 185 | X(vkQueueSubmit); |
| 186 | X(vkResetFences); | 186 | X(vkResetFences); |
| 187 | X(vkResetQueryPoolEXT); | 187 | X(vkResetQueryPool); |
| 188 | X(vkSetDebugUtilsObjectNameEXT); | 188 | X(vkSetDebugUtilsObjectNameEXT); |
| 189 | X(vkSetDebugUtilsObjectTagEXT); | 189 | X(vkSetDebugUtilsObjectTagEXT); |
| 190 | X(vkUnmapMemory); | 190 | X(vkUnmapMemory); |
| 191 | X(vkUpdateDescriptorSetWithTemplateKHR); | 191 | X(vkUpdateDescriptorSetWithTemplate); |
| 192 | X(vkUpdateDescriptorSets); | 192 | X(vkUpdateDescriptorSets); |
| 193 | X(vkWaitForFences); | 193 | X(vkWaitForFences); |
| 194 | X(vkWaitSemaphoresKHR); | 194 | X(vkWaitSemaphores); |
| 195 | |||
| 196 | // Support for timeline semaphores is mandatory in Vulkan 1.2 | ||
| 197 | if (!dld.vkGetSemaphoreCounterValue) { | ||
| 198 | Proc(dld.vkGetSemaphoreCounterValue, dld, "vkGetSemaphoreCounterValueKHR", device); | ||
| 199 | Proc(dld.vkWaitSemaphores, dld, "vkWaitSemaphoresKHR", device); | ||
| 200 | } | ||
| 201 | |||
| 202 | // Support for host query reset is mandatory in Vulkan 1.2 | ||
| 203 | if (!dld.vkResetQueryPool) { | ||
| 204 | Proc(dld.vkResetQueryPool, dld, "vkResetQueryPoolEXT", device); | ||
| 205 | } | ||
| 195 | #undef X | 206 | #undef X |
| 196 | } | 207 | } |
| 197 | 208 | ||
| @@ -224,12 +235,13 @@ bool Load(VkInstance instance, InstanceDispatch& dld) noexcept { | |||
| 224 | X(vkCreateDebugUtilsMessengerEXT); | 235 | X(vkCreateDebugUtilsMessengerEXT); |
| 225 | X(vkDestroyDebugUtilsMessengerEXT); | 236 | X(vkDestroyDebugUtilsMessengerEXT); |
| 226 | X(vkDestroySurfaceKHR); | 237 | X(vkDestroySurfaceKHR); |
| 227 | X(vkGetPhysicalDeviceFeatures2KHR); | 238 | X(vkGetPhysicalDeviceFeatures2); |
| 228 | X(vkGetPhysicalDeviceProperties2KHR); | 239 | X(vkGetPhysicalDeviceProperties2); |
| 229 | X(vkGetPhysicalDeviceSurfaceCapabilitiesKHR); | 240 | X(vkGetPhysicalDeviceSurfaceCapabilitiesKHR); |
| 230 | X(vkGetPhysicalDeviceSurfaceFormatsKHR); | 241 | X(vkGetPhysicalDeviceSurfaceFormatsKHR); |
| 231 | X(vkGetPhysicalDeviceSurfacePresentModesKHR); | 242 | X(vkGetPhysicalDeviceSurfacePresentModesKHR); |
| 232 | X(vkGetPhysicalDeviceSurfaceSupportKHR); | 243 | X(vkGetPhysicalDeviceSurfaceSupportKHR); |
| 244 | X(vkGetPhysicalDeviceToolProperties); | ||
| 233 | X(vkGetSwapchainImagesKHR); | 245 | X(vkGetSwapchainImagesKHR); |
| 234 | X(vkQueuePresentKHR); | 246 | X(vkQueuePresentKHR); |
| 235 | 247 | ||
| @@ -359,9 +371,9 @@ void Destroy(VkDevice device, VkDescriptorSetLayout handle, const DeviceDispatch | |||
| 359 | dld.vkDestroyDescriptorSetLayout(device, handle, nullptr); | 371 | dld.vkDestroyDescriptorSetLayout(device, handle, nullptr); |
| 360 | } | 372 | } |
| 361 | 373 | ||
| 362 | void Destroy(VkDevice device, VkDescriptorUpdateTemplateKHR handle, | 374 | void Destroy(VkDevice device, VkDescriptorUpdateTemplate handle, |
| 363 | const DeviceDispatch& dld) noexcept { | 375 | const DeviceDispatch& dld) noexcept { |
| 364 | dld.vkDestroyDescriptorUpdateTemplateKHR(device, handle, nullptr); | 376 | dld.vkDestroyDescriptorUpdateTemplate(device, handle, nullptr); |
| 365 | } | 377 | } |
| 366 | 378 | ||
| 367 | void Destroy(VkDevice device, VkDeviceMemory handle, const DeviceDispatch& dld) noexcept { | 379 | void Destroy(VkDevice device, VkDeviceMemory handle, const DeviceDispatch& dld) noexcept { |
| @@ -737,11 +749,11 @@ CommandPool Device::CreateCommandPool(const VkCommandPoolCreateInfo& ci) const { | |||
| 737 | return CommandPool(object, handle, *dld); | 749 | return CommandPool(object, handle, *dld); |
| 738 | } | 750 | } |
| 739 | 751 | ||
| 740 | DescriptorUpdateTemplateKHR Device::CreateDescriptorUpdateTemplateKHR( | 752 | DescriptorUpdateTemplate Device::CreateDescriptorUpdateTemplate( |
| 741 | const VkDescriptorUpdateTemplateCreateInfoKHR& ci) const { | 753 | const VkDescriptorUpdateTemplateCreateInfo& ci) const { |
| 742 | VkDescriptorUpdateTemplateKHR object; | 754 | VkDescriptorUpdateTemplate object; |
| 743 | Check(dld->vkCreateDescriptorUpdateTemplateKHR(handle, &ci, nullptr, &object)); | 755 | Check(dld->vkCreateDescriptorUpdateTemplate(handle, &ci, nullptr, &object)); |
| 744 | return DescriptorUpdateTemplateKHR(object, handle, *dld); | 756 | return DescriptorUpdateTemplate(object, handle, *dld); |
| 745 | } | 757 | } |
| 746 | 758 | ||
| 747 | QueryPool Device::CreateQueryPool(const VkQueryPoolCreateInfo& ci) const { | 759 | QueryPool Device::CreateQueryPool(const VkQueryPoolCreateInfo& ci) const { |
| @@ -857,20 +869,20 @@ VkPhysicalDeviceProperties PhysicalDevice::GetProperties() const noexcept { | |||
| 857 | return properties; | 869 | return properties; |
| 858 | } | 870 | } |
| 859 | 871 | ||
| 860 | void PhysicalDevice::GetProperties2KHR(VkPhysicalDeviceProperties2KHR& properties) const noexcept { | 872 | void PhysicalDevice::GetProperties2(VkPhysicalDeviceProperties2& properties) const noexcept { |
| 861 | dld->vkGetPhysicalDeviceProperties2KHR(physical_device, &properties); | 873 | dld->vkGetPhysicalDeviceProperties2(physical_device, &properties); |
| 862 | } | 874 | } |
| 863 | 875 | ||
| 864 | VkPhysicalDeviceFeatures PhysicalDevice::GetFeatures() const noexcept { | 876 | VkPhysicalDeviceFeatures PhysicalDevice::GetFeatures() const noexcept { |
| 865 | VkPhysicalDeviceFeatures2KHR features2; | 877 | VkPhysicalDeviceFeatures2 features2; |
| 866 | features2.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR; | 878 | features2.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2; |
| 867 | features2.pNext = nullptr; | 879 | features2.pNext = nullptr; |
| 868 | dld->vkGetPhysicalDeviceFeatures2KHR(physical_device, &features2); | 880 | dld->vkGetPhysicalDeviceFeatures2(physical_device, &features2); |
| 869 | return features2.features; | 881 | return features2.features; |
| 870 | } | 882 | } |
| 871 | 883 | ||
| 872 | void PhysicalDevice::GetFeatures2KHR(VkPhysicalDeviceFeatures2KHR& features) const noexcept { | 884 | void PhysicalDevice::GetFeatures2(VkPhysicalDeviceFeatures2& features) const noexcept { |
| 873 | dld->vkGetPhysicalDeviceFeatures2KHR(physical_device, &features); | 885 | dld->vkGetPhysicalDeviceFeatures2(physical_device, &features); |
| 874 | } | 886 | } |
| 875 | 887 | ||
| 876 | VkFormatProperties PhysicalDevice::GetFormatProperties(VkFormat format) const noexcept { | 888 | VkFormatProperties PhysicalDevice::GetFormatProperties(VkFormat format) const noexcept { |
| @@ -895,6 +907,18 @@ std::vector<VkQueueFamilyProperties> PhysicalDevice::GetQueueFamilyProperties() | |||
| 895 | return properties; | 907 | return properties; |
| 896 | } | 908 | } |
| 897 | 909 | ||
| 910 | std::vector<VkPhysicalDeviceToolProperties> PhysicalDevice::GetPhysicalDeviceToolProperties() | ||
| 911 | const { | ||
| 912 | u32 num = 0; | ||
| 913 | if (!dld->vkGetPhysicalDeviceToolProperties) { | ||
| 914 | return {}; | ||
| 915 | } | ||
| 916 | dld->vkGetPhysicalDeviceToolProperties(physical_device, &num, nullptr); | ||
| 917 | std::vector<VkPhysicalDeviceToolProperties> properties(num); | ||
| 918 | dld->vkGetPhysicalDeviceToolProperties(physical_device, &num, properties.data()); | ||
| 919 | return properties; | ||
| 920 | } | ||
| 921 | |||
| 898 | bool PhysicalDevice::GetSurfaceSupportKHR(u32 queue_family_index, VkSurfaceKHR surface) const { | 922 | bool PhysicalDevice::GetSurfaceSupportKHR(u32 queue_family_index, VkSurfaceKHR surface) const { |
| 899 | VkBool32 supported; | 923 | VkBool32 supported; |
| 900 | Check(dld->vkGetPhysicalDeviceSurfaceSupportKHR(physical_device, queue_family_index, surface, | 924 | Check(dld->vkGetPhysicalDeviceSurfaceSupportKHR(physical_device, queue_family_index, surface, |
diff --git a/src/video_core/vulkan_common/vulkan_wrapper.h b/src/video_core/vulkan_common/vulkan_wrapper.h index 1b3f493bd..8395ff2cb 100644 --- a/src/video_core/vulkan_common/vulkan_wrapper.h +++ b/src/video_core/vulkan_common/vulkan_wrapper.h | |||
| @@ -168,12 +168,13 @@ struct InstanceDispatch { | |||
| 168 | PFN_vkEnumerateDeviceExtensionProperties vkEnumerateDeviceExtensionProperties{}; | 168 | PFN_vkEnumerateDeviceExtensionProperties vkEnumerateDeviceExtensionProperties{}; |
| 169 | PFN_vkEnumeratePhysicalDevices vkEnumeratePhysicalDevices{}; | 169 | PFN_vkEnumeratePhysicalDevices vkEnumeratePhysicalDevices{}; |
| 170 | PFN_vkGetDeviceProcAddr vkGetDeviceProcAddr{}; | 170 | PFN_vkGetDeviceProcAddr vkGetDeviceProcAddr{}; |
| 171 | PFN_vkGetPhysicalDeviceFeatures2KHR vkGetPhysicalDeviceFeatures2KHR{}; | 171 | PFN_vkGetPhysicalDeviceFeatures2 vkGetPhysicalDeviceFeatures2{}; |
| 172 | PFN_vkGetPhysicalDeviceFormatProperties vkGetPhysicalDeviceFormatProperties{}; | 172 | PFN_vkGetPhysicalDeviceFormatProperties vkGetPhysicalDeviceFormatProperties{}; |
| 173 | PFN_vkGetPhysicalDeviceMemoryProperties vkGetPhysicalDeviceMemoryProperties{}; | 173 | PFN_vkGetPhysicalDeviceMemoryProperties vkGetPhysicalDeviceMemoryProperties{}; |
| 174 | PFN_vkGetPhysicalDeviceMemoryProperties2 vkGetPhysicalDeviceMemoryProperties2{}; | 174 | PFN_vkGetPhysicalDeviceMemoryProperties2 vkGetPhysicalDeviceMemoryProperties2{}; |
| 175 | PFN_vkGetPhysicalDeviceProperties vkGetPhysicalDeviceProperties{}; | 175 | PFN_vkGetPhysicalDeviceProperties vkGetPhysicalDeviceProperties{}; |
| 176 | PFN_vkGetPhysicalDeviceProperties2KHR vkGetPhysicalDeviceProperties2KHR{}; | 176 | PFN_vkGetPhysicalDeviceProperties2 vkGetPhysicalDeviceProperties2{}; |
| 177 | PFN_vkGetPhysicalDeviceToolProperties vkGetPhysicalDeviceToolProperties{}; | ||
| 177 | PFN_vkGetPhysicalDeviceQueueFamilyProperties vkGetPhysicalDeviceQueueFamilyProperties{}; | 178 | PFN_vkGetPhysicalDeviceQueueFamilyProperties vkGetPhysicalDeviceQueueFamilyProperties{}; |
| 178 | PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR vkGetPhysicalDeviceSurfaceCapabilitiesKHR{}; | 179 | PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR vkGetPhysicalDeviceSurfaceCapabilitiesKHR{}; |
| 179 | PFN_vkGetPhysicalDeviceSurfaceFormatsKHR vkGetPhysicalDeviceSurfaceFormatsKHR{}; | 180 | PFN_vkGetPhysicalDeviceSurfaceFormatsKHR vkGetPhysicalDeviceSurfaceFormatsKHR{}; |
| @@ -247,7 +248,7 @@ struct DeviceDispatch : InstanceDispatch { | |||
| 247 | PFN_vkCreateComputePipelines vkCreateComputePipelines{}; | 248 | PFN_vkCreateComputePipelines vkCreateComputePipelines{}; |
| 248 | PFN_vkCreateDescriptorPool vkCreateDescriptorPool{}; | 249 | PFN_vkCreateDescriptorPool vkCreateDescriptorPool{}; |
| 249 | PFN_vkCreateDescriptorSetLayout vkCreateDescriptorSetLayout{}; | 250 | PFN_vkCreateDescriptorSetLayout vkCreateDescriptorSetLayout{}; |
| 250 | PFN_vkCreateDescriptorUpdateTemplateKHR vkCreateDescriptorUpdateTemplateKHR{}; | 251 | PFN_vkCreateDescriptorUpdateTemplate vkCreateDescriptorUpdateTemplate{}; |
| 251 | PFN_vkCreateEvent vkCreateEvent{}; | 252 | PFN_vkCreateEvent vkCreateEvent{}; |
| 252 | PFN_vkCreateFence vkCreateFence{}; | 253 | PFN_vkCreateFence vkCreateFence{}; |
| 253 | PFN_vkCreateFramebuffer vkCreateFramebuffer{}; | 254 | PFN_vkCreateFramebuffer vkCreateFramebuffer{}; |
| @@ -266,7 +267,7 @@ struct DeviceDispatch : InstanceDispatch { | |||
| 266 | PFN_vkDestroyCommandPool vkDestroyCommandPool{}; | 267 | PFN_vkDestroyCommandPool vkDestroyCommandPool{}; |
| 267 | PFN_vkDestroyDescriptorPool vkDestroyDescriptorPool{}; | 268 | PFN_vkDestroyDescriptorPool vkDestroyDescriptorPool{}; |
| 268 | PFN_vkDestroyDescriptorSetLayout vkDestroyDescriptorSetLayout{}; | 269 | PFN_vkDestroyDescriptorSetLayout vkDestroyDescriptorSetLayout{}; |
| 269 | PFN_vkDestroyDescriptorUpdateTemplateKHR vkDestroyDescriptorUpdateTemplateKHR{}; | 270 | PFN_vkDestroyDescriptorUpdateTemplate vkDestroyDescriptorUpdateTemplate{}; |
| 270 | PFN_vkDestroyEvent vkDestroyEvent{}; | 271 | PFN_vkDestroyEvent vkDestroyEvent{}; |
| 271 | PFN_vkDestroyFence vkDestroyFence{}; | 272 | PFN_vkDestroyFence vkDestroyFence{}; |
| 272 | PFN_vkDestroyFramebuffer vkDestroyFramebuffer{}; | 273 | PFN_vkDestroyFramebuffer vkDestroyFramebuffer{}; |
| @@ -297,18 +298,18 @@ struct DeviceDispatch : InstanceDispatch { | |||
| 297 | PFN_vkGetPipelineExecutablePropertiesKHR vkGetPipelineExecutablePropertiesKHR{}; | 298 | PFN_vkGetPipelineExecutablePropertiesKHR vkGetPipelineExecutablePropertiesKHR{}; |
| 298 | PFN_vkGetPipelineExecutableStatisticsKHR vkGetPipelineExecutableStatisticsKHR{}; | 299 | PFN_vkGetPipelineExecutableStatisticsKHR vkGetPipelineExecutableStatisticsKHR{}; |
| 299 | PFN_vkGetQueryPoolResults vkGetQueryPoolResults{}; | 300 | PFN_vkGetQueryPoolResults vkGetQueryPoolResults{}; |
| 300 | PFN_vkGetSemaphoreCounterValueKHR vkGetSemaphoreCounterValueKHR{}; | 301 | PFN_vkGetSemaphoreCounterValue vkGetSemaphoreCounterValue{}; |
| 301 | PFN_vkMapMemory vkMapMemory{}; | 302 | PFN_vkMapMemory vkMapMemory{}; |
| 302 | PFN_vkQueueSubmit vkQueueSubmit{}; | 303 | PFN_vkQueueSubmit vkQueueSubmit{}; |
| 303 | PFN_vkResetFences vkResetFences{}; | 304 | PFN_vkResetFences vkResetFences{}; |
| 304 | PFN_vkResetQueryPoolEXT vkResetQueryPoolEXT{}; | 305 | PFN_vkResetQueryPool vkResetQueryPool{}; |
| 305 | PFN_vkSetDebugUtilsObjectNameEXT vkSetDebugUtilsObjectNameEXT{}; | 306 | PFN_vkSetDebugUtilsObjectNameEXT vkSetDebugUtilsObjectNameEXT{}; |
| 306 | PFN_vkSetDebugUtilsObjectTagEXT vkSetDebugUtilsObjectTagEXT{}; | 307 | PFN_vkSetDebugUtilsObjectTagEXT vkSetDebugUtilsObjectTagEXT{}; |
| 307 | PFN_vkUnmapMemory vkUnmapMemory{}; | 308 | PFN_vkUnmapMemory vkUnmapMemory{}; |
| 308 | PFN_vkUpdateDescriptorSetWithTemplateKHR vkUpdateDescriptorSetWithTemplateKHR{}; | 309 | PFN_vkUpdateDescriptorSetWithTemplate vkUpdateDescriptorSetWithTemplate{}; |
| 309 | PFN_vkUpdateDescriptorSets vkUpdateDescriptorSets{}; | 310 | PFN_vkUpdateDescriptorSets vkUpdateDescriptorSets{}; |
| 310 | PFN_vkWaitForFences vkWaitForFences{}; | 311 | PFN_vkWaitForFences vkWaitForFences{}; |
| 311 | PFN_vkWaitSemaphoresKHR vkWaitSemaphoresKHR{}; | 312 | PFN_vkWaitSemaphores vkWaitSemaphores{}; |
| 312 | }; | 313 | }; |
| 313 | 314 | ||
| 314 | /// Loads instance agnostic function pointers. | 315 | /// Loads instance agnostic function pointers. |
| @@ -327,7 +328,7 @@ void Destroy(VkDevice, VkBufferView, const DeviceDispatch&) noexcept; | |||
| 327 | void Destroy(VkDevice, VkCommandPool, const DeviceDispatch&) noexcept; | 328 | void Destroy(VkDevice, VkCommandPool, const DeviceDispatch&) noexcept; |
| 328 | void Destroy(VkDevice, VkDescriptorPool, const DeviceDispatch&) noexcept; | 329 | void Destroy(VkDevice, VkDescriptorPool, const DeviceDispatch&) noexcept; |
| 329 | void Destroy(VkDevice, VkDescriptorSetLayout, const DeviceDispatch&) noexcept; | 330 | void Destroy(VkDevice, VkDescriptorSetLayout, const DeviceDispatch&) noexcept; |
| 330 | void Destroy(VkDevice, VkDescriptorUpdateTemplateKHR, const DeviceDispatch&) noexcept; | 331 | void Destroy(VkDevice, VkDescriptorUpdateTemplate, const DeviceDispatch&) noexcept; |
| 331 | void Destroy(VkDevice, VkDeviceMemory, const DeviceDispatch&) noexcept; | 332 | void Destroy(VkDevice, VkDeviceMemory, const DeviceDispatch&) noexcept; |
| 332 | void Destroy(VkDevice, VkEvent, const DeviceDispatch&) noexcept; | 333 | void Destroy(VkDevice, VkEvent, const DeviceDispatch&) noexcept; |
| 333 | void Destroy(VkDevice, VkFence, const DeviceDispatch&) noexcept; | 334 | void Destroy(VkDevice, VkFence, const DeviceDispatch&) noexcept; |
| @@ -559,7 +560,7 @@ private: | |||
| 559 | 560 | ||
| 560 | using DebugUtilsMessenger = Handle<VkDebugUtilsMessengerEXT, VkInstance, InstanceDispatch>; | 561 | using DebugUtilsMessenger = Handle<VkDebugUtilsMessengerEXT, VkInstance, InstanceDispatch>; |
| 561 | using DescriptorSetLayout = Handle<VkDescriptorSetLayout, VkDevice, DeviceDispatch>; | 562 | using DescriptorSetLayout = Handle<VkDescriptorSetLayout, VkDevice, DeviceDispatch>; |
| 562 | using DescriptorUpdateTemplateKHR = Handle<VkDescriptorUpdateTemplateKHR, VkDevice, DeviceDispatch>; | 563 | using DescriptorUpdateTemplate = Handle<VkDescriptorUpdateTemplate, VkDevice, DeviceDispatch>; |
| 563 | using Pipeline = Handle<VkPipeline, VkDevice, DeviceDispatch>; | 564 | using Pipeline = Handle<VkPipeline, VkDevice, DeviceDispatch>; |
| 564 | using PipelineLayout = Handle<VkPipelineLayout, VkDevice, DeviceDispatch>; | 565 | using PipelineLayout = Handle<VkPipelineLayout, VkDevice, DeviceDispatch>; |
| 565 | using QueryPool = Handle<VkQueryPool, VkDevice, DeviceDispatch>; | 566 | using QueryPool = Handle<VkQueryPool, VkDevice, DeviceDispatch>; |
| @@ -766,7 +767,7 @@ public: | |||
| 766 | 767 | ||
| 767 | [[nodiscard]] u64 GetCounter() const { | 768 | [[nodiscard]] u64 GetCounter() const { |
| 768 | u64 value; | 769 | u64 value; |
| 769 | Check(dld->vkGetSemaphoreCounterValueKHR(owner, handle, &value)); | 770 | Check(dld->vkGetSemaphoreCounterValue(owner, handle, &value)); |
| 770 | return value; | 771 | return value; |
| 771 | } | 772 | } |
| 772 | 773 | ||
| @@ -778,15 +779,15 @@ public: | |||
| 778 | * @return True on successful wait, false on timeout | 779 | * @return True on successful wait, false on timeout |
| 779 | */ | 780 | */ |
| 780 | bool Wait(u64 value, u64 timeout = std::numeric_limits<u64>::max()) const { | 781 | bool Wait(u64 value, u64 timeout = std::numeric_limits<u64>::max()) const { |
| 781 | const VkSemaphoreWaitInfoKHR wait_info{ | 782 | const VkSemaphoreWaitInfo wait_info{ |
| 782 | .sType = VK_STRUCTURE_TYPE_SEMAPHORE_WAIT_INFO_KHR, | 783 | .sType = VK_STRUCTURE_TYPE_SEMAPHORE_WAIT_INFO, |
| 783 | .pNext = nullptr, | 784 | .pNext = nullptr, |
| 784 | .flags = 0, | 785 | .flags = 0, |
| 785 | .semaphoreCount = 1, | 786 | .semaphoreCount = 1, |
| 786 | .pSemaphores = &handle, | 787 | .pSemaphores = &handle, |
| 787 | .pValues = &value, | 788 | .pValues = &value, |
| 788 | }; | 789 | }; |
| 789 | const VkResult result = dld->vkWaitSemaphoresKHR(owner, &wait_info, timeout); | 790 | const VkResult result = dld->vkWaitSemaphores(owner, &wait_info, timeout); |
| 790 | switch (result) { | 791 | switch (result) { |
| 791 | case VK_SUCCESS: | 792 | case VK_SUCCESS: |
| 792 | return true; | 793 | return true; |
| @@ -840,8 +841,8 @@ public: | |||
| 840 | 841 | ||
| 841 | CommandPool CreateCommandPool(const VkCommandPoolCreateInfo& ci) const; | 842 | CommandPool CreateCommandPool(const VkCommandPoolCreateInfo& ci) const; |
| 842 | 843 | ||
| 843 | DescriptorUpdateTemplateKHR CreateDescriptorUpdateTemplateKHR( | 844 | DescriptorUpdateTemplate CreateDescriptorUpdateTemplate( |
| 844 | const VkDescriptorUpdateTemplateCreateInfoKHR& ci) const; | 845 | const VkDescriptorUpdateTemplateCreateInfo& ci) const; |
| 845 | 846 | ||
| 846 | QueryPool CreateQueryPool(const VkQueryPoolCreateInfo& ci) const; | 847 | QueryPool CreateQueryPool(const VkQueryPoolCreateInfo& ci) const; |
| 847 | 848 | ||
| @@ -869,9 +870,9 @@ public: | |||
| 869 | void UpdateDescriptorSets(Span<VkWriteDescriptorSet> writes, | 870 | void UpdateDescriptorSets(Span<VkWriteDescriptorSet> writes, |
| 870 | Span<VkCopyDescriptorSet> copies) const noexcept; | 871 | Span<VkCopyDescriptorSet> copies) const noexcept; |
| 871 | 872 | ||
| 872 | void UpdateDescriptorSet(VkDescriptorSet set, VkDescriptorUpdateTemplateKHR update_template, | 873 | void UpdateDescriptorSet(VkDescriptorSet set, VkDescriptorUpdateTemplate update_template, |
| 873 | const void* data) const noexcept { | 874 | const void* data) const noexcept { |
| 874 | dld->vkUpdateDescriptorSetWithTemplateKHR(handle, set, update_template, data); | 875 | dld->vkUpdateDescriptorSetWithTemplate(handle, set, update_template, data); |
| 875 | } | 876 | } |
| 876 | 877 | ||
| 877 | VkResult AcquireNextImageKHR(VkSwapchainKHR swapchain, u64 timeout, VkSemaphore semaphore, | 878 | VkResult AcquireNextImageKHR(VkSwapchainKHR swapchain, u64 timeout, VkSemaphore semaphore, |
| @@ -884,8 +885,8 @@ public: | |||
| 884 | return dld->vkDeviceWaitIdle(handle); | 885 | return dld->vkDeviceWaitIdle(handle); |
| 885 | } | 886 | } |
| 886 | 887 | ||
| 887 | void ResetQueryPoolEXT(VkQueryPool query_pool, u32 first, u32 count) const noexcept { | 888 | void ResetQueryPool(VkQueryPool query_pool, u32 first, u32 count) const noexcept { |
| 888 | dld->vkResetQueryPoolEXT(handle, query_pool, first, count); | 889 | dld->vkResetQueryPool(handle, query_pool, first, count); |
| 889 | } | 890 | } |
| 890 | 891 | ||
| 891 | VkResult GetQueryResults(VkQueryPool query_pool, u32 first, u32 count, std::size_t data_size, | 892 | VkResult GetQueryResults(VkQueryPool query_pool, u32 first, u32 count, std::size_t data_size, |
| @@ -910,11 +911,11 @@ public: | |||
| 910 | 911 | ||
| 911 | VkPhysicalDeviceProperties GetProperties() const noexcept; | 912 | VkPhysicalDeviceProperties GetProperties() const noexcept; |
| 912 | 913 | ||
| 913 | void GetProperties2KHR(VkPhysicalDeviceProperties2KHR&) const noexcept; | 914 | void GetProperties2(VkPhysicalDeviceProperties2&) const noexcept; |
| 914 | 915 | ||
| 915 | VkPhysicalDeviceFeatures GetFeatures() const noexcept; | 916 | VkPhysicalDeviceFeatures GetFeatures() const noexcept; |
| 916 | 917 | ||
| 917 | void GetFeatures2KHR(VkPhysicalDeviceFeatures2KHR&) const noexcept; | 918 | void GetFeatures2(VkPhysicalDeviceFeatures2&) const noexcept; |
| 918 | 919 | ||
| 919 | VkFormatProperties GetFormatProperties(VkFormat) const noexcept; | 920 | VkFormatProperties GetFormatProperties(VkFormat) const noexcept; |
| 920 | 921 | ||
| @@ -922,6 +923,8 @@ public: | |||
| 922 | 923 | ||
| 923 | std::vector<VkQueueFamilyProperties> GetQueueFamilyProperties() const; | 924 | std::vector<VkQueueFamilyProperties> GetQueueFamilyProperties() const; |
| 924 | 925 | ||
| 926 | std::vector<VkPhysicalDeviceToolProperties> GetPhysicalDeviceToolProperties() const; | ||
| 927 | |||
| 925 | bool GetSurfaceSupportKHR(u32 queue_family_index, VkSurfaceKHR) const; | 928 | bool GetSurfaceSupportKHR(u32 queue_family_index, VkSurfaceKHR) const; |
| 926 | 929 | ||
| 927 | VkSurfaceCapabilitiesKHR GetSurfaceCapabilitiesKHR(VkSurfaceKHR) const; | 930 | VkSurfaceCapabilitiesKHR GetSurfaceCapabilitiesKHR(VkSurfaceKHR) const; |
| @@ -980,7 +983,7 @@ public: | |||
| 980 | dynamic_offsets.size(), dynamic_offsets.data()); | 983 | dynamic_offsets.size(), dynamic_offsets.data()); |
| 981 | } | 984 | } |
| 982 | 985 | ||
| 983 | void PushDescriptorSetWithTemplateKHR(VkDescriptorUpdateTemplateKHR update_template, | 986 | void PushDescriptorSetWithTemplateKHR(VkDescriptorUpdateTemplate update_template, |
| 984 | VkPipelineLayout layout, u32 set, | 987 | VkPipelineLayout layout, u32 set, |
| 985 | const void* data) const noexcept { | 988 | const void* data) const noexcept { |
| 986 | dld->vkCmdPushDescriptorSetWithTemplateKHR(handle, update_template, layout, set, data); | 989 | dld->vkCmdPushDescriptorSetWithTemplateKHR(handle, update_template, layout, set, data); |