Search code examples
directxtexture-mappingdirect3d11

Preload texture to GPU memory in D3D11


How I can preload updated managed 2D texture to GPU memory in Direct3D11?

In Direct3D9 I called IDirect3DBaseTexture9::PreLoad to guarantee that texture will be ready for rendering.


Solution

  • Direct3D9Ex and Direct3D 10 through DirectX 12 has no concept of D3DPOOL_MANAGED. This is because these versions of Direct3D do not have "lost device" in the sense that Direct3D 9 did. They only have "device removed" which happens when the GPU crashes or the driver is updated while your game/app is running. See Microsoft Docs.

    Starting in Windows Vista, Video Memory is managed by the OS. Textures are paged in and out of video memory, and backed by system memory automatically. You can provide hints by using the SetEvictionPriority method.