Archived

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

Axiverse

Textures from ram to graphics card

Recommended Posts

Yes, most of the time. Both OpenGL and D3D have support for managing where textures reside and how they get to the video card.

They will also do all that for you if you prefer not to do it yourself.

Share this post


Link to post
Share on other sites
It depends on what you''re using the textures for. If you have textures that are used to render meshes, then you should put them into videom memory. If you put them into system memory, D3D will have to copy them to video memory, render the mesh, and then delete it, every frame.

What JohnBolton is talking about is the ability to create resources (textures in this case) in D3D''s MANAGED memory pool. Creating resources in this pool creates two copies of the item. One will be in video memory and the other will be in system memory. So when you draw a mesh that uses MANAGED memory textures, the mesh will render with the copy of the texture in video memory. If you need to change the contents of a texture by calling Lock, D3D will give you access to the system memory copy. When you''re done making your changes, the system memory texture is copied on top of the video memory texture.

By creating resources in the MANAGED memory pool, you allow D3D to decide which textures should reside in video memory at any given time. This is a good thing. D3D will see which textures are being used the most often and will place those textures in video memory. Any other textures will also be placed in video memory if there is enough memory left. If not, D3D will move textures back and forth between video and system memory so that your most used resources are always in video memory as often as possible.

neneboricua

Share this post


Link to post
Share on other sites