early-access version 3699

This commit is contained in:
pineappleEA 2023-06-20 17:44:39 +02:00
parent c57da32a15
commit e69574bd30
8 changed files with 41 additions and 15 deletions

View File

@ -1,7 +1,7 @@
yuzu emulator early access yuzu emulator early access
============= =============
This is the source code for early-access 3698. This is the source code for early-access 3699.
## Legal Notice ## Legal Notice

View File

@ -111,7 +111,7 @@ GPUVAddr MemoryManager::PageTableOp(GPUVAddr gpu_addr, [[maybe_unused]] VAddr cp
[[maybe_unused]] const auto current_entry_type = GetEntry<false>(current_gpu_addr); [[maybe_unused]] const auto current_entry_type = GetEntry<false>(current_gpu_addr);
SetEntry<false>(current_gpu_addr, entry_type); SetEntry<false>(current_gpu_addr, entry_type);
if (current_entry_type != entry_type) { if (current_entry_type != entry_type) {
rasterizer->ModifyGPUMemory(unique_identifier, gpu_addr, page_size); rasterizer->ModifyGPUMemory(unique_identifier, current_gpu_addr, page_size);
} }
if constexpr (entry_type == EntryType::Mapped) { if constexpr (entry_type == EntryType::Mapped) {
const VAddr current_cpu_addr = cpu_addr + offset; const VAddr current_cpu_addr = cpu_addr + offset;
@ -134,7 +134,7 @@ GPUVAddr MemoryManager::BigPageTableOp(GPUVAddr gpu_addr, [[maybe_unused]] VAddr
[[maybe_unused]] const auto current_entry_type = GetEntry<true>(current_gpu_addr); [[maybe_unused]] const auto current_entry_type = GetEntry<true>(current_gpu_addr);
SetEntry<true>(current_gpu_addr, entry_type); SetEntry<true>(current_gpu_addr, entry_type);
if (current_entry_type != entry_type) { if (current_entry_type != entry_type) {
rasterizer->ModifyGPUMemory(unique_identifier, gpu_addr, big_page_size); rasterizer->ModifyGPUMemory(unique_identifier, current_gpu_addr, big_page_size);
} }
if constexpr (entry_type == EntryType::Mapped) { if constexpr (entry_type == EntryType::Mapped) {
const VAddr current_cpu_addr = cpu_addr + offset; const VAddr current_cpu_addr = cpu_addr + offset;

View File

@ -711,10 +711,7 @@ std::unique_ptr<ComputePipeline> PipelineCache::CreateComputePipeline(
std::unique_ptr<ComputePipeline> PipelineCache::CreateComputePipeline( std::unique_ptr<ComputePipeline> PipelineCache::CreateComputePipeline(
ShaderPools& pools, const ComputePipelineCacheKey& key, Shader::Environment& env, ShaderPools& pools, const ComputePipelineCacheKey& key, Shader::Environment& env,
PipelineStatistics* statistics, bool build_in_parallel) try { PipelineStatistics* statistics, bool build_in_parallel) try {
// TODO: Remove this when Intel fixes their shader compiler. if (device.HasBrokenCompute()) {
// https://github.com/IGCIT/Intel-GPU-Community-Issue-Tracker-IGCIT/issues/159
if (device.GetDriverID() == VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS &&
!Settings::values.enable_compute_pipelines.GetValue()) {
LOG_ERROR(Render_Vulkan, "Skipping 0x{:016x}", key.Hash()); LOG_ERROR(Render_Vulkan, "Skipping 0x{:016x}", key.Hash());
return nullptr; return nullptr;
} }

View File

@ -567,6 +567,9 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR
LOG_WARNING(Render_Vulkan, "Intel proprietary drivers do not support MSAA image blits"); LOG_WARNING(Render_Vulkan, "Intel proprietary drivers do not support MSAA image blits");
cant_blit_msaa = true; cant_blit_msaa = true;
} }
has_broken_compute =
CheckBrokenCompute(properties.driver.driverID, properties.properties.driverVersion) &&
!Settings::values.enable_compute_pipelines.GetValue();
if (is_intel_anv || (is_qualcomm && !is_s8gen2)) { if (is_intel_anv || (is_qualcomm && !is_s8gen2)) {
LOG_WARNING(Render_Vulkan, "Driver does not support native BGR format"); LOG_WARNING(Render_Vulkan, "Driver does not support native BGR format");
must_emulate_bgr565 = true; must_emulate_bgr565 = true;

View File

@ -10,6 +10,7 @@
#include <vector> #include <vector>
#include "common/common_types.h" #include "common/common_types.h"
#include "common/logging/log.h"
#include "common/settings.h" #include "common/settings.h"
#include "video_core/vulkan_common/vulkan_wrapper.h" #include "video_core/vulkan_common/vulkan_wrapper.h"
@ -525,6 +526,11 @@ public:
return has_renderdoc || has_nsight_graphics || Settings::values.renderer_debug.GetValue(); return has_renderdoc || has_nsight_graphics || Settings::values.renderer_debug.GetValue();
} }
/// @returns True if compute pipelines can cause crashing.
bool HasBrokenCompute() const {
return has_broken_compute;
}
/// Returns true when the device does not properly support cube compatibility. /// Returns true when the device does not properly support cube compatibility.
bool HasBrokenCubeImageCompability() const { bool HasBrokenCubeImageCompability() const {
return has_broken_cube_compatibility; return has_broken_cube_compatibility;
@ -586,6 +592,22 @@ public:
return supports_conditional_barriers; return supports_conditional_barriers;
} }
[[nodiscard]] static constexpr bool CheckBrokenCompute(VkDriverId driver_id,
u32 driver_version) {
if (driver_id == VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS) {
const u32 major = VK_API_VERSION_MAJOR(driver_version);
const u32 minor = VK_API_VERSION_MINOR(driver_version);
const u32 patch = VK_API_VERSION_PATCH(driver_version);
if (major == 0 && minor == 405 && patch < 286) {
LOG_WARNING(
Render_Vulkan,
"Intel proprietary drivers 0.405.0 until 0.405.286 have broken compute");
return true;
}
}
return false;
}
private: private:
/// Checks if the physical device is suitable and configures the object state /// Checks if the physical device is suitable and configures the object state
/// with all necessary info about its properties. /// with all necessary info about its properties.
@ -680,6 +702,7 @@ private:
bool is_integrated{}; ///< Is GPU an iGPU. bool is_integrated{}; ///< Is GPU an iGPU.
bool is_virtual{}; ///< Is GPU a virtual GPU. bool is_virtual{}; ///< Is GPU a virtual GPU.
bool is_non_gpu{}; ///< Is SoftwareRasterizer, FPGA, non-GPU device. bool is_non_gpu{}; ///< Is SoftwareRasterizer, FPGA, non-GPU device.
bool has_broken_compute{}; ///< Compute shaders can cause crashes
bool has_broken_cube_compatibility{}; ///< Has broken cube compatibility bit bool has_broken_cube_compatibility{}; ///< Has broken cube compatibility bit
bool has_renderdoc{}; ///< Has RenderDoc attached bool has_renderdoc{}; ///< Has RenderDoc attached
bool has_nsight_graphics{}; ///< Has Nsight Graphics attached bool has_nsight_graphics{}; ///< Has Nsight Graphics attached

View File

@ -508,7 +508,7 @@ void ConfigureGraphics::RetrieveVulkanDevices() {
vulkan_devices.push_back(QString::fromStdString(record.name)); vulkan_devices.push_back(QString::fromStdString(record.name));
device_present_modes.push_back(record.vsync_support); device_present_modes.push_back(record.vsync_support);
if (record.is_intel_proprietary) { if (record.has_broken_compute) {
expose_compute_option(); expose_compute_option();
} }
} }

View File

@ -5,10 +5,12 @@
#include <vector> #include <vector>
#include "common/dynamic_library.h" #include "common/dynamic_library.h"
#include "common/logging/log.h" #include "common/logging/log.h"
#include "video_core/vulkan_common/vulkan_device.h"
#include "video_core/vulkan_common/vulkan_instance.h" #include "video_core/vulkan_common/vulkan_instance.h"
#include "video_core/vulkan_common/vulkan_library.h" #include "video_core/vulkan_common/vulkan_library.h"
#include "video_core/vulkan_common/vulkan_surface.h" #include "video_core/vulkan_common/vulkan_surface.h"
#include "video_core/vulkan_common/vulkan_wrapper.h" #include "video_core/vulkan_common/vulkan_wrapper.h"
#include "vulkan/vulkan_core.h"
#include "yuzu/qt_common.h" #include "yuzu/qt_common.h"
#include "yuzu/vk_device_info.h" #include "yuzu/vk_device_info.h"
@ -16,8 +18,8 @@ class QWindow;
namespace VkDeviceInfo { namespace VkDeviceInfo {
Record::Record(std::string_view name_, const std::vector<VkPresentModeKHR>& vsync_modes_, Record::Record(std::string_view name_, const std::vector<VkPresentModeKHR>& vsync_modes_,
bool is_intel_proprietary_) bool has_broken_compute_)
: name{name_}, vsync_support{vsync_modes_}, is_intel_proprietary{is_intel_proprietary_} {} : name{name_}, vsync_support{vsync_modes_}, has_broken_compute{has_broken_compute_} {}
Record::~Record() = default; Record::~Record() = default;
@ -48,9 +50,10 @@ void PopulateRecords(std::vector<Record>& records, QWindow* window) try {
properties.pNext = &driver_properties; properties.pNext = &driver_properties;
dld.vkGetPhysicalDeviceProperties2(physical_device, &properties); dld.vkGetPhysicalDeviceProperties2(physical_device, &properties);
records.push_back(VkDeviceInfo::Record(name, present_modes, bool has_broken_compute{Vulkan::Device::CheckBrokenCompute(
driver_properties.driverID == driver_properties.driverID, properties.properties.driverVersion)};
VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS));
records.push_back(VkDeviceInfo::Record(name, present_modes, has_broken_compute));
} }
} catch (const Vulkan::vk::Exception& exception) { } catch (const Vulkan::vk::Exception& exception) {
LOG_ERROR(Frontend, "Failed to enumerate devices with error: {}", exception.what()); LOG_ERROR(Frontend, "Failed to enumerate devices with error: {}", exception.what());

View File

@ -24,12 +24,12 @@ namespace VkDeviceInfo {
class Record { class Record {
public: public:
explicit Record(std::string_view name, const std::vector<VkPresentModeKHR>& vsync_modes, explicit Record(std::string_view name, const std::vector<VkPresentModeKHR>& vsync_modes,
bool is_intel_proprietary); bool has_broken_compute);
~Record(); ~Record();
const std::string name; const std::string name;
const std::vector<VkPresentModeKHR> vsync_support; const std::vector<VkPresentModeKHR> vsync_support;
const bool is_intel_proprietary; const bool has_broken_compute;
}; };
void PopulateRecords(std::vector<Record>& records, QWindow* window); void PopulateRecords(std::vector<Record>& records, QWindow* window);