Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

How do I get the video memory?

This topic is 5236 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

In directx 7 it was easy to get the memory with the DDCAPS structure on the device. But I have a hard time finding a similar way to find it in DirectX 9. I want to know how much memory there is in total on the video card, and how much is being used. Does anyone have an easy way to do that? I see that the windows system can see the total video memory if you look under "Display Properties->Settings->Advanced->Adapter". Thus, there must be some kind of function to call to get this.

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
IDirect3DDevice9::GetDeviceCaps Method.
Retrieves the capabilities of the rendering device.
HRESULT GetDeviceCaps(D3DCAPS9 *pCaps);

I''m not sure if the D3DCAPS9 structure contains the same type of info as DDCAPS though.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Maybe this helps ?

IDirect3DDevice9::GetAvailableTextureMem Method
Returns an estimate of the amount of available texture memory.

UINT GetAvailableTextureMem(VOID);

Return Value
The function returns an estimate of the available texture memory.

Remarks
The returned value is rounded to the nearest MB. This is done to reflect the fact that video memory estimates are never precise due to alignment and other issues that affect consumption by certain resources.

Share this post


Link to post
Share on other sites
D3DCAPS9 structure has nothing on the memory.

I tried the GetAvailableTextureMem() also, but it shows 369 MB on my machine, and my video memory is only 128 MB

The 369 is pretty close to my system mem though...

I have trawled through the entire Microsoft site, and I tried with google also, but nothing came up so far

Share this post


Link to post
Share on other sites
There''s no accurate, works-in-all-situations way to get the video memory in D3D8/9, as far as I recall. For details, see the threads:
- "Using IDXDiag/WMI to get video memory size"
- "Using WMI to get video memory"
- "detecting amount of on- board video memory"
on the DIRECTXDEV mailing list (archives here)

- GetAvailableTextureMemory() is unreliable, because many drivers include AGP memory in the calculation.

Muhammad Haggag

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!