Skip to main content
gamedev.net
🔒 Locked

Texture loading and Memory

Started by littlekid 0 replies 400+ views
Original Post
littlekid
littlekid
Everytime I create a IDirect3DTexture9*, will the loaded texture be place straight into the GPU memory, or just the normal computer RAM? Or is it that only when I set the texture in the effect and and call pEffect->Begin, or use pDevice->SetTexture() then the texture is loaded into the GPU memory from the RAM
sirob
sirob
Where textures are placed depends on a few factors, most importantly, the Pool used when creating the texture. Textures created in the SystemMem pool will always be placed in the system's RAM. In most cases, textures created in the Default pool will be placed in GPU memory (though not always). Managed memory has a System Memory copy, and might have a GPU memory copy if the driver thinks it should (if it was used recently or there is memory available).

For best results, the Managed pool is recommended, unless you won't be using the texture for rendering, or you need the texture to be a Render Target.

Memory is allocated when the texture is initially created. This allows you to render without moving data around between the GPU and CPU during a frame.

Hope this helps.
Sirob Yes.» - status: Work-O-Rama.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.