Hello,
the procedure wglGetGPUInfoAMD will always fail if no call was made to wglGetGPUIDsAMD.
example:
// retrieve the id of the device from the current context
gpuId = wglGetContextGPUIDAMD(currentContext);
// retrieve the amount of ram
UINT gpuMem = 0;
wglGetGPUInfoAMD(gpuId, WGL_GPU_RAM_AMD, GL_UNSIGNED_INT, sizeof(UINT), &gpuMem); // return -1
the above code will alway fail. you must add a call to wglGetGPUIDsAMD
this code will work:
// non sense call
wglGetGPUIDsAMD(0, 0);
// retrieve the id of the device from the current context
gpuId = wglGetContextGPUIDAMD(currentContext);
// retrieve the amount of ram
UINT gpuMem = 0;
wglGetGPUInfoAMD(gpuId, WGL_GPU_RAM_AMD, GL_UNSIGNED_INT, sizeof(UINT), &gpuMem);
is wglGetGPUIDsAMD do any kind of initializations that wglGetContextGPUIDAMD does not ? the spec file has no words about it.
my specs:
windows seven x64 (same behavior apply on 32 bits)
ati radeon hd 5770
catalyst 12.6
thanks.
Hi,
Thanks for the report. Indeed, the call to wglGetGPUIDsAMD shouldn't be necessary. I'm glad you found a workaround, though. We'll look into it.
Cheers,
Graham