George112

Is it possible to get the free or the used VGA memory somehow in Xna
like device.AvailableTextureMemory in MDX or
GetAvailableTextureMem().

If it is not possible in the XNA framework, can I extract the "native DX device pointer" from XNA and pass it to the C++ DirectX dll and ask GetAvailableTextureMem() with PInvoke

Thanks,
George




Re: XNA Framework device.AvailableTextureMemory somehow?

Jim Perry

What's your ultimate goal in doing this if I may ask




Re: XNA Framework device.AvailableTextureMemory somehow?

George112

I just want to show the used texture memory as a statistics about the current state of the program. Like the Fps statistics (or the number of triangles) that is usually displayed on the top of the screen.




Re: XNA Framework device.AvailableTextureMemory somehow?

Shawn Hargreaves - MSFT

Used and available video memory is actually a tough question to answer on modern hardware. Even if you do have access to the API the return value can be surprisingly random at times!

For instance on Xbox, the unified memory architecture means any kind of CPU data structure allocation would affect the amount of free texture memory.

On Windows, increasingly many cards are using AGP memory to stream or cache textures. So you may be able to create far more textures than would physically fit into video memory, or perhaps may see only a tiny portion of the video memory being used even after creating a lot of large textures.

This makes it very hard to give a meaningful answer to questions like "how much space is actually left".