summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/video_core/memory_manager.cpp4
-rw-r--r--src/video_core/renderer_vulkan/vk_pipeline_cache.cpp5
-rw-r--r--src/video_core/texture_cache/texture_cache.h22
-rw-r--r--src/video_core/texture_cache/texture_cache_base.h10
-rw-r--r--src/video_core/vulkan_common/vulkan_device.cpp3
-rw-r--r--src/video_core/vulkan_common/vulkan_device.h23
-rw-r--r--src/yuzu/configuration/configure_graphics.cpp2
-rw-r--r--src/yuzu/vk_device_info.cpp13
-rw-r--r--src/yuzu/vk_device_info.h4
9 files changed, 54 insertions, 32 deletions
diff --git a/src/video_core/memory_manager.cpp b/src/video_core/memory_manager.cpp
index 7b2cde7a7..b2f7e160a 100644
--- a/src/video_core/memory_manager.cpp
+++ b/src/video_core/memory_manager.cpp
@@ -111,7 +111,7 @@ GPUVAddr MemoryManager::PageTableOp(GPUVAddr gpu_addr, [[maybe_unused]] VAddr cp
111 [[maybe_unused]] const auto current_entry_type = GetEntry<false>(current_gpu_addr); 111 [[maybe_unused]] const auto current_entry_type = GetEntry<false>(current_gpu_addr);
112 SetEntry<false>(current_gpu_addr, entry_type); 112 SetEntry<false>(current_gpu_addr, entry_type);
113 if (current_entry_type != entry_type) { 113 if (current_entry_type != entry_type) {
114 rasterizer->ModifyGPUMemory(unique_identifier, gpu_addr, page_size); 114 rasterizer->ModifyGPUMemory(unique_identifier, current_gpu_addr, page_size);
115 } 115 }
116 if constexpr (entry_type == EntryType::Mapped) { 116 if constexpr (entry_type == EntryType::Mapped) {
117 const VAddr current_cpu_addr = cpu_addr + offset; 117 const VAddr current_cpu_addr = cpu_addr + offset;
@@ -134,7 +134,7 @@ GPUVAddr MemoryManager::BigPageTableOp(GPUVAddr gpu_addr, [[maybe_unused]] VAddr
134 [[maybe_unused]] const auto current_entry_type = GetEntry<true>(current_gpu_addr); 134 [[maybe_unused]] const auto current_entry_type = GetEntry<true>(current_gpu_addr);
135 SetEntry<true>(current_gpu_addr, entry_type); 135 SetEntry<true>(current_gpu_addr, entry_type);
136 if (current_entry_type != entry_type) { 136 if (current_entry_type != entry_type) {
137 rasterizer->ModifyGPUMemory(unique_identifier, gpu_addr, big_page_size); 137 rasterizer->ModifyGPUMemory(unique_identifier, current_gpu_addr, big_page_size);
138 } 138 }
139 if constexpr (entry_type == EntryType::Mapped) { 139 if constexpr (entry_type == EntryType::Mapped) {
140 const VAddr current_cpu_addr = cpu_addr + offset; 140 const VAddr current_cpu_addr = cpu_addr + offset;
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(
705std::unique_ptr<ComputePipeline> PipelineCache::CreateComputePipeline( 705std::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/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h
index 4027d860b..d25339c8c 100644
--- a/src/video_core/texture_cache/texture_cache.h
+++ b/src/video_core/texture_cache/texture_cache.h
@@ -300,7 +300,7 @@ void TextureCache<P>::SynchronizeComputeDescriptors() {
300} 300}
301 301
302template <class P> 302template <class P>
303bool TextureCache<P>::RescaleRenderTargets(bool is_clear) { 303bool TextureCache<P>::RescaleRenderTargets() {
304 auto& flags = maxwell3d->dirty.flags; 304 auto& flags = maxwell3d->dirty.flags;
305 u32 scale_rating = 0; 305 u32 scale_rating = 0;
306 bool rescaled = false; 306 bool rescaled = false;
@@ -338,13 +338,13 @@ bool TextureCache<P>::RescaleRenderTargets(bool is_clear) {
338 ImageViewId& color_buffer_id = render_targets.color_buffer_ids[index]; 338 ImageViewId& color_buffer_id = render_targets.color_buffer_ids[index];
339 if (flags[Dirty::ColorBuffer0 + index] || force) { 339 if (flags[Dirty::ColorBuffer0 + index] || force) {
340 flags[Dirty::ColorBuffer0 + index] = false; 340 flags[Dirty::ColorBuffer0 + index] = false;
341 BindRenderTarget(&color_buffer_id, FindColorBuffer(index, is_clear)); 341 BindRenderTarget(&color_buffer_id, FindColorBuffer(index));
342 } 342 }
343 check_rescale(color_buffer_id, tmp_color_images[index]); 343 check_rescale(color_buffer_id, tmp_color_images[index]);
344 } 344 }
345 if (flags[Dirty::ZetaBuffer] || force) { 345 if (flags[Dirty::ZetaBuffer] || force) {
346 flags[Dirty::ZetaBuffer] = false; 346 flags[Dirty::ZetaBuffer] = false;
347 BindRenderTarget(&render_targets.depth_buffer_id, FindDepthBuffer(is_clear)); 347 BindRenderTarget(&render_targets.depth_buffer_id, FindDepthBuffer());
348 } 348 }
349 check_rescale(render_targets.depth_buffer_id, tmp_depth_image); 349 check_rescale(render_targets.depth_buffer_id, tmp_depth_image);
350 350
@@ -409,7 +409,7 @@ void TextureCache<P>::UpdateRenderTargets(bool is_clear) {
409 return; 409 return;
410 } 410 }
411 411
412 const bool rescaled = RescaleRenderTargets(is_clear); 412 const bool rescaled = RescaleRenderTargets();
413 if (is_rescaling != rescaled) { 413 if (is_rescaling != rescaled) {
414 flags[Dirty::RescaleViewports] = true; 414 flags[Dirty::RescaleViewports] = true;
415 flags[Dirty::RescaleScissors] = true; 415 flags[Dirty::RescaleScissors] = true;
@@ -1678,7 +1678,7 @@ SamplerId TextureCache<P>::FindSampler(const TSCEntry& config) {
1678} 1678}
1679 1679
1680template <class P> 1680template <class P>
1681ImageViewId TextureCache<P>::FindColorBuffer(size_t index, bool is_clear) { 1681ImageViewId TextureCache<P>::FindColorBuffer(size_t index) {
1682 const auto& regs = maxwell3d->regs; 1682 const auto& regs = maxwell3d->regs;
1683 if (index >= regs.rt_control.count) { 1683 if (index >= regs.rt_control.count) {
1684 return ImageViewId{}; 1684 return ImageViewId{};
@@ -1692,11 +1692,11 @@ ImageViewId TextureCache<P>::FindColorBuffer(size_t index, bool is_clear) {
1692 return ImageViewId{}; 1692 return ImageViewId{};
1693 } 1693 }
1694 const ImageInfo info(regs.rt[index], regs.anti_alias_samples_mode); 1694 const ImageInfo info(regs.rt[index], regs.anti_alias_samples_mode);
1695 return FindRenderTargetView(info, gpu_addr, is_clear); 1695 return FindRenderTargetView(info, gpu_addr);
1696} 1696}
1697 1697
1698template <class P> 1698template <class P>
1699ImageViewId TextureCache<P>::FindDepthBuffer(bool is_clear) { 1699ImageViewId TextureCache<P>::FindDepthBuffer() {
1700 const auto& regs = maxwell3d->regs; 1700 const auto& regs = maxwell3d->regs;
1701 if (!regs.zeta_enable) { 1701 if (!regs.zeta_enable) {
1702 return ImageViewId{}; 1702 return ImageViewId{};
@@ -1706,18 +1706,16 @@ ImageViewId TextureCache<P>::FindDepthBuffer(bool is_clear) {
1706 return ImageViewId{}; 1706 return ImageViewId{};
1707 } 1707 }
1708 const ImageInfo info(regs.zeta, regs.zeta_size, regs.anti_alias_samples_mode); 1708 const ImageInfo info(regs.zeta, regs.zeta_size, regs.anti_alias_samples_mode);
1709 return FindRenderTargetView(info, gpu_addr, is_clear); 1709 return FindRenderTargetView(info, gpu_addr);
1710} 1710}
1711 1711
1712template <class P> 1712template <class P>
1713ImageViewId TextureCache<P>::FindRenderTargetView(const ImageInfo& info, GPUVAddr gpu_addr, 1713ImageViewId TextureCache<P>::FindRenderTargetView(const ImageInfo& info, GPUVAddr gpu_addr) {
1714 bool is_clear) {
1715 const auto options = is_clear ? RelaxedOptions::Samples : RelaxedOptions{};
1716 ImageId image_id{}; 1714 ImageId image_id{};
1717 bool delete_state = has_deleted_images; 1715 bool delete_state = has_deleted_images;
1718 do { 1716 do {
1719 has_deleted_images = false; 1717 has_deleted_images = false;
1720 image_id = FindOrInsertImage(info, gpu_addr, options); 1718 image_id = FindOrInsertImage(info, gpu_addr);
1721 delete_state |= has_deleted_images; 1719 delete_state |= has_deleted_images;
1722 } while (has_deleted_images); 1720 } while (has_deleted_images);
1723 has_deleted_images = delete_state; 1721 has_deleted_images = delete_state;
diff --git a/src/video_core/texture_cache/texture_cache_base.h b/src/video_core/texture_cache/texture_cache_base.h
index d96ddea9d..44232b961 100644
--- a/src/video_core/texture_cache/texture_cache_base.h
+++ b/src/video_core/texture_cache/texture_cache_base.h
@@ -178,9 +178,8 @@ public:
178 void SynchronizeComputeDescriptors(); 178 void SynchronizeComputeDescriptors();
179 179
180 /// Updates the Render Targets if they can be rescaled 180 /// Updates the Render Targets if they can be rescaled
181 /// @param is_clear True when the render targets are being used for clears
182 /// @retval True if the Render Targets have been rescaled. 181 /// @retval True if the Render Targets have been rescaled.
183 bool RescaleRenderTargets(bool is_clear); 182 bool RescaleRenderTargets();
184 183
185 /// Update bound render targets and upload memory if necessary 184 /// Update bound render targets and upload memory if necessary
186 /// @param is_clear True when the render targets are being used for clears 185 /// @param is_clear True when the render targets are being used for clears
@@ -336,14 +335,13 @@ private:
336 [[nodiscard]] SamplerId FindSampler(const TSCEntry& config); 335 [[nodiscard]] SamplerId FindSampler(const TSCEntry& config);
337 336
338 /// Find or create an image view for the given color buffer index 337 /// Find or create an image view for the given color buffer index
339 [[nodiscard]] ImageViewId FindColorBuffer(size_t index, bool is_clear); 338 [[nodiscard]] ImageViewId FindColorBuffer(size_t index);
340 339
341 /// Find or create an image view for the depth buffer 340 /// Find or create an image view for the depth buffer
342 [[nodiscard]] ImageViewId FindDepthBuffer(bool is_clear); 341 [[nodiscard]] ImageViewId FindDepthBuffer();
343 342
344 /// Find or create a view for a render target with the given image parameters 343 /// Find or create a view for a render target with the given image parameters
345 [[nodiscard]] ImageViewId FindRenderTargetView(const ImageInfo& info, GPUVAddr gpu_addr, 344 [[nodiscard]] ImageViewId FindRenderTargetView(const ImageInfo& info, GPUVAddr gpu_addr);
346 bool is_clear);
347 345
348 /// Iterates over all the images in a region calling func 346 /// Iterates over all the images in a region calling func
349 template <typename Func> 347 template <typename Func>
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
582private: 604private:
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
17namespace VkDeviceInfo { 19namespace VkDeviceInfo {
18Record::Record(std::string_view name_, const std::vector<VkPresentModeKHR>& vsync_modes_, 20Record::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
22Record::~Record() = default; 24Record::~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 {
24class Record { 24class Record {
25public: 25public:
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
35void PopulateRecords(std::vector<Record>& records, QWindow* window); 35void PopulateRecords(std::vector<Record>& records, QWindow* window);