Skip to content

Commit

Permalink
misc: Expose DirtyHacks on GpuContext
Browse files Browse the repository at this point in the history
  • Loading branch information
GreemDev committed Dec 30, 2024
1 parent f362bef commit 42a739d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
8 changes: 7 additions & 1 deletion src/Ryujinx.Graphics.Gpu/GpuContext.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Ryujinx.Common;
using Ryujinx.Common.Configuration;
using Ryujinx.Graphics.Device;
using Ryujinx.Graphics.GAL;
using Ryujinx.Graphics.Gpu.Engine.GPFifo;
Expand Down Expand Up @@ -90,6 +91,9 @@ public sealed class GpuContext : IDisposable
/// Support buffer updater.
/// </summary>
internal SupportBufferUpdater SupportBufferUpdater { get; }

internal DirtyHackCollection DirtyHacks { get; }


/// <summary>
/// Host hardware capabilities.
Expand All @@ -113,7 +117,7 @@ public sealed class GpuContext : IDisposable
/// Creates a new instance of the GPU emulation context.
/// </summary>
/// <param name="renderer">Host renderer</param>
public GpuContext(IRenderer renderer)
public GpuContext(IRenderer renderer, DirtyHackCollection hackCollection)
{
Renderer = renderer;

Expand All @@ -136,6 +140,8 @@ public GpuContext(IRenderer renderer)

SupportBufferUpdater = new SupportBufferUpdater(renderer);

DirtyHacks = hackCollection;

_firstTimestamp = ConvertNanosecondsToTicks((ulong)PerformanceCounter.ElapsedNanoseconds);
}

Expand Down
5 changes: 3 additions & 2 deletions src/Ryujinx.HLE/Switch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,10 @@ public Switch(HLEConfiguration configuration)
: MemoryAllocationFlags.Reserve | MemoryAllocationFlags.Mirrorable;

#pragma warning disable IDE0055 // Disable formatting
DirtyHacks = new DirtyHackCollection(Configuration.Hacks);
AudioDeviceDriver = new CompatLayerHardwareDeviceDriver(Configuration.AudioDeviceDriver);
Memory = new MemoryBlock(Configuration.MemoryConfiguration.ToDramSize(), memoryAllocationFlags);
Gpu = new GpuContext(Configuration.GpuRenderer);
Gpu = new GpuContext(Configuration.GpuRenderer, DirtyHacks);
System = new HOS.Horizon(this);
Statistics = new PerformanceStatistics();
Hid = new Hid(this, System.HidStorage);
Expand All @@ -77,7 +78,7 @@ public Switch(HLEConfiguration configuration)
System.EnablePtc = Configuration.EnablePtc;
System.FsIntegrityCheckLevel = Configuration.FsIntegrityCheckLevel;
System.GlobalAccessLogMode = Configuration.FsGlobalAccessLogMode;
DirtyHacks = new DirtyHackCollection(Configuration.Hacks);

UpdateVSyncInterval();
#pragma warning restore IDE0055

Expand Down

0 comments on commit 42a739d

Please sign in to comment.