   force to swap the texture from system memory to video memory
  If my video memry is too small to put all textures I need, so I load those textures into system memory by D3DPOOL_MANAGED or D3DPOOL_DEFAULT. When my DirectX application want to render certain texture, how do I swap the memory of the texture from system meory to video memory?   
Quote:Original post by akira32If my video memry is too small to put all textures I need, so I load those textures into system memory by D3DPOOL_MANAGED or D3DPOOL_DEFAULT. When my DirectX application want to render certain texture, how do I swap the memory of the texture from system meory to video memory?DirectX will do it for you, if you are using D3DPOOL_MANAGED. (If you are using D3DPOOL_DEFAULT and the memory is not enough the game will crash because a texture created with that flag will live ONLY on the graphic card memory)   ;Quote:Original post by feal87DirectX will do it for you, if you are using D3DPOOL_MANAGED. (If you are using D3DPOOL_DEFAULT and the memory is not enough the game will crash because a texture created with that flag will live ONLY on the graphic card memory)Er ... no of course it won't crash. D3DPOOL_DEFAULT has other implications, most notably the following ones:Quote:Original post by MSDN DX DocuThis is usually video memory, including both local video memory and AGP memory. The D3DPOOL_DEFAULT pool is separate from D3DPOOL_MANAGED and D3DPOOL_SYSTEMMEM, and it specifies that the resource is placed in the preferred memory for device access. [...] When creating resources with D3DPOOL_DEFAULT, if video card memory is already committed, managed resources will be evicted to free enough memory to satisfy the request.If you run out of VRAM the driver moves resources from VRAM to SYSRAM to allocate VRAM space. During runtime it then needs to upload resources to VRAM if they are not present there already. If you run out of VRAM you will notice a slow down due to the driver moving resources around but you won't crash.read more about pool valuesTo OP:Using the MANAGED flag does the following: It creates one copy of the resource in SYSMEM and one in DEFAULT (should be VRAM but does not have to be). That makes accessing the resource for reads and writes more efficient but wastes more SYSMEM. You should only use MANAGED resources if you are going to access the resource frequently for read back or for writing other data to it. Another advantage of MANAGED is that DX can take care of re-creating the resource automatically upon DEVICE LOST. For DEFAULT resources you have to recreate them upon DEVICE LOST on your own.   ;  I thought i remember some crash when going over the limit of the GPU with the DEFAULT pool, but if you say so...i'm not sure 100% as nowadays its pretty difficult going over the gpu available memory and i have no tests available. ;D   