diff options
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_pipeline_cache.cpp | 5 | ||||
| -rw-r--r-- | src/video_core/vulkan_common/vulkan_device.cpp | 3 | ||||
| -rw-r--r-- | src/video_core/vulkan_common/vulkan_device.h | 23 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_graphics.cpp | 2 | ||||
| -rw-r--r-- | src/yuzu/vk_device_info.cpp | 13 | ||||
| -rw-r--r-- | src/yuzu/vk_device_info.h | 4 |
6 files changed, 38 insertions, 12 deletions
diff --git a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp index 18e040a1b..a2cfb2105 100644 --- a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp | |||
| @@ -705,10 +705,7 @@ std::unique_ptr<ComputePipeline> PipelineCache::CreateComputePipeline( | |||
| 705 | std::unique_ptr<ComputePipeline> PipelineCache::CreateComputePipeline( | 705 | std::unique_ptr<ComputePipeline> PipelineCache::CreateComputePipeline( |
| 706 | ShaderPools& pools, const ComputePipelineCacheKey& key, Shader::Environment& env, | 706 | ShaderPools& pools, const ComputePipelineCacheKey& key, Shader::Environment& env, |
| 707 | PipelineStatistics* statistics, bool build_in_parallel) try { | 707 | PipelineStatistics* statistics, bool build_in_parallel) try { |
| 708 | // TODO: Remove this when Intel fixes their shader compiler. | 708 | if (device.HasBrokenCompute()) { |
| 709 | // https://github.com/IGCIT/Intel-GPU-Community-Issue-Tracker-IGCIT/issues/159 | ||
| 710 | if (device.GetDriverID() == VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS && | ||
| 711 | !Settings::values.enable_compute_pipelines.GetValue()) { | ||
| 712 | LOG_ERROR(Render_Vulkan, "Skipping 0x{:016x}", key.Hash()); | 709 | LOG_ERROR(Render_Vulkan, "Skipping 0x{:016x}", key.Hash()); |
| 713 | return nullptr; | 710 | return nullptr; |
| 714 | } | 711 | } |
diff --git a/src/video_core/vulkan_common/vulkan_device.cpp b/src/video_core/vulkan_common/vulkan_device.cpp index dcedf4425..fa9cde75b 100644 --- a/src/video_core/vulkan_common/vulkan_device.cpp +++ b/src/video_core/vulkan_common/vulkan_device.cpp | |||
| @@ -562,6 +562,9 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR | |||
| 562 | LOG_WARNING(Render_Vulkan, "Intel proprietary drivers do not support MSAA image blits"); | 562 | LOG_WARNING(Render_Vulkan, "Intel proprietary drivers do not support MSAA image blits"); |
| 563 | cant_blit_msaa = true; | 563 | cant_blit_msaa = true; |
| 564 | } | 564 | } |
| 565 | has_broken_compute = | ||
| 566 | CheckBrokenCompute(properties.driver.driverID, properties.properties.driverVersion) && | ||
| 567 | !Settings::values.enable_compute_pipelines.GetValue(); | ||
| 565 | if (is_intel_anv || (is_qualcomm && !is_s8gen2)) { | 568 | if (is_intel_anv || (is_qualcomm && !is_s8gen2)) { |
| 566 | LOG_WARNING(Render_Vulkan, "Driver does not support native BGR format"); | 569 | LOG_WARNING(Render_Vulkan, "Driver does not support native BGR format"); |
| 567 | must_emulate_bgr565 = true; | 570 | must_emulate_bgr565 = true; |
diff --git a/src/video_core/vulkan_common/vulkan_device.h b/src/video_core/vulkan_common/vulkan_device.h index 8c7e44fcb..0b634a876 100644 --- a/src/video_core/vulkan_common/vulkan_device.h +++ b/src/video_core/vulkan_common/vulkan_device.h | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | #include <vector> | 10 | #include <vector> |
| 11 | 11 | ||
| 12 | #include "common/common_types.h" | 12 | #include "common/common_types.h" |
| 13 | #include "common/logging/log.h" | ||
| 13 | #include "common/settings.h" | 14 | #include "common/settings.h" |
| 14 | #include "video_core/vulkan_common/vulkan_wrapper.h" | 15 | #include "video_core/vulkan_common/vulkan_wrapper.h" |
| 15 | 16 | ||
| @@ -518,6 +519,11 @@ public: | |||
| 518 | return has_renderdoc || has_nsight_graphics || Settings::values.renderer_debug.GetValue(); | 519 | return has_renderdoc || has_nsight_graphics || Settings::values.renderer_debug.GetValue(); |
| 519 | } | 520 | } |
| 520 | 521 | ||
| 522 | /// @returns True if compute pipelines can cause crashing. | ||
| 523 | bool HasBrokenCompute() const { | ||
| 524 | return has_broken_compute; | ||
| 525 | } | ||
| 526 | |||
| 521 | /// Returns true when the device does not properly support cube compatibility. | 527 | /// Returns true when the device does not properly support cube compatibility. |
| 522 | bool HasBrokenCubeImageCompability() const { | 528 | bool HasBrokenCubeImageCompability() const { |
| 523 | return has_broken_cube_compatibility; | 529 | return has_broken_cube_compatibility; |
| @@ -579,6 +585,22 @@ public: | |||
| 579 | return supports_conditional_barriers; | 585 | return supports_conditional_barriers; |
| 580 | } | 586 | } |
| 581 | 587 | ||
| 588 | [[nodiscard]] static constexpr bool CheckBrokenCompute(VkDriverId driver_id, | ||
| 589 | u32 driver_version) { | ||
| 590 | if (driver_id == VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS) { | ||
| 591 | const u32 major = VK_API_VERSION_MAJOR(driver_version); | ||
| 592 | const u32 minor = VK_API_VERSION_MINOR(driver_version); | ||
| 593 | const u32 patch = VK_API_VERSION_PATCH(driver_version); | ||
| 594 | if (major == 0 && minor == 405 && patch < 286) { | ||
| 595 | LOG_WARNING( | ||
| 596 | Render_Vulkan, | ||
| 597 | "Intel proprietary drivers 0.405.0 until 0.405.286 have broken compute"); | ||
| 598 | return true; | ||
| 599 | } | ||
| 600 | } | ||
| 601 | return false; | ||
| 602 | } | ||
| 603 | |||
| 582 | private: | 604 | private: |
| 583 | /// Checks if the physical device is suitable and configures the object state | 605 | /// Checks if the physical device is suitable and configures the object state |
| 584 | /// with all necessary info about its properties. | 606 | /// with all necessary info about its properties. |
| @@ -672,6 +694,7 @@ private: | |||
| 672 | bool is_integrated{}; ///< Is GPU an iGPU. | 694 | bool is_integrated{}; ///< Is GPU an iGPU. |
| 673 | bool is_virtual{}; ///< Is GPU a virtual GPU. | 695 | bool is_virtual{}; ///< Is GPU a virtual GPU. |
| 674 | bool is_non_gpu{}; ///< Is SoftwareRasterizer, FPGA, non-GPU device. | 696 | bool is_non_gpu{}; ///< Is SoftwareRasterizer, FPGA, non-GPU device. |
| 697 | bool has_broken_compute{}; ///< Compute shaders can cause crashes | ||
| 675 | bool has_broken_cube_compatibility{}; ///< Has broken cube compatibility bit | 698 | bool has_broken_cube_compatibility{}; ///< Has broken cube compatibility bit |
| 676 | bool has_renderdoc{}; ///< Has RenderDoc attached | 699 | bool has_renderdoc{}; ///< Has RenderDoc attached |
| 677 | bool has_nsight_graphics{}; ///< Has Nsight Graphics attached | 700 | bool has_nsight_graphics{}; ///< Has Nsight Graphics attached |
diff --git a/src/yuzu/configuration/configure_graphics.cpp b/src/yuzu/configuration/configure_graphics.cpp index 78b487494..a4965524a 100644 --- a/src/yuzu/configuration/configure_graphics.cpp +++ b/src/yuzu/configuration/configure_graphics.cpp | |||
| @@ -508,7 +508,7 @@ void ConfigureGraphics::RetrieveVulkanDevices() { | |||
| 508 | vulkan_devices.push_back(QString::fromStdString(record.name)); | 508 | vulkan_devices.push_back(QString::fromStdString(record.name)); |
| 509 | device_present_modes.push_back(record.vsync_support); | 509 | device_present_modes.push_back(record.vsync_support); |
| 510 | 510 | ||
| 511 | if (record.is_intel_proprietary) { | 511 | if (record.has_broken_compute) { |
| 512 | expose_compute_option(); | 512 | expose_compute_option(); |
| 513 | } | 513 | } |
| 514 | } | 514 | } |
diff --git a/src/yuzu/vk_device_info.cpp b/src/yuzu/vk_device_info.cpp index 9bd1ec686..7c26a3dc7 100644 --- a/src/yuzu/vk_device_info.cpp +++ b/src/yuzu/vk_device_info.cpp | |||
| @@ -5,10 +5,12 @@ | |||
| 5 | #include <vector> | 5 | #include <vector> |
| 6 | #include "common/dynamic_library.h" | 6 | #include "common/dynamic_library.h" |
| 7 | #include "common/logging/log.h" | 7 | #include "common/logging/log.h" |
| 8 | #include "video_core/vulkan_common/vulkan_device.h" | ||
| 8 | #include "video_core/vulkan_common/vulkan_instance.h" | 9 | #include "video_core/vulkan_common/vulkan_instance.h" |
| 9 | #include "video_core/vulkan_common/vulkan_library.h" | 10 | #include "video_core/vulkan_common/vulkan_library.h" |
| 10 | #include "video_core/vulkan_common/vulkan_surface.h" | 11 | #include "video_core/vulkan_common/vulkan_surface.h" |
| 11 | #include "video_core/vulkan_common/vulkan_wrapper.h" | 12 | #include "video_core/vulkan_common/vulkan_wrapper.h" |
| 13 | #include "vulkan/vulkan_core.h" | ||
| 12 | #include "yuzu/qt_common.h" | 14 | #include "yuzu/qt_common.h" |
| 13 | #include "yuzu/vk_device_info.h" | 15 | #include "yuzu/vk_device_info.h" |
| 14 | 16 | ||
| @@ -16,8 +18,8 @@ class QWindow; | |||
| 16 | 18 | ||
| 17 | namespace VkDeviceInfo { | 19 | namespace VkDeviceInfo { |
| 18 | Record::Record(std::string_view name_, const std::vector<VkPresentModeKHR>& vsync_modes_, | 20 | Record::Record(std::string_view name_, const std::vector<VkPresentModeKHR>& vsync_modes_, |
| 19 | bool is_intel_proprietary_) | 21 | bool has_broken_compute_) |
| 20 | : name{name_}, vsync_support{vsync_modes_}, is_intel_proprietary{is_intel_proprietary_} {} | 22 | : name{name_}, vsync_support{vsync_modes_}, has_broken_compute{has_broken_compute_} {} |
| 21 | 23 | ||
| 22 | Record::~Record() = default; | 24 | Record::~Record() = default; |
| 23 | 25 | ||
| @@ -48,9 +50,10 @@ void PopulateRecords(std::vector<Record>& records, QWindow* window) try { | |||
| 48 | properties.pNext = &driver_properties; | 50 | properties.pNext = &driver_properties; |
| 49 | dld.vkGetPhysicalDeviceProperties2(physical_device, &properties); | 51 | dld.vkGetPhysicalDeviceProperties2(physical_device, &properties); |
| 50 | 52 | ||
| 51 | records.push_back(VkDeviceInfo::Record(name, present_modes, | 53 | bool has_broken_compute{Vulkan::Device::CheckBrokenCompute( |
| 52 | driver_properties.driverID == | 54 | driver_properties.driverID, properties.properties.driverVersion)}; |
| 53 | VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS)); | 55 | |
| 56 | records.push_back(VkDeviceInfo::Record(name, present_modes, has_broken_compute)); | ||
| 54 | } | 57 | } |
| 55 | } catch (const Vulkan::vk::Exception& exception) { | 58 | } catch (const Vulkan::vk::Exception& exception) { |
| 56 | LOG_ERROR(Frontend, "Failed to enumerate devices with error: {}", exception.what()); | 59 | LOG_ERROR(Frontend, "Failed to enumerate devices with error: {}", exception.what()); |
diff --git a/src/yuzu/vk_device_info.h b/src/yuzu/vk_device_info.h index 5a6c64416..bda8262f4 100644 --- a/src/yuzu/vk_device_info.h +++ b/src/yuzu/vk_device_info.h | |||
| @@ -24,12 +24,12 @@ namespace VkDeviceInfo { | |||
| 24 | class Record { | 24 | class Record { |
| 25 | public: | 25 | public: |
| 26 | explicit Record(std::string_view name, const std::vector<VkPresentModeKHR>& vsync_modes, | 26 | explicit Record(std::string_view name, const std::vector<VkPresentModeKHR>& vsync_modes, |
| 27 | bool is_intel_proprietary); | 27 | bool has_broken_compute); |
| 28 | ~Record(); | 28 | ~Record(); |
| 29 | 29 | ||
| 30 | const std::string name; | 30 | const std::string name; |
| 31 | const std::vector<VkPresentModeKHR> vsync_support; | 31 | const std::vector<VkPresentModeKHR> vsync_support; |
| 32 | const bool is_intel_proprietary; | 32 | const bool has_broken_compute; |
| 33 | }; | 33 | }; |
| 34 | 34 | ||
| 35 | void PopulateRecords(std::vector<Record>& records, QWindow* window); | 35 | void PopulateRecords(std::vector<Record>& records, QWindow* window); |