aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorriperiperi <rhy3756547@hotmail.com>2021-04-07 18:15:17 +0100
committerriperiperi <rhy3756547@hotmail.com>2021-04-18 17:34:00 +0100
commitd6547abebf4fc1c6fd80b95f8baa0084f324982d (patch)
tree5f90c2d9bbdf5a0aeab1d53c5122f4d9539a7c72
parent1239c82d2f2fa59a42561a4a278a9cdca5eca462 (diff)
Use IntPtr for handles, remove unsafe keyword
-rw-r--r--Ryujinx.Common/GraphicsDriver/NVThreadedOptimization.cs22
1 files changed, 11 insertions, 11 deletions
diff --git a/Ryujinx.Common/GraphicsDriver/NVThreadedOptimization.cs b/Ryujinx.Common/GraphicsDriver/NVThreadedOptimization.cs
index fee8336c..ad223631 100644
--- a/Ryujinx.Common/GraphicsDriver/NVThreadedOptimization.cs
+++ b/Ryujinx.Common/GraphicsDriver/NVThreadedOptimization.cs
@@ -25,28 +25,28 @@ namespace Ryujinx.Common.GraphicsDriver
private delegate int NvAPI_InitializeDelegate();
private static NvAPI_InitializeDelegate NvAPI_Initialize;
- private delegate int NvAPI_DRS_CreateSessionDelegate(out long handle);
+ private delegate int NvAPI_DRS_CreateSessionDelegate(out IntPtr handle);
private static NvAPI_DRS_CreateSessionDelegate NvAPI_DRS_CreateSession;
- private delegate int NvAPI_DRS_LoadSettingsDelegate(long handle);
+ private delegate int NvAPI_DRS_LoadSettingsDelegate(IntPtr handle);
private static NvAPI_DRS_LoadSettingsDelegate NvAPI_DRS_LoadSettings;
- private delegate int NvAPI_DRS_FindProfileByNameDelegate(long handle, NvapiUnicodeString profileName, out long profileHandle);
+ private delegate int NvAPI_DRS_FindProfileByNameDelegate(IntPtr handle, NvapiUnicodeString profileName, out IntPtr profileHandle);
private static NvAPI_DRS_FindProfileByNameDelegate NvAPI_DRS_FindProfileByName;
- private delegate int NvAPI_DRS_CreateProfileDelegate(long handle, ref NvdrsProfile profileInfo, out long profileHandle);
+ private delegate int NvAPI_DRS_CreateProfileDelegate(IntPtr handle, ref NvdrsProfile profileInfo, out IntPtr profileHandle);
private static NvAPI_DRS_CreateProfileDelegate NvAPI_DRS_CreateProfile;
- private delegate int NvAPI_DRS_CreateApplicationDelegate(long handle, long profileHandle, ref NvdrsApplicationV4 app);
+ private delegate int NvAPI_DRS_CreateApplicationDelegate(IntPtr handle, IntPtr profileHandle, ref NvdrsApplicationV4 app);
private static NvAPI_DRS_CreateApplicationDelegate NvAPI_DRS_CreateApplication;
- private delegate int NvAPI_DRS_SetSettingDelegate(long handle, long profileHandle, ref NvdrsSetting setting);
+ private delegate int NvAPI_DRS_SetSettingDelegate(IntPtr handle, IntPtr profileHandle, ref NvdrsSetting setting);
private static NvAPI_DRS_SetSettingDelegate NvAPI_DRS_SetSetting;
- private delegate int NvAPI_DRS_SaveSettingsDelegate(long handle);
+ private delegate int NvAPI_DRS_SaveSettingsDelegate(IntPtr handle);
private static NvAPI_DRS_SaveSettingsDelegate NvAPI_DRS_SaveSettings;
- private delegate int NvAPI_DRS_DestroySessionDelegate(long handle);
+ private delegate int NvAPI_DRS_DestroySessionDelegate(IntPtr handle);
private static NvAPI_DRS_DestroySessionDelegate NvAPI_DRS_DestroySession;
private static bool _initialized;
@@ -85,7 +85,7 @@ namespace Ryujinx.Common.GraphicsDriver
return (uint)Unsafe.SizeOf<T>() | version << 16;
}
- public static unsafe void SetThreadedOptimization(bool enabled)
+ public static void SetThreadedOptimization(bool enabled)
{
Initialize();
@@ -93,11 +93,11 @@ namespace Ryujinx.Common.GraphicsDriver
Check(NvAPI_Initialize());
- Check(NvAPI_DRS_CreateSession(out long handle));
+ Check(NvAPI_DRS_CreateSession(out IntPtr handle));
Check(NvAPI_DRS_LoadSettings(handle));
- long profileHandle;
+ IntPtr profileHandle;
// Check if the profile already exists.