From f1d1670b0b1b5c08064df95dabd295f3cf5dcf7f Mon Sep 17 00:00:00 2001 From: gdkchan Date: Wed, 16 Nov 2022 14:53:04 -0300 Subject: Implement HLE macro for DrawElementsIndirect (#3748) * Implement HLE macro for DrawElementsIndirect * Shader cache version bump * Use GL_ARB_shader_draw_parameters extension on OpenGL * Fix DrawIndexedIndirectCount on Vulkan when extension is not supported * Implement DrawIndex * Alignment * Fix some validation errors * Rename BaseIds to DrawParameters * Fix incorrect index buffer and vertex buffer size in some cases * Add HLE macros for DrawArraysInstanced and DrawElementsInstanced * Perform a regular draw when indirect data is not modified * Use non-indirect draw methods if indirect buffer was not GPU modified * Only check if draw parameters match if the shader actually uses them * Expose Macro HLE setting on GUI * Reset FirstVertex and FirstInstance after draw * Update shader cache version again since some people already tested this * PR feedback Co-authored-by: riperiperi --- Ryujinx.Ui.Common/Configuration/ConfigurationState.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'Ryujinx.Ui.Common/Configuration/ConfigurationState.cs') diff --git a/Ryujinx.Ui.Common/Configuration/ConfigurationState.cs b/Ryujinx.Ui.Common/Configuration/ConfigurationState.cs index 3dbbb3dd..18cf7640 100644 --- a/Ryujinx.Ui.Common/Configuration/ConfigurationState.cs +++ b/Ryujinx.Ui.Common/Configuration/ConfigurationState.cs @@ -416,6 +416,11 @@ namespace Ryujinx.Ui.Common.Configuration /// public ReactiveObject EnableTextureRecompression { get; private set; } + /// + /// Enables or disables Macro high-level emulation + /// + public ReactiveObject EnableMacroHLE { get; private set; } + /// /// Graphics backend /// @@ -449,6 +454,8 @@ namespace Ryujinx.Ui.Common.Configuration GraphicsBackend.Event += static (sender, e) => LogValueChange(sender, e, nameof(GraphicsBackend)); PreferredGpu = new ReactiveObject(); PreferredGpu.Event += static (sender, e) => LogValueChange(sender, e, nameof(PreferredGpu)); + EnableMacroHLE = new ReactiveObject(); + EnableMacroHLE.Event += static (sender, e) => LogValueChange(sender, e, nameof(EnableMacroHLE)); } } @@ -549,6 +556,7 @@ namespace Ryujinx.Ui.Common.Configuration EnableVsync = Graphics.EnableVsync, EnableShaderCache = Graphics.EnableShaderCache, EnableTextureRecompression = Graphics.EnableTextureRecompression, + EnableMacroHLE = Graphics.EnableMacroHLE, EnablePtc = System.EnablePtc, EnableInternetAccess = System.EnableInternetAccess, EnableFsIntegrityChecks = System.EnableFsIntegrityChecks, @@ -634,6 +642,7 @@ namespace Ryujinx.Ui.Common.Configuration Graphics.EnableVsync.Value = true; Graphics.EnableShaderCache.Value = true; Graphics.EnableTextureRecompression.Value = false; + Graphics.EnableMacroHLE.Value = true; System.EnablePtc.Value = true; System.EnableInternetAccess.Value = false; System.EnableFsIntegrityChecks.Value = true; @@ -1176,6 +1185,13 @@ namespace Ryujinx.Ui.Common.Configuration }; } + if (configurationFileFormat.Version < 42) + { + Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 42."); + + configurationFileFormat.EnableMacroHLE = true; + } + Logger.EnableFileLog.Value = configurationFileFormat.EnableFileLog; Graphics.ResScale.Value = configurationFileFormat.ResScale; Graphics.ResScaleCustom.Value = configurationFileFormat.ResScaleCustom; @@ -1207,6 +1223,7 @@ namespace Ryujinx.Ui.Common.Configuration Graphics.EnableVsync.Value = configurationFileFormat.EnableVsync; Graphics.EnableShaderCache.Value = configurationFileFormat.EnableShaderCache; Graphics.EnableTextureRecompression.Value = configurationFileFormat.EnableTextureRecompression; + Graphics.EnableMacroHLE.Value = configurationFileFormat.EnableMacroHLE; System.EnablePtc.Value = configurationFileFormat.EnablePtc; System.EnableInternetAccess.Value = configurationFileFormat.EnableInternetAccess; System.EnableFsIntegrityChecks.Value = configurationFileFormat.EnableFsIntegrityChecks; -- cgit v1.2.3