Skip to content

Commit

Permalink
Fix incorrectly translated NVAPI ABI
Browse files Browse the repository at this point in the history
  • Loading branch information
smoogipoo committed Nov 9, 2024
1 parent df0d51c commit 8d7b19d
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions osu.Desktop/NVAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -258,11 +258,9 @@ private static bool createProfile(out IntPtr profileHandle)
Version = NvProfile.Stride,
IsPredefined = 0,
ProfileName = PROFILE_NAME,
GPUSupport = new uint[32]
GpuSupport = NvDrsGpuSupport.Geforce
};

newProfile.GPUSupport[0] = 1;

if (checkError(CreateProfile(sessionHandle, ref newProfile, out profileHandle), nameof(CreateProfile)))
return false;

Expand Down Expand Up @@ -463,9 +461,7 @@ internal struct NvProfile
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = NVAPI.UNICODE_STRING_MAX)]
public string ProfileName;

[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public uint[] GPUSupport;

public NvDrsGpuSupport GpuSupport;
public uint IsPredefined;
public uint NumOfApps;
public uint NumOfSettings;
Expand Down Expand Up @@ -611,6 +607,7 @@ internal enum NvStatus
SYNC_NOT_ACTIVE = -194, // The requested action cannot be performed without Sync being enabled.
SYNC_MASTER_NOT_FOUND = -195, // The requested action cannot be performed without Sync Master being enabled.
INVALID_SYNC_TOPOLOGY = -196, // Invalid displays passed in the NV_GSYNC_DISPLAY pointer.

ECID_SIGN_ALGO_UNSUPPORTED = -197, // The specified signing algorithm is not supported. Either an incorrect value was entered or the current installed driver/hardware does not support the input value.
ECID_KEY_VERIFICATION_FAILED = -198, // The encrypted public key verification has failed.
FIRMWARE_OUT_OF_DATE = -199, // The device's firmware is out of date.
Expand Down Expand Up @@ -749,4 +746,12 @@ internal enum NvThreadControlSetting : uint
OGL_THREAD_CONTROL_NUM_VALUES = 2,
OGL_THREAD_CONTROL_DEFAULT = 0
}

[Flags]
internal enum NvDrsGpuSupport : uint
{
Geforce = 1 << 0,
Quadro = 1 << 1,
Nvs = 1 << 2
}
}

0 comments on commit 8d7b19d

Please sign in to comment.