Forcibly enable threaded optimization on boot.
This commit is contained in:
parent
b1c3e01691
commit
1239c82d2f
8 changed files with 327 additions and 3 deletions
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue