diff options
| m--------- | externals/Vulkan-Headers | 0 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/maxwell_to_vk.cpp | 2 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/pipeline_helper.h | 2 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/renderer_vulkan.cpp | 4 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_compute_pipeline.cpp | 2 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp | 2 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_master_semaphore.cpp | 8 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_pipeline_cache.cpp | 18 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_scheduler.cpp | 4 | ||||
| -rw-r--r-- | src/video_core/vulkan_common/vulkan_device.cpp | 121 | ||||
| -rw-r--r-- | src/video_core/vulkan_common/vulkan_device.h | 2 | ||||
| -rw-r--r-- | src/video_core/vulkan_common/vulkan_wrapper.cpp | 31 | ||||
| -rw-r--r-- | src/video_core/vulkan_common/vulkan_wrapper.h | 11 |
13 files changed, 105 insertions, 102 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 16c57aef7..28b893e25 100644 --- a/src/video_core/renderer_vulkan/pipeline_helper.h +++ b/src/video_core/renderer_vulkan/pipeline_helper.h | |||
| @@ -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_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_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_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_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 2be9e2e52..13b5da341 100644 --- a/src/video_core/vulkan_common/vulkan_device.cpp +++ b/src/video_core/vulkan_common/vulkan_device.cpp | |||
| @@ -305,10 +305,10 @@ NvidiaArchitecture GetNvidiaArchitecture(vk::PhysicalDevice physical, | |||
| 305 | VkPhysicalDeviceFragmentShadingRatePropertiesKHR shading_rate_props{}; | 305 | VkPhysicalDeviceFragmentShadingRatePropertiesKHR shading_rate_props{}; |
| 306 | shading_rate_props.sType = | 306 | shading_rate_props.sType = |
| 307 | VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_PROPERTIES_KHR; | 307 | VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_PROPERTIES_KHR; |
| 308 | VkPhysicalDeviceProperties2KHR physical_properties{}; | 308 | VkPhysicalDeviceProperties2 physical_properties{}; |
| 309 | physical_properties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR; | 309 | physical_properties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2; |
| 310 | physical_properties.pNext = &shading_rate_props; | 310 | physical_properties.pNext = &shading_rate_props; |
| 311 | physical.GetProperties2KHR(physical_properties); | 311 | physical.GetProperties2(physical_properties); |
| 312 | if (shading_rate_props.primitiveFragmentShadingRateWithMultipleViewports) { | 312 | if (shading_rate_props.primitiveFragmentShadingRateWithMultipleViewports) { |
| 313 | // Only Ampere and newer support this feature | 313 | // Only Ampere and newer support this feature |
| 314 | return NvidiaArchitecture::AmpereOrNewer; | 314 | return NvidiaArchitecture::AmpereOrNewer; |
| @@ -416,8 +416,8 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR | |||
| 416 | }; | 416 | }; |
| 417 | SetNext(next, bit16_storage); | 417 | SetNext(next, bit16_storage); |
| 418 | 418 | ||
| 419 | VkPhysicalDevice8BitStorageFeaturesKHR bit8_storage{ | 419 | VkPhysicalDevice8BitStorageFeatures bit8_storage{ |
| 420 | .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES_KHR, | 420 | .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES, |
| 421 | .pNext = nullptr, | 421 | .pNext = nullptr, |
| 422 | .storageBuffer8BitAccess = false, | 422 | .storageBuffer8BitAccess = false, |
| 423 | .uniformAndStorageBuffer8BitAccess = true, | 423 | .uniformAndStorageBuffer8BitAccess = true, |
| @@ -441,8 +441,8 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR | |||
| 441 | }; | 441 | }; |
| 442 | SetNext(next, host_query_reset); | 442 | SetNext(next, host_query_reset); |
| 443 | 443 | ||
| 444 | VkPhysicalDeviceVariablePointerFeaturesKHR variable_pointers{ | 444 | VkPhysicalDeviceVariablePointerFeatures variable_pointers{ |
| 445 | .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES_KHR, | 445 | .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES, |
| 446 | .pNext = nullptr, | 446 | .pNext = nullptr, |
| 447 | .variablePointersStorageBuffer = VK_TRUE, | 447 | .variablePointersStorageBuffer = VK_TRUE, |
| 448 | .variablePointers = VK_TRUE, | 448 | .variablePointers = VK_TRUE, |
| @@ -456,10 +456,10 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR | |||
| 456 | }; | 456 | }; |
| 457 | SetNext(next, demote); | 457 | SetNext(next, demote); |
| 458 | 458 | ||
| 459 | VkPhysicalDeviceFloat16Int8FeaturesKHR float16_int8; | 459 | VkPhysicalDeviceShaderFloat16Int8Features float16_int8; |
| 460 | if (is_int8_supported || is_float16_supported) { | 460 | if (is_int8_supported || is_float16_supported) { |
| 461 | float16_int8 = { | 461 | float16_int8 = { |
| 462 | .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT16_INT8_FEATURES_KHR, | 462 | .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES, |
| 463 | .pNext = nullptr, | 463 | .pNext = nullptr, |
| 464 | .shaderFloat16 = is_float16_supported, | 464 | .shaderFloat16 = is_float16_supported, |
| 465 | .shaderInt8 = is_int8_supported, | 465 | .shaderInt8 = is_int8_supported, |
| @@ -485,10 +485,10 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR | |||
| 485 | LOG_INFO(Render_Vulkan, "Device doesn't support passthrough geometry shaders"); | 485 | LOG_INFO(Render_Vulkan, "Device doesn't support passthrough geometry shaders"); |
| 486 | } | 486 | } |
| 487 | 487 | ||
| 488 | VkPhysicalDeviceUniformBufferStandardLayoutFeaturesKHR std430_layout; | 488 | VkPhysicalDeviceUniformBufferStandardLayoutFeatures std430_layout; |
| 489 | if (khr_uniform_buffer_standard_layout) { | 489 | if (khr_uniform_buffer_standard_layout) { |
| 490 | std430_layout = { | 490 | std430_layout = { |
| 491 | .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES_KHR, | 491 | .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES, |
| 492 | .pNext = nullptr, | 492 | .pNext = nullptr, |
| 493 | .uniformBufferStandardLayout = true, | 493 | .uniformBufferStandardLayout = true, |
| 494 | }; | 494 | }; |
| @@ -606,10 +606,10 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR | |||
| 606 | LOG_INFO(Render_Vulkan, "Device doesn't support vertex input dynamic state"); | 606 | LOG_INFO(Render_Vulkan, "Device doesn't support vertex input dynamic state"); |
| 607 | } | 607 | } |
| 608 | 608 | ||
| 609 | VkPhysicalDeviceShaderAtomicInt64FeaturesKHR atomic_int64; | 609 | VkPhysicalDeviceShaderAtomicInt64Features atomic_int64; |
| 610 | if (ext_shader_atomic_int64) { | 610 | if (ext_shader_atomic_int64) { |
| 611 | atomic_int64 = { | 611 | atomic_int64 = { |
| 612 | .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES_KHR, | 612 | .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES, |
| 613 | .pNext = nullptr, | 613 | .pNext = nullptr, |
| 614 | .shaderBufferInt64Atomics = VK_TRUE, | 614 | .shaderBufferInt64Atomics = VK_TRUE, |
| 615 | .shaderSharedInt64Atomics = VK_TRUE, | 615 | .shaderSharedInt64Atomics = VK_TRUE, |
| @@ -965,8 +965,8 @@ void Device::CheckSuitability(bool requires_swapchain) const { | |||
| 965 | demote.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES; | 965 | demote.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES; |
| 966 | demote.pNext = nullptr; | 966 | demote.pNext = nullptr; |
| 967 | 967 | ||
| 968 | VkPhysicalDeviceVariablePointerFeaturesKHR variable_pointers{}; | 968 | VkPhysicalDeviceVariablePointerFeatures variable_pointers{}; |
| 969 | variable_pointers.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES_KHR; | 969 | variable_pointers.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES; |
| 970 | variable_pointers.pNext = &demote; | 970 | variable_pointers.pNext = &demote; |
| 971 | 971 | ||
| 972 | VkPhysicalDeviceRobustness2FeaturesEXT robustness2{}; | 972 | VkPhysicalDeviceRobustness2FeaturesEXT robustness2{}; |
| @@ -989,11 +989,11 @@ void Device::CheckSuitability(bool requires_swapchain) const { | |||
| 989 | host_query_reset.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES; | 989 | host_query_reset.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES; |
| 990 | host_query_reset.pNext = &bit8_storage; | 990 | host_query_reset.pNext = &bit8_storage; |
| 991 | 991 | ||
| 992 | VkPhysicalDeviceFeatures2KHR features2{}; | 992 | VkPhysicalDeviceFeatures2 features2{}; |
| 993 | features2.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2; | 993 | features2.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2; |
| 994 | features2.pNext = &host_query_reset; | 994 | features2.pNext = &host_query_reset; |
| 995 | 995 | ||
| 996 | physical.GetFeatures2KHR(features2); | 996 | physical.GetFeatures2(features2); |
| 997 | 997 | ||
| 998 | const VkPhysicalDeviceFeatures& features{features2.features}; | 998 | const VkPhysicalDeviceFeatures& features{features2.features}; |
| 999 | std::array feature_report{ | 999 | std::array feature_report{ |
| @@ -1126,37 +1126,37 @@ std::vector<const char*> Device::LoadExtensions(bool requires_surface) { | |||
| 1126 | VK_KHR_PIPELINE_EXECUTABLE_PROPERTIES_EXTENSION_NAME, false); | 1126 | VK_KHR_PIPELINE_EXECUTABLE_PROPERTIES_EXTENSION_NAME, false); |
| 1127 | } | 1127 | } |
| 1128 | } | 1128 | } |
| 1129 | VkPhysicalDeviceFeatures2KHR features{}; | 1129 | VkPhysicalDeviceFeatures2 features{}; |
| 1130 | features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR; | 1130 | features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2; |
| 1131 | 1131 | ||
| 1132 | VkPhysicalDeviceProperties2KHR physical_properties{}; | 1132 | VkPhysicalDeviceProperties2 physical_properties{}; |
| 1133 | physical_properties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR; | 1133 | physical_properties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2; |
| 1134 | 1134 | ||
| 1135 | if (has_khr_shader_float16_int8) { | 1135 | if (has_khr_shader_float16_int8) { |
| 1136 | VkPhysicalDeviceFloat16Int8FeaturesKHR float16_int8_features; | 1136 | VkPhysicalDeviceShaderFloat16Int8Features float16_int8_features; |
| 1137 | float16_int8_features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT16_INT8_FEATURES_KHR; | 1137 | float16_int8_features.sType = |
| 1138 | VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES; | ||
| 1138 | float16_int8_features.pNext = nullptr; | 1139 | float16_int8_features.pNext = nullptr; |
| 1139 | features.pNext = &float16_int8_features; | 1140 | features.pNext = &float16_int8_features; |
| 1140 | 1141 | ||
| 1141 | physical.GetFeatures2KHR(features); | 1142 | physical.GetFeatures2(features); |
| 1142 | is_float16_supported = float16_int8_features.shaderFloat16; | 1143 | is_float16_supported = float16_int8_features.shaderFloat16; |
| 1143 | is_int8_supported = float16_int8_features.shaderInt8; | 1144 | is_int8_supported = float16_int8_features.shaderInt8; |
| 1144 | extensions.push_back(VK_KHR_SHADER_FLOAT16_INT8_EXTENSION_NAME); | 1145 | extensions.push_back(VK_KHR_SHADER_FLOAT16_INT8_EXTENSION_NAME); |
| 1145 | } | 1146 | } |
| 1146 | if (has_ext_subgroup_size_control) { | 1147 | if (has_ext_subgroup_size_control) { |
| 1147 | VkPhysicalDeviceSubgroupSizeControlFeaturesEXT subgroup_features; | 1148 | VkPhysicalDeviceSubgroupSizeControlFeatures subgroup_features; |
| 1148 | subgroup_features.sType = | 1149 | subgroup_features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES; |
| 1149 | VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES_EXT; | ||
| 1150 | subgroup_features.pNext = nullptr; | 1150 | subgroup_features.pNext = nullptr; |
| 1151 | features.pNext = &subgroup_features; | 1151 | features.pNext = &subgroup_features; |
| 1152 | physical.GetFeatures2KHR(features); | 1152 | physical.GetFeatures2(features); |
| 1153 | 1153 | ||
| 1154 | VkPhysicalDeviceSubgroupSizeControlPropertiesEXT subgroup_properties; | 1154 | VkPhysicalDeviceSubgroupSizeControlProperties subgroup_properties; |
| 1155 | subgroup_properties.sType = | 1155 | subgroup_properties.sType = |
| 1156 | VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES_EXT; | 1156 | VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES; |
| 1157 | subgroup_properties.pNext = nullptr; | 1157 | subgroup_properties.pNext = nullptr; |
| 1158 | physical_properties.pNext = &subgroup_properties; | 1158 | physical_properties.pNext = &subgroup_properties; |
| 1159 | physical.GetProperties2KHR(physical_properties); | 1159 | physical.GetProperties2(physical_properties); |
| 1160 | 1160 | ||
| 1161 | is_warp_potentially_bigger = subgroup_properties.maxSubgroupSize > GuestWarpSize; | 1161 | is_warp_potentially_bigger = subgroup_properties.maxSubgroupSize > GuestWarpSize; |
| 1162 | 1162 | ||
| @@ -1175,7 +1175,7 @@ std::vector<const char*> Device::LoadExtensions(bool requires_surface) { | |||
| 1175 | provoking_vertex.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_FEATURES_EXT; | 1175 | provoking_vertex.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_FEATURES_EXT; |
| 1176 | provoking_vertex.pNext = nullptr; | 1176 | provoking_vertex.pNext = nullptr; |
| 1177 | features.pNext = &provoking_vertex; | 1177 | features.pNext = &provoking_vertex; |
| 1178 | physical.GetFeatures2KHR(features); | 1178 | physical.GetFeatures2(features); |
| 1179 | 1179 | ||
| 1180 | if (provoking_vertex.provokingVertexLast && | 1180 | if (provoking_vertex.provokingVertexLast && |
| 1181 | provoking_vertex.transformFeedbackPreservesProvokingVertex) { | 1181 | provoking_vertex.transformFeedbackPreservesProvokingVertex) { |
| @@ -1189,7 +1189,7 @@ std::vector<const char*> Device::LoadExtensions(bool requires_surface) { | |||
| 1189 | VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT; | 1189 | VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT; |
| 1190 | vertex_input.pNext = nullptr; | 1190 | vertex_input.pNext = nullptr; |
| 1191 | features.pNext = &vertex_input; | 1191 | features.pNext = &vertex_input; |
| 1192 | physical.GetFeatures2KHR(features); | 1192 | physical.GetFeatures2(features); |
| 1193 | 1193 | ||
| 1194 | if (vertex_input.vertexInputDynamicState) { | 1194 | if (vertex_input.vertexInputDynamicState) { |
| 1195 | extensions.push_back(VK_EXT_VERTEX_INPUT_DYNAMIC_STATE_EXTENSION_NAME); | 1195 | extensions.push_back(VK_EXT_VERTEX_INPUT_DYNAMIC_STATE_EXTENSION_NAME); |
| @@ -1201,7 +1201,7 @@ std::vector<const char*> Device::LoadExtensions(bool requires_surface) { | |||
| 1201 | atomic_int64.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES; | 1201 | atomic_int64.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES; |
| 1202 | atomic_int64.pNext = nullptr; | 1202 | atomic_int64.pNext = nullptr; |
| 1203 | features.pNext = &atomic_int64; | 1203 | features.pNext = &atomic_int64; |
| 1204 | physical.GetFeatures2KHR(features); | 1204 | physical.GetFeatures2(features); |
| 1205 | 1205 | ||
| 1206 | if (atomic_int64.shaderBufferInt64Atomics && atomic_int64.shaderSharedInt64Atomics) { | 1206 | if (atomic_int64.shaderBufferInt64Atomics && atomic_int64.shaderSharedInt64Atomics) { |
| 1207 | extensions.push_back(VK_KHR_SHADER_ATOMIC_INT64_EXTENSION_NAME); | 1207 | extensions.push_back(VK_KHR_SHADER_ATOMIC_INT64_EXTENSION_NAME); |
| @@ -1213,13 +1213,13 @@ std::vector<const char*> Device::LoadExtensions(bool requires_surface) { | |||
| 1213 | tfb_features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT; | 1213 | tfb_features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT; |
| 1214 | tfb_features.pNext = nullptr; | 1214 | tfb_features.pNext = nullptr; |
| 1215 | features.pNext = &tfb_features; | 1215 | features.pNext = &tfb_features; |
| 1216 | physical.GetFeatures2KHR(features); | 1216 | physical.GetFeatures2(features); |
| 1217 | 1217 | ||
| 1218 | VkPhysicalDeviceTransformFeedbackPropertiesEXT tfb_properties; | 1218 | VkPhysicalDeviceTransformFeedbackPropertiesEXT tfb_properties; |
| 1219 | tfb_properties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_PROPERTIES_EXT; | 1219 | tfb_properties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_PROPERTIES_EXT; |
| 1220 | tfb_properties.pNext = nullptr; | 1220 | tfb_properties.pNext = nullptr; |
| 1221 | physical_properties.pNext = &tfb_properties; | 1221 | physical_properties.pNext = &tfb_properties; |
| 1222 | physical.GetProperties2KHR(physical_properties); | 1222 | physical.GetProperties2(physical_properties); |
| 1223 | 1223 | ||
| 1224 | if (tfb_features.transformFeedback && tfb_features.geometryStreams && | 1224 | if (tfb_features.transformFeedback && tfb_features.geometryStreams && |
| 1225 | tfb_properties.maxTransformFeedbackStreams >= 4 && | 1225 | tfb_properties.maxTransformFeedbackStreams >= 4 && |
| @@ -1234,7 +1234,7 @@ std::vector<const char*> Device::LoadExtensions(bool requires_surface) { | |||
| 1234 | border_features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_FEATURES_EXT; | 1234 | border_features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_FEATURES_EXT; |
| 1235 | border_features.pNext = nullptr; | 1235 | border_features.pNext = nullptr; |
| 1236 | features.pNext = &border_features; | 1236 | features.pNext = &border_features; |
| 1237 | physical.GetFeatures2KHR(features); | 1237 | physical.GetFeatures2(features); |
| 1238 | 1238 | ||
| 1239 | if (border_features.customBorderColors && border_features.customBorderColorWithoutFormat) { | 1239 | if (border_features.customBorderColors && border_features.customBorderColorWithoutFormat) { |
| 1240 | extensions.push_back(VK_EXT_CUSTOM_BORDER_COLOR_EXTENSION_NAME); | 1240 | extensions.push_back(VK_EXT_CUSTOM_BORDER_COLOR_EXTENSION_NAME); |
| @@ -1247,7 +1247,7 @@ std::vector<const char*> Device::LoadExtensions(bool requires_surface) { | |||
| 1247 | VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_FEATURES_EXT; | 1247 | VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_FEATURES_EXT; |
| 1248 | extended_dynamic_state.pNext = nullptr; | 1248 | extended_dynamic_state.pNext = nullptr; |
| 1249 | features.pNext = &extended_dynamic_state; | 1249 | features.pNext = &extended_dynamic_state; |
| 1250 | physical.GetFeatures2KHR(features); | 1250 | physical.GetFeatures2(features); |
| 1251 | 1251 | ||
| 1252 | if (extended_dynamic_state.extendedDynamicState) { | 1252 | if (extended_dynamic_state.extendedDynamicState) { |
| 1253 | extensions.push_back(VK_EXT_EXTENDED_DYNAMIC_STATE_EXTENSION_NAME); | 1253 | extensions.push_back(VK_EXT_EXTENDED_DYNAMIC_STATE_EXTENSION_NAME); |
| @@ -1259,7 +1259,7 @@ std::vector<const char*> Device::LoadExtensions(bool requires_surface) { | |||
| 1259 | line_raster.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_EXT; | 1259 | line_raster.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_EXT; |
| 1260 | line_raster.pNext = nullptr; | 1260 | line_raster.pNext = nullptr; |
| 1261 | features.pNext = &line_raster; | 1261 | features.pNext = &line_raster; |
| 1262 | physical.GetFeatures2KHR(features); | 1262 | physical.GetFeatures2(features); |
| 1263 | if (line_raster.rectangularLines && line_raster.smoothLines) { | 1263 | if (line_raster.rectangularLines && line_raster.smoothLines) { |
| 1264 | extensions.push_back(VK_EXT_LINE_RASTERIZATION_EXTENSION_NAME); | 1264 | extensions.push_back(VK_EXT_LINE_RASTERIZATION_EXTENSION_NAME); |
| 1265 | ext_line_rasterization = true; | 1265 | ext_line_rasterization = true; |
| @@ -1271,7 +1271,7 @@ std::vector<const char*> Device::LoadExtensions(bool requires_surface) { | |||
| 1271 | VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_FEATURES_KHR; | 1271 | VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_FEATURES_KHR; |
| 1272 | layout.pNext = nullptr; | 1272 | layout.pNext = nullptr; |
| 1273 | features.pNext = &layout; | 1273 | features.pNext = &layout; |
| 1274 | physical.GetFeatures2KHR(features); | 1274 | physical.GetFeatures2(features); |
| 1275 | 1275 | ||
| 1276 | if (layout.workgroupMemoryExplicitLayout && | 1276 | if (layout.workgroupMemoryExplicitLayout && |
| 1277 | layout.workgroupMemoryExplicitLayout8BitAccess && | 1277 | layout.workgroupMemoryExplicitLayout8BitAccess && |
| @@ -1287,7 +1287,7 @@ std::vector<const char*> Device::LoadExtensions(bool requires_surface) { | |||
| 1287 | VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_EXECUTABLE_PROPERTIES_FEATURES_KHR; | 1287 | VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_EXECUTABLE_PROPERTIES_FEATURES_KHR; |
| 1288 | executable_properties.pNext = nullptr; | 1288 | executable_properties.pNext = nullptr; |
| 1289 | features.pNext = &executable_properties; | 1289 | features.pNext = &executable_properties; |
| 1290 | physical.GetFeatures2KHR(features); | 1290 | physical.GetFeatures2(features); |
| 1291 | 1291 | ||
| 1292 | if (executable_properties.pipelineExecutableInfo) { | 1292 | if (executable_properties.pipelineExecutableInfo) { |
| 1293 | extensions.push_back(VK_KHR_PIPELINE_EXECUTABLE_PROPERTIES_EXTENSION_NAME); | 1293 | extensions.push_back(VK_KHR_PIPELINE_EXECUTABLE_PROPERTIES_EXTENSION_NAME); |
| @@ -1300,7 +1300,7 @@ std::vector<const char*> Device::LoadExtensions(bool requires_surface) { | |||
| 1300 | VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVE_TOPOLOGY_LIST_RESTART_FEATURES_EXT; | 1300 | VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVE_TOPOLOGY_LIST_RESTART_FEATURES_EXT; |
| 1301 | primitive_topology_list_restart.pNext = nullptr; | 1301 | primitive_topology_list_restart.pNext = nullptr; |
| 1302 | features.pNext = &primitive_topology_list_restart; | 1302 | features.pNext = &primitive_topology_list_restart; |
| 1303 | physical.GetFeatures2KHR(features); | 1303 | physical.GetFeatures2(features); |
| 1304 | 1304 | ||
| 1305 | is_topology_list_restart_supported = | 1305 | is_topology_list_restart_supported = |
| 1306 | primitive_topology_list_restart.primitiveTopologyListRestart; | 1306 | primitive_topology_list_restart.primitiveTopologyListRestart; |
| @@ -1318,7 +1318,7 @@ std::vector<const char*> Device::LoadExtensions(bool requires_surface) { | |||
| 1318 | push_descriptor.pNext = nullptr; | 1318 | push_descriptor.pNext = nullptr; |
| 1319 | 1319 | ||
| 1320 | physical_properties.pNext = &push_descriptor; | 1320 | physical_properties.pNext = &push_descriptor; |
| 1321 | physical.GetProperties2KHR(physical_properties); | 1321 | physical.GetProperties2(physical_properties); |
| 1322 | 1322 | ||
| 1323 | max_push_descriptors = push_descriptor.maxPushDescriptors; | 1323 | max_push_descriptors = push_descriptor.maxPushDescriptors; |
| 1324 | } | 1324 | } |
| @@ -1369,18 +1369,18 @@ void Device::SetupFeatures() { | |||
| 1369 | } | 1369 | } |
| 1370 | 1370 | ||
| 1371 | void Device::SetupProperties() { | 1371 | void Device::SetupProperties() { |
| 1372 | float_controls.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES_KHR; | 1372 | float_controls.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES; |
| 1373 | 1373 | ||
| 1374 | VkPhysicalDeviceProperties2KHR properties2{}; | 1374 | VkPhysicalDeviceProperties2KHR properties2{}; |
| 1375 | properties2.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR; | 1375 | properties2.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2; |
| 1376 | properties2.pNext = &float_controls; | 1376 | properties2.pNext = &float_controls; |
| 1377 | 1377 | ||
| 1378 | physical.GetProperties2KHR(properties2); | 1378 | physical.GetProperties2(properties2); |
| 1379 | } | 1379 | } |
| 1380 | 1380 | ||
| 1381 | void Device::CollectTelemetryParameters() { | 1381 | void Device::CollectTelemetryParameters() { |
| 1382 | VkPhysicalDeviceDriverPropertiesKHR driver{ | 1382 | VkPhysicalDeviceDriverProperties driver{ |
| 1383 | .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES_KHR, | 1383 | .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES, |
| 1384 | .pNext = nullptr, | 1384 | .pNext = nullptr, |
| 1385 | .driverID = {}, | 1385 | .driverID = {}, |
| 1386 | .driverName = {}, | 1386 | .driverName = {}, |
| @@ -1388,12 +1388,12 @@ void Device::CollectTelemetryParameters() { | |||
| 1388 | .conformanceVersion = {}, | 1388 | .conformanceVersion = {}, |
| 1389 | }; | 1389 | }; |
| 1390 | 1390 | ||
| 1391 | VkPhysicalDeviceProperties2KHR device_properties{ | 1391 | VkPhysicalDeviceProperties2 device_properties{ |
| 1392 | .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR, | 1392 | .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2, |
| 1393 | .pNext = &driver, | 1393 | .pNext = &driver, |
| 1394 | .properties = {}, | 1394 | .properties = {}, |
| 1395 | }; | 1395 | }; |
| 1396 | physical.GetProperties2KHR(device_properties); | 1396 | physical.GetProperties2(device_properties); |
| 1397 | 1397 | ||
| 1398 | driver_id = driver.driverID; | 1398 | driver_id = driver.driverID; |
| 1399 | vendor_name = driver.driverName; | 1399 | vendor_name = driver.driverName; |
| @@ -1449,23 +1449,10 @@ void Device::CollectToolingInfo() { | |||
| 1449 | if (!ext_tooling_info) { | 1449 | if (!ext_tooling_info) { |
| 1450 | return; | 1450 | return; |
| 1451 | } | 1451 | } |
| 1452 | const auto vkGetPhysicalDeviceToolPropertiesEXT = | 1452 | auto tools{physical.GetPhysicalDeviceToolProperties()}; |
| 1453 | reinterpret_cast<PFN_vkGetPhysicalDeviceToolPropertiesEXT>( | 1453 | for (const VkPhysicalDeviceToolProperties& tool : tools) { |
| 1454 | dld.vkGetInstanceProcAddr(instance, "vkGetPhysicalDeviceToolPropertiesEXT")); | ||
| 1455 | if (!vkGetPhysicalDeviceToolPropertiesEXT) { | ||
| 1456 | return; | ||
| 1457 | } | ||
| 1458 | u32 tool_count = 0; | ||
| 1459 | if (vkGetPhysicalDeviceToolPropertiesEXT(physical, &tool_count, nullptr) != VK_SUCCESS) { | ||
| 1460 | return; | ||
| 1461 | } | ||
| 1462 | std::vector<VkPhysicalDeviceToolPropertiesEXT> tools(tool_count); | ||
| 1463 | if (vkGetPhysicalDeviceToolPropertiesEXT(physical, &tool_count, tools.data()) != VK_SUCCESS) { | ||
| 1464 | return; | ||
| 1465 | } | ||
| 1466 | for (const VkPhysicalDeviceToolPropertiesEXT& tool : tools) { | ||
| 1467 | const std::string_view name = tool.name; | 1454 | const std::string_view name = tool.name; |
| 1468 | LOG_INFO(Render_Vulkan, "{}", name); | 1455 | LOG_INFO(Render_Vulkan, "Attached debugging tool: {}", name); |
| 1469 | has_renderdoc = has_renderdoc || name == "RenderDoc"; | 1456 | has_renderdoc = has_renderdoc || name == "RenderDoc"; |
| 1470 | has_nsight_graphics = has_nsight_graphics || name == "NVIDIA Nsight Graphics"; | 1457 | has_nsight_graphics = has_nsight_graphics || name == "NVIDIA Nsight Graphics"; |
| 1471 | } | 1458 | } |
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 143fe7652..e4a07813f 100644 --- a/src/video_core/vulkan_common/vulkan_wrapper.cpp +++ b/src/video_core/vulkan_common/vulkan_wrapper.cpp | |||
| @@ -235,12 +235,13 @@ bool Load(VkInstance instance, InstanceDispatch& dld) noexcept { | |||
| 235 | X(vkCreateDebugUtilsMessengerEXT); | 235 | X(vkCreateDebugUtilsMessengerEXT); |
| 236 | X(vkDestroyDebugUtilsMessengerEXT); | 236 | X(vkDestroyDebugUtilsMessengerEXT); |
| 237 | X(vkDestroySurfaceKHR); | 237 | X(vkDestroySurfaceKHR); |
| 238 | X(vkGetPhysicalDeviceFeatures2KHR); | 238 | X(vkGetPhysicalDeviceFeatures2); |
| 239 | X(vkGetPhysicalDeviceProperties2KHR); | 239 | X(vkGetPhysicalDeviceProperties2); |
| 240 | X(vkGetPhysicalDeviceSurfaceCapabilitiesKHR); | 240 | X(vkGetPhysicalDeviceSurfaceCapabilitiesKHR); |
| 241 | X(vkGetPhysicalDeviceSurfaceFormatsKHR); | 241 | X(vkGetPhysicalDeviceSurfaceFormatsKHR); |
| 242 | X(vkGetPhysicalDeviceSurfacePresentModesKHR); | 242 | X(vkGetPhysicalDeviceSurfacePresentModesKHR); |
| 243 | X(vkGetPhysicalDeviceSurfaceSupportKHR); | 243 | X(vkGetPhysicalDeviceSurfaceSupportKHR); |
| 244 | X(vkGetPhysicalDeviceToolProperties); | ||
| 244 | X(vkGetSwapchainImagesKHR); | 245 | X(vkGetSwapchainImagesKHR); |
| 245 | X(vkQueuePresentKHR); | 246 | X(vkQueuePresentKHR); |
| 246 | 247 | ||
| @@ -868,20 +869,20 @@ VkPhysicalDeviceProperties PhysicalDevice::GetProperties() const noexcept { | |||
| 868 | return properties; | 869 | return properties; |
| 869 | } | 870 | } |
| 870 | 871 | ||
| 871 | void PhysicalDevice::GetProperties2KHR(VkPhysicalDeviceProperties2KHR& properties) const noexcept { | 872 | void PhysicalDevice::GetProperties2(VkPhysicalDeviceProperties2& properties) const noexcept { |
| 872 | dld->vkGetPhysicalDeviceProperties2KHR(physical_device, &properties); | 873 | dld->vkGetPhysicalDeviceProperties2(physical_device, &properties); |
| 873 | } | 874 | } |
| 874 | 875 | ||
| 875 | VkPhysicalDeviceFeatures PhysicalDevice::GetFeatures() const noexcept { | 876 | VkPhysicalDeviceFeatures PhysicalDevice::GetFeatures() const noexcept { |
| 876 | VkPhysicalDeviceFeatures2KHR features2; | 877 | VkPhysicalDeviceFeatures2 features2; |
| 877 | features2.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR; | 878 | features2.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2; |
| 878 | features2.pNext = nullptr; | 879 | features2.pNext = nullptr; |
| 879 | dld->vkGetPhysicalDeviceFeatures2KHR(physical_device, &features2); | 880 | dld->vkGetPhysicalDeviceFeatures2(physical_device, &features2); |
| 880 | return features2.features; | 881 | return features2.features; |
| 881 | } | 882 | } |
| 882 | 883 | ||
| 883 | void PhysicalDevice::GetFeatures2KHR(VkPhysicalDeviceFeatures2KHR& features) const noexcept { | 884 | void PhysicalDevice::GetFeatures2(VkPhysicalDeviceFeatures2& features) const noexcept { |
| 884 | dld->vkGetPhysicalDeviceFeatures2KHR(physical_device, &features); | 885 | dld->vkGetPhysicalDeviceFeatures2(physical_device, &features); |
| 885 | } | 886 | } |
| 886 | 887 | ||
| 887 | VkFormatProperties PhysicalDevice::GetFormatProperties(VkFormat format) const noexcept { | 888 | VkFormatProperties PhysicalDevice::GetFormatProperties(VkFormat format) const noexcept { |
| @@ -906,6 +907,18 @@ std::vector<VkQueueFamilyProperties> PhysicalDevice::GetQueueFamilyProperties() | |||
| 906 | return properties; | 907 | return properties; |
| 907 | } | 908 | } |
| 908 | 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 | |||
| 909 | bool PhysicalDevice::GetSurfaceSupportKHR(u32 queue_family_index, VkSurfaceKHR surface) const { | 922 | bool PhysicalDevice::GetSurfaceSupportKHR(u32 queue_family_index, VkSurfaceKHR surface) const { |
| 910 | VkBool32 supported; | 923 | VkBool32 supported; |
| 911 | 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 9997420dd..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{}; |
| @@ -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; |