Forcibly enable threaded optimization on boot.
This commit is contained in:
parent
b1c3e01691
commit
1239c82d2f
8 changed files with 327 additions and 3 deletions
11
Ryujinx.Common/GraphicsDriver/NVAPI/Nvapi.cs
Normal file
11
Ryujinx.Common/GraphicsDriver/NVAPI/Nvapi.cs
Normal file
|
@ -0,0 +1,11 @@
|
|||
namespace Ryujinx.Common.GraphicsDriver.NVAPI
|
||||
{
|
||||
enum Nvapi : uint
|
||||
{
|
||||
OglThreadControlId = 0x20C1221E,
|
||||
|
||||
OglThreadControlDefault = 0,
|
||||
OglThreadControlEnable = 1,
|
||||
OglThreadControlDisable = 2
|
||||
}
|
||||
}
|
42
Ryujinx.Common/GraphicsDriver/NVAPI/NvapiUnicodeString.cs
Normal file
42
Ryujinx.Common/GraphicsDriver/NVAPI/NvapiUnicodeString.cs
Normal file
|
@ -0,0 +1,42 @@
|
|||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
namespace Ryujinx.Common.GraphicsDriver.NVAPI
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 4)]
|
||||
public unsafe struct NvapiUnicodeString
|
||||
{
|
||||
public fixed byte Data[4096];
|
||||
|
||||
public NvapiUnicodeString(string text)
|
||||
{
|
||||
Set(text);
|
||||
}
|
||||
|
||||
public string Get()
|
||||
{
|
||||
fixed (byte* data = Data)
|
||||
{
|
||||
string text = Encoding.Unicode.GetString(data, 4096);
|
||||
|
||||
int index = text.IndexOf('\0');
|
||||
if (index > -1)
|
||||
{
|
||||
text = text.Remove(index);
|
||||
}
|
||||
|
||||
return text;
|
||||
}
|
||||
}
|
||||
|
||||
public void Set(string text)
|
||||
{
|
||||
text += '\0';
|
||||
fixed (char* textPtr = text)
|
||||
fixed (byte* data = Data)
|
||||
{
|
||||
int written = Encoding.Unicode.GetBytes(textPtr, text.Length, data, 4096);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
17
Ryujinx.Common/GraphicsDriver/NVAPI/NvdrsApplicationV4.cs
Normal file
17
Ryujinx.Common/GraphicsDriver/NVAPI/NvdrsApplicationV4.cs
Normal file
|
@ -0,0 +1,17 @@
|
|||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Common.GraphicsDriver.NVAPI
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 4)]
|
||||
unsafe struct NvdrsApplicationV4
|
||||
{
|
||||
public uint Version;
|
||||
public uint IsPredefined;
|
||||
public NvapiUnicodeString AppName;
|
||||
public NvapiUnicodeString UserFriendlyName;
|
||||
public NvapiUnicodeString Launcher;
|
||||
public NvapiUnicodeString FileInFolder;
|
||||
public uint Flags;
|
||||
public NvapiUnicodeString CommandLine;
|
||||
}
|
||||
}
|
16
Ryujinx.Common/GraphicsDriver/NVAPI/NvdrsProfile.cs
Normal file
16
Ryujinx.Common/GraphicsDriver/NVAPI/NvdrsProfile.cs
Normal file
|
@ -0,0 +1,16 @@
|
|||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Common.GraphicsDriver.NVAPI
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
unsafe struct NvdrsProfile
|
||||
{
|
||||
public uint Version;
|
||||
public NvapiUnicodeString ProfileName;
|
||||
public uint GpuSupport;
|
||||
public uint IsPredefined;
|
||||
public uint NumOfApps;
|
||||
public uint NumOfSettings;
|
||||
}
|
||||
}
|
49
Ryujinx.Common/GraphicsDriver/NVAPI/NvdrsSetting.cs
Normal file
49
Ryujinx.Common/GraphicsDriver/NVAPI/NvdrsSetting.cs
Normal file
|
@ -0,0 +1,49 @@
|
|||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Common.GraphicsDriver.NVAPI
|
||||
{
|
||||
enum NvdrsSettingType : uint
|
||||
{
|
||||
NvdrsDwordType,
|
||||
NvdrsBinaryType,
|
||||
NvdrsStringType,
|
||||
NvdrsWstringType,
|
||||
}
|
||||
|
||||
enum NvdrsSettingLocation : uint
|
||||
{
|
||||
NvdrsCurrentProfileLocation,
|
||||
NvdrsGlobalProfileLocation,
|
||||
NvdrsBaseProfileLocation,
|
||||
NvdrsDefaultProfileLocation,
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Explicit, Size = 0x3020)]
|
||||
unsafe struct NvdrsSetting
|
||||
{
|
||||
[FieldOffset(0x0)]
|
||||
public uint Version;
|
||||
[FieldOffset(0x4)]
|
||||
public NvapiUnicodeString SettingName;
|
||||
[FieldOffset(0x1004)]
|
||||
public Nvapi SettingId;
|
||||
[FieldOffset(0x1008)]
|
||||
public NvdrsSettingType SettingType;
|
||||
[FieldOffset(0x100C)]
|
||||
public NvdrsSettingLocation SettingLocation;
|
||||
[FieldOffset(0x1010)]
|
||||
public uint IsCurrentPredefined;
|
||||
[FieldOffset(0x1014)]
|
||||
public uint IsPredefinedValid;
|
||||
|
||||
[FieldOffset(0x1018)]
|
||||
public uint PredefinedValue;
|
||||
[FieldOffset(0x1018)]
|
||||
public NvapiUnicodeString PredefinedString;
|
||||
|
||||
[FieldOffset(0x201C)]
|
||||
public uint CurrentValue;
|
||||
[FieldOffset(0x201C)]
|
||||
public NvapiUnicodeString CurrentString;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue