PDA

View Full Version : querying AGP memory



clunis_immensus
03-04-2005, 05:08 AM
Greetings,

I looked at earlier posts on the issue, and tried using DirectX to query available video memory.
These are the numbers I get:

For my 256MB GeForce 6800:
GetAvailableVidMem: total = 256901120 free = 256852992
AvailableTextureMem = 448790528
That seems OK.

But, for my 128MB ATI FireGL3100 card:
GetAvailableVidMem: total =
654180320 free = 654180320
GetAvailableTextureMem(): 654311424
That's around 624 MB!

I am only interested in knowing whether the card is a 64/128/256 model. I don't care how much is available for use etc.

thanks,
Maniam

My code:
------
LPDIRECTDRAW lpdd = NULL;
LPDIRECTDRAW7 lpdd7 = NULL;
DDSCAPS2 ddsCaps2;
DWORD dwTotal;
DWORD dwFree;
HRESULT hr;

ZeroMemory(&ddsCaps2, sizeof(ddsCaps2));
ddsCaps2.dwCaps = DDSCAPS_OFFSCREENPLAIN;
hr = lpdd7->GetAvailableVidMem(&ddsCaps2, &dwTotal, &dwFree);

g_pD3D = Direct3DCreate9(D3D_SDK_VERSION);
D3DPRESENT_PARAMETERS d3dpp;
ZeroMemory( &d3dpp, sizeof(d3dpp) );
d3dpp.Windowed = TRUE;
d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
d3dpp.BackBufferFormat = D3DFMT_UNKNOWN;

if( FAILED( g_pD3D->CreateDevice( D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd,
D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &g_pd3dDevice ) ) )
{
return E_FAIL;
}

DDSCAPS2 ddsVidMemcaps;
ZeroMemory(&ddsVidMemcaps, sizeof(DDSCAPS2));
ddsVidMemcaps.dwCaps = DDSCAPS_VIDEOMEMORY;
int AvailableTextureMem = g_pd3dDevice->GetAvailableTextureMem();

rgpc
03-05-2005, 08:30 PM
OMG! Now I seem to have ventured into the DirectX forum! What's going on? Anyone know where the Advance Opengl forum is?

V-man
03-06-2005, 03:53 PM
OK, this is becoming tiresome.

clunis_immensus, visit gamedev.net, flipcode.com or whatever else you want. There are specific forums for DirectX programming.

No, there is no way to query this with GL.

clunis_immensus
03-07-2005, 06:10 AM
Originally posted by V-man:
OK, this is becoming tiresome.

clunis_immensus, visit gamedev.net, flipcode.com or whatever else you want. There are specific forums for DirectX programming.

No, there is no way to query this with GL.My apologies if the post was not GL-related.

However, given the number of (unresolved) posts on this topic in this newsgroup, it seems many of us would like to know how to deal with this issue in our *OpenGL* applications.
Thanks for the recommended URLs, I will try there.

best regards,
Maniam

knackered
03-08-2005, 03:13 AM
why doesn't someone just wrap that bit of dx code up into a wgl extension to shut everybody up?

zed
03-08-2005, 08:39 AM
shut everybody up?as if thats gonna work!
theres a nvidia app that queries the amount of agp memory called agpmem.exe perhap u can find the source, sdl also has a function to see how much mem the card has