mirror of
https://github.com/flightlessmango/MangoHud.git
synced 2024-11-10 01:10:27 +00:00
[Win32] Check adl and nvapi if either works
This commit is contained in:
parent
8bc64efa25
commit
2273cd30a4
@ -192,6 +192,7 @@ int initializeADL()
|
||||
// Get the AdapterInfo structure for all adapters in the system
|
||||
ADL_Adapter_AdapterInfo_Get(lpAdapterInfo, sizeof(AdapterInfo)* iNumberAdapters);
|
||||
}
|
||||
printf("num adapters: %i", iNumberAdapters);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -29,7 +29,7 @@ struct gpuInfo{
|
||||
};
|
||||
|
||||
extern struct gpuInfo gpu_info;
|
||||
|
||||
extern bool init_adl;
|
||||
// Nvidia linux
|
||||
void getNvidiaGpuInfo(void);
|
||||
void getAmdGpuInfo(void);
|
||||
@ -37,3 +37,4 @@ void getAmdGpuInfo(void);
|
||||
// Amd windows
|
||||
int query_adl(void);
|
||||
uint32_t adl_vendorid(void);
|
||||
int initializeADL(void);
|
@ -6,6 +6,7 @@ extern nvmlDevice_t nvidiaDevice;
|
||||
extern struct nvmlUtilization_st nvidiaUtilization;
|
||||
extern struct nvmlMemory_st nvidiaMemory;
|
||||
extern bool nvmlSuccess;
|
||||
extern bool init_nvapi_bool;
|
||||
|
||||
bool checkNVML(const char* pciBusId);
|
||||
bool checkNVAPI(void);
|
||||
|
@ -808,6 +808,13 @@ void init_gpu_stats(uint32_t& vendorID, overlay_params& params)
|
||||
// NVIDIA or Intel but maybe has Optimus
|
||||
#ifdef _WIN32
|
||||
bool nvSuccess = (checkNVML(nullptr) && getNVMLInfo());
|
||||
init_adl = initializeADL();
|
||||
init_nvapi_bool = checkNVAPI();
|
||||
if(init_adl)
|
||||
vendorID == 0x1002;
|
||||
if(init_nvapi_bool)
|
||||
vendorID == 0x10de;
|
||||
printf("amd : %i", init_adl);
|
||||
#endif
|
||||
|
||||
#ifdef __gnu_linux__
|
||||
|
Loading…
Reference in New Issue
Block a user