romb

wglGetGPUInfoAMD behavior

Discussion created by romb on Aug 13, 2012
Latest reply on Aug 27, 2012 by gsellers

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.

Outcomes