Merge branch 'master_Tweaks' into 'master'

Added: Fix Occlusion Culling

See merge request ryubing/ryujinx!18
This commit is contained in:
Goodfeat 2025-04-20 07:02:57 -05:00
commit d8a3c0bff1
10 changed files with 140 additions and 28 deletions

View file

@ -5997,6 +5997,56 @@
"zh_TW": "圖形著色器傾印路徑:"
}
},
{
"ID": "DisableFixOcclusionCulling",
"Translations": {
"ar_SA": "",
"de_DE": "",
"el_GR": "",
"en_US": "Disable Occlusion Culling Fix - flickering of objects.",
"es_ES": "",
"fr_FR": "",
"he_IL": "",
"it_IT": "",
"ja_JP": "",
"ko_KR": "",
"no_NO": "",
"pl_PL": "",
"pt_BR": "",
"ru_RU": "",
"sv_SE": "",
"th_TH": "",
"tr_TR": "",
"uk_UA": "",
"zh_CN": "",
"zh_TW": ""
}
},
{
"ID": "DisableFixOcclusionCullingTooltip",
"Translations": {
"ar_SA": "",
"de_DE": "",
"el_GR": "",
"en_US": "Eliminates visual artifacts in the form of chaotic flickering of objects on the screen.\nThe solution is relevant for games where such an effect is observed (for example, Alan Wake).",
"es_ES": "",
"fr_FR": "",
"he_IL": "",
"it_IT": "",
"ja_JP": "",
"ko_KR": "",
"no_NO": "",
"pl_PL": "",
"pt_BR": "",
"ru_RU": "",
"sv_SE": "",
"th_TH": "",
"tr_TR": "",
"uk_UA": "",
"zh_CN": "",
"zh_TW": ""
}
},
{
"ID": "SettingsTabLogging",
"Translations": {

View file

@ -165,6 +165,11 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
Timestamp = ticks,
};
if (!GraphicsConfig.DisableFixOcclusionCulling && result <= 0)
{
return;
}
if (counter?.Invalid != true)
{
_channel.MemoryManager.Write(gpuVa, counterData);

View file

@ -72,6 +72,11 @@ namespace Ryujinx.Graphics.Gpu
/// Enables or disables color space passthrough, if available.
/// </summary>
public static bool EnableColorSpacePassthrough = false;
/// <summary>
/// Enables or disables fix occlusion culling.
/// </summary>
public static bool DisableFixOcclusionCulling = false;
}
#pragma warning restore CA2211
}

View file

@ -15,7 +15,7 @@ namespace Ryujinx.Ava.Systems.Configuration
/// <summary>
/// The current version of the file format
/// </summary>
public const int CurrentVersion = 69;
public const int CurrentVersion = 70;
/// <summary>
/// Version of the configuration file format
@ -469,6 +469,11 @@ namespace Ryujinx.Ava.Systems.Configuration
/// </summary>
public ulong[] DirtyHacks { get; set; }
/// <summary>
/// Fixes Occlusion Culling in Games (test feature)
/// </summary>
public bool DisableFixOcclusionCulling { get; set; }
/// <summary>
/// Loads a configuration file from disk
/// </summary>

View file

@ -156,6 +156,8 @@ namespace Ryujinx.Ava.Systems.Configuration
Multiplayer.LdnPassphrase.Value = cff.MultiplayerLdnPassphrase;
Multiplayer.LdnServer.Value = cff.LdnServer;
Tweaks.DisableFixOcclusionCulling.Value = cff.DisableFixOcclusionCulling;
{
Hacks.ShowDirtyHacks.Value = cff.ShowDirtyHacks;
@ -461,7 +463,8 @@ namespace Ryujinx.Ava.Systems.Configuration
TurboModeWhileHeld = false
};
}),
(69, static cff => cff.SkipUserProfiles = false)
(69, static cff => cff.SkipUserProfiles = false),
(70, static cff => cff.DisableFixOcclusionCulling = false)
);
}
}

View file

@ -643,6 +643,21 @@ namespace Ryujinx.Ava.Systems.Configuration
}
}
/// <summary>
/// Tweaks Section
/// </summary>
public class TweaksSection
{
/// <summary>
/// Enable or disable Fix Occlusion Culling
/// </summary>
public ReactiveObject<bool> DisableFixOcclusionCulling { get; private set; }
public TweaksSection()
{
DisableFixOcclusionCulling = new ReactiveObject<bool>();
}
}
/// <summary>
/// Multiplayer configuration section
/// </summary>
@ -781,6 +796,11 @@ namespace Ryujinx.Ava.Systems.Configuration
/// </summary>
public GraphicsSection Graphics { get; private set; }
/// <summary>
/// The Tweaks Section
/// </summary>
public TweaksSection Tweaks { get; private set; }
/// <summary>
/// The Hid section
/// </summary>
@ -842,6 +862,7 @@ namespace Ryujinx.Ava.Systems.Configuration
Logger = new LoggerSection();
System = new SystemSection();
Graphics = new GraphicsSection();
Tweaks = new TweaksSection();
Hid = new HidSection();
Multiplayer = new MultiplayerSection();
Hacks = new HacksSection();

View file

@ -147,6 +147,7 @@ namespace Ryujinx.Ava.Systems.Configuration
LdnServer = Multiplayer.LdnServer,
ShowDirtyHacks = Hacks.ShowDirtyHacks,
DirtyHacks = Hacks.EnabledHacks.Select(it => it.Pack()).ToArray(),
DisableFixOcclusionCulling = Tweaks.DisableFixOcclusionCulling,
};
return configurationFile;
@ -320,6 +321,7 @@ namespace Ryujinx.Ava.Systems.Configuration
},
}
];
Tweaks.DisableFixOcclusionCulling.Value = false;
}
private static GraphicsBackend DefaultGraphicsBackend()

