Jump to content
  • Advertisement
Sign in to follow this  
kovacsp

Video memory fragmentation

This topic is 5052 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

Hi, How can I defragment video memory? Yes, I know, I should free everything, then allocate again, but is there a better solution? And another one: If I want to avoid fragmentation (and maybe gain some fps) and want to use textures with 2^x size, does it help if I do eg. 256x512 textures? I know, I do not have to keep the exact aspect ratio, but in case of originally eg. 100x500 textures I shouldn't force neither 512x512 nor 128x128. And one more: When loading a texture, and getting info about it, I always get sizes that say it's 2^x (the upper one, and always same x and y). Does this mean that D3DXLoadTextureFromFile resizes my textures on the fly? In this case, I shouldn't resize my textures by hand, right? Or does it pad it? Thanks, Peter

Share this post


Link to post
Share on other sites
Advertisement
Nowadays the video memory layout is pretty much hidden from you. The graphics could be on the card or in AGP memory Direct3D and the card driver sort it all out. There is a call EvictManagedResources() that may help.

D3DXLoadTextureFromFile converts a texture to one supported by your video card. So if your card can only do power of 2 textures the function will convert them on load. I would be tempted to make your textures the right size to start with - if nothing else it will speed up loading.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!