Fix incorrectly translated NVAPI ABI

This commit is contained in:
Dan Balasescu 2024-11-09 15:09:20 +09:00
parent df0d51cbbc
commit 8d7b19d6cf
No known key found for this signature in database
1 changed files with 11 additions and 6 deletions

View File

@ -258,11 +258,9 @@ private static bool createProfile(out IntPtr profileHandle)
Version = NvProfile.Stride, Version = NvProfile.Stride,
IsPredefined = 0, IsPredefined = 0,
ProfileName = PROFILE_NAME, ProfileName = PROFILE_NAME,
GPUSupport = new uint[32] GpuSupport = NvDrsGpuSupport.Geforce
}; };
newProfile.GPUSupport[0] = 1;
if (checkError(CreateProfile(sessionHandle, ref newProfile, out profileHandle), nameof(CreateProfile))) if (checkError(CreateProfile(sessionHandle, ref newProfile, out profileHandle), nameof(CreateProfile)))
return false; return false;
@ -463,9 +461,7 @@ internal struct NvProfile
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = NVAPI.UNICODE_STRING_MAX)] [MarshalAs(UnmanagedType.ByValTStr, SizeConst = NVAPI.UNICODE_STRING_MAX)]
public string ProfileName; public string ProfileName;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] public NvDrsGpuSupport GpuSupport;
public uint[] GPUSupport;
public uint IsPredefined; public uint IsPredefined;
public uint NumOfApps; public uint NumOfApps;
public uint NumOfSettings; public uint NumOfSettings;
@ -611,6 +607,7 @@ internal enum NvStatus
SYNC_NOT_ACTIVE = -194, // The requested action cannot be performed without Sync being enabled. 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. 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. 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_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. 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. FIRMWARE_OUT_OF_DATE = -199, // The device's firmware is out of date.
@ -749,4 +746,12 @@ internal enum NvThreadControlSetting : uint
OGL_THREAD_CONTROL_NUM_VALUES = 2, OGL_THREAD_CONTROL_NUM_VALUES = 2,
OGL_THREAD_CONTROL_DEFAULT = 0 OGL_THREAD_CONTROL_DEFAULT = 0
} }
[Flags]
internal enum NvDrsGpuSupport : uint
{
Geforce = 1 << 0,
Quadro = 1 << 1,
Nvs = 1 << 2
}
} }