Fixed: Usage of wglEnumGpuDevicesNV

This commit is contained in:
kervala 2016-06-14 19:34:43 +02:00
parent 0734682f3d
commit 94ef359129

View file

@ -1991,24 +1991,29 @@ bool registerWGlExtensions(CGlExtensions &ext, HDC hDC)
if (ext.WGLNVGPUAffinity) if (ext.WGLNVGPUAffinity)
{ {
uint i = 0; uint gpuIndex = 0;
HGPUNV hGPU; HGPUNV hGPU;
while(nwglEnumGpusNV(i, &hGPU)) // list all GPUs
while (nwglEnumGpusNV(gpuIndex, &hGPU))
{ {
uint j = 0; uint j = 0;
PGPU_DEVICE lpGpuDevice = NULL; _GPU_DEVICE gpuDevice;
gpuDevice.cb = sizeof(gpuDevice);
while(nwglEnumGpuDevicesNV(hGPU, j, lpGpuDevice)) // list all devices connected to GPU
while(nwglEnumGpuDevicesNV(hGPU, j, &gpuDevice))
{ {
nlinfo("Device: %s - %s - flags: %u", lpGpuDevice->DeviceName, lpGpuDevice->DeviceString, lpGpuDevice->Flags); nlinfo("Device: %s - %s - flags: %u - rect: (%u,%u)-(%u,%u)", gpuDevice.DeviceName, gpuDevice.DeviceString, (uint)gpuDevice.Flags,
(uint)gpuDevice.rcVirtualScreen.left, (uint)gpuDevice.rcVirtualScreen.top,
(uint)gpuDevice.rcVirtualScreen.right, (uint)gpuDevice.rcVirtualScreen.bottom);
++j; ++j;
} }
++i; ++gpuIndex;
} }
} }