|
Post by u9 on Jul 1, 2007 20:06:44 GMT -5
It would be nice to be able to read the available graphics memory so one can keep track of the usage. I'm seeing some strange effects on my old laptop (16MB gfx ram) so i am wondering if i have used it all.
|
|
|
Post by Guilect on Jul 2, 2007 17:26:29 GMT -5
I added a command graphics.getmem
using this DirectX command:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Microsoft DirectX 8.1 (C++) IDirect3DDevice8::GetAvailableTextureMem Returns an estimate of the amount of available texture memory.
UINT GetAvailableTextureMem();
Parameters None.
Return Values 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. Applications can use this value to make gross estimates of memory availability to make large-scale resource decisions such as how many levels of a mipmap to attempt to allocate, but applications cannot use this value to make small-scale decisions such as if there is enough memory left to allocate another resource. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
When I call this function I get a value that is just less than the memory on my video card. Ok, looks good so far. If I call this function again, after loading in 2 big images, I get the EXACT same value back. Exact.
So I know how to find the total possible memory but, not the currently available.
This still is of some use, if you query it and find the PC only has 4 Meg of video ram then you run your program one way, but if it has 64 Meg you run it another way.
If anyone know how to get the currently available memory let me know.
|
|