View file

@ -383,6 +383,8 @@ namespace Ryujinx.Ava.UI.ViewModels
}
}
public bool DisableFixOcclusionCulling { get; set; }
public SettingsViewModel(
VirtualFileSystem virtualFileSystem,
ContentManager contentManager,
@ -659,6 +661,9 @@ namespace Ryujinx.Ava.UI.ViewModels
DisableP2P = config.Multiplayer.DisableP2p;
LdnPassphrase = config.Multiplayer.LdnPassphrase;
LdnServer = config.Multiplayer.LdnServer;
// Tweaks
DisableFixOcclusionCulling = config.Tweaks.DisableFixOcclusionCulling.Value;
}
public void SaveSettings()
@ -785,6 +790,9 @@ namespace Ryujinx.Ava.UI.ViewModels
config.Hacks.DisableNifmIsAnyInternetRequestAccepted.Value =
DirtyHacks.NifmDisableIsAnyInternetRequestAccepted;
// Tweaks
config.Tweaks.DisableFixOcclusionCulling.Value = DisableFixOcclusionCulling;
config.ToFileFormat().SaveConfig(Program.ConfigurationPath);
MainWindow.UpdateGraphicsConfig();

View file

@ -4,12 +4,25 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ext="clr-namespace:Ryujinx.Ava.Common.Markup"
xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels"
mc:Ignorable="d"
x:DataType="viewModels:SettingsViewModel">
<Design.DataContext>
<viewModels:SettingsViewModel />
</Design.DataContext>
<UserControl.Styles>
<Style Selector="TextBlock.DefaultEnable" >
<Setter Property="Foreground" Value="SeaGreen"/>
<Setter Property="Margin" Value="5,0,0,0"/>
<Setter Property="VerticalAlignment" Value="Center"/>
</Style>
<Style Selector="TextBlock.DefaultDisable" >
<Setter Property="Foreground" Value="IndianRed"/>
<Setter Property="Margin" Value="5,0,0,0"/>
<Setter Property="VerticalAlignment" Value="Center"/>
</Style>
</UserControl.Styles>
<ScrollViewer
Name="HacksPage"
HorizontalAlignment="Stretch"
@ -19,41 +32,40 @@
<Border Classes="settings">
<StackPanel
Margin="10"
HorizontalAlignment="Center"
Orientation="Vertical"
Spacing="5">
Spacing="10">
<TextBlock
HorizontalAlignment="Center"
Classes="h1"
Text="Dirty Hacks" />
<TextBlock
HorizontalAlignment="Center"
Foreground="{DynamicResource SecondaryTextColor}"
TextDecorations="Underline"
Text="Highly specific hacks &amp; tricks to alleviate performance issues, crashing, or freezing. Can cause issues." />
<StackPanel
Margin="0,10,0,0"
Orientation="Horizontal"
HorizontalAlignment="Center"
ToolTip.Tip="{Binding DirtyHacks.Xc2MenuFixTooltip}">
<CheckBox
Margin="0"
IsChecked="{Binding DirtyHacks.Xc2MenuSoftlockFix}"/>
<TextBlock
VerticalAlignment="Center"
Text="Xenoblade Chronicles 2 Menu Softlock Fix" />
</StackPanel>
<Separator/>
<StackPanel
Margin="0,10,0,0"
Orientation="Horizontal"
HorizontalAlignment="Center"
<StackPanel Margin="10,0,0,0">
<CheckBox IsChecked="{Binding DirtyHacks.Xc2MenuSoftlockFix}"
ToolTip.Tip="{Binding DirtyHacks.Xc2MenuFixTooltip}">
<StackPanel Orientation="Horizontal">
<TextBlock Text="Xenoblade Chronicles 2 Menu Softlock Fix" />
<TextBlock Classes="DefaultDisable" Text="Default: disable" />
</StackPanel>
</CheckBox>
<CheckBox IsChecked="{Binding DirtyHacks.NifmDisableIsAnyInternetRequestAccepted}"
ToolTip.Tip="{Binding DirtyHacks.NifmDisableIsAnyInternetRequestAcceptedTooltip}">
<CheckBox
Margin="0"
IsChecked="{Binding DirtyHacks.NifmDisableIsAnyInternetRequestAccepted}"/>
<TextBlock
VerticalAlignment="Center"
Text="Disable IsAnyInternetRequestAccepted" />
<StackPanel Orientation="Horizontal">
<TextBlock Text="Disable IsAnyInternetRequestAccepted" />
<TextBlock Classes="DefaultDisable" Text="Default: disable" />
</StackPanel>
</CheckBox>
<CheckBox IsChecked="{Binding DisableFixOcclusionCulling}"
ToolTip.Tip="{ext:Locale DisableFixOcclusionCullingTooltip}">
<StackPanel Orientation="Horizontal">
<TextBlock Text="{ext:Locale DisableFixOcclusionCulling}" />
<TextBlock Classes="DefaultDisable" Text="Default: disable" />
</StackPanel>
</CheckBox>
</StackPanel>
</StackPanel>
</Border>

View file

@ -569,6 +569,7 @@ namespace Ryujinx.Ava.UI.Windows
GraphicsConfig.EnableShaderCache = ConfigurationState.Instance.Graphics.EnableShaderCache;
GraphicsConfig.EnableTextureRecompression = ConfigurationState.Instance.Graphics.EnableTextureRecompression;
GraphicsConfig.EnableMacroHLE = ConfigurationState.Instance.Graphics.EnableMacroHLE;
GraphicsConfig.DisableFixOcclusionCulling = ConfigurationState.Instance.Tweaks.DisableFixOcclusionCulling;
#pragma warning restore IDE0055
}