Jump to content
  • Advertisement
Sign in to follow this  
Syranide

D3DPOOL_DEFAULT vs D3DPOOL_MANAGED

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

Don't start, I know this is probably a very lame topic... but being stunned by the poor information I found about these made me a little curious. What set me off was really the fact that I expected D3DPOOL_DEFAULT to be faster or at least as fast as D3DPOOL_MANAGED for a texture... however, strange enough, I loose about 0.01ms (per frame) when rendering only two small batches. Have I missed something, should D3DPOOL_MANAGED really be faster? And, I'm curious to what D3DPOOL_DEFAULT and D3DPOOL_MANAGED really means, the DirectX-documentation sure explained some, but in my opinion was slightly vague to what it REALLY meant to use either of them. (mainly talking about textures) D3DPOOL_MANAGED is pretty much as it sounds I figure, it keeps a local system memory copy, and a videomemory/agpmemory texture which is used. And thus it saves you from having to recreate the textures when the device is lost. It also allows you to lock textures, because the texture in system memory is updated and then used to update the videomemory texture. D3DPOOL_DEFAULT is the basic behaviour, one copy on the videomemory/agpmemory, and that's it, if the device is lost, you need to do the hard work of creating the texture again. But, however, I'm uncertain, does this imply you have to release it from videomemory/agpmemory too in order to make sure there is free space? (ONLY D3DPOOL_MANAGED textures are automatically flushed?) So, the general idea between D3DPOOL_DEFAULT and D3DPOOL_MANAGED boils down to the fact that MANAGED are automatically evicted to make space and are kept stored in the local memory (thus eating some system memory)? Have I understood it all correctly, have I overlooked something important? Does anyone know why the D3DPOOL_MANAGED texture is faster than D3DPOOL_DEFAULT texture? If anyone has information that would too be very appreciated, however, unable to find any satisfying myself.

Share this post


Link to post
Share on other sites
Advertisement
Ok I am far from an expert, but here is my understanding of it: D3DPOOL_MANAGED keeps a local system memory copy (the overhead of this I would guess is where your performance loss comes from). Rather than to recreate the textures on devide loss, the main purpose of this is so that you can read from the resource as well as write from it. AGP memory is fast to write to, but painfully slow to read from.

So if you don't plan on reading from the resource (vertex buffer, texture or whatever) then you should user D3DPOOL_DEFAULT, if you do need to read from it use D3DPOOL_MANAGED.

Share this post


Link to post
Share on other sites
Quote:
Original post by waferthinninja
Ok I am far from an expert, but here is my understanding of it: D3DPOOL_MANAGED keeps a local system memory copy (the overhead of this I would guess is where your performance loss comes from). Rather than to recreate the textures on devide loss, the main purpose of this is so that you can read from the resource as well as write from it. AGP memory is fast to write to, but painfully slow to read from.

So if you don't plan on reading from the resource (vertex buffer, texture or whatever) then you should user D3DPOOL_DEFAULT, if you do need to read from it use D3DPOOL_MANAGED.


However the situation is the other way around, D3DPOOL_MANAGED is faster for my current operations.

EDIT: ooops, just came to mind about trying on the RETAIL version of Direc3D, and then it went the other way, D3DPOOL_DEFAULT was slightly faster. However, I'm still curios of whether D3DPOOL_DEFAULT are automatically evicted or you do need to do it yourself, I would sure sound strange if they were evicted (where would they go) ... but I want to make sure as it really is important not to be mistaken about it.

Share this post


Link to post
Share on other sites
You need to manually release all non-managed resources before resetting the device (after it's been lost), which would then evict any hardware allocations. If not, resetting the device will fail.

Share this post


Link to post
Share on other sites
Quote:
Original post by c2_0
You need to manually release all non-managed resources before resetting the device (after it's been lost), which would then evict any hardware allocations. If not, resetting the device will fail.


Uhm, what I was referring to was during common use, not for device resets... that is, if you create 512 MBs of D3DPOOL_DEFAULT resources on a 256 MBs card, what will happen, out of memory? Will it evict the other resources?

As far as I could tell from the documentation, what's put in the videomemory stays there until it has been released, is this how it really is? (unlike D3DPOOL_MANAGED which is released from videomemory when space is needed and then created again when needed)

Share this post


Link to post
Share on other sites
Quote:
Original post by Syranide
Uhm, what I was referring to was during common use, not for device resets... that is, if you create 512 MBs of D3DPOOL_DEFAULT resources on a 256 MBs card, what will happen, out of memory? Will it evict the other resources?


DEFAULT resources need to be managed by you. Trying to create 512MB of DEFAULT resources on a 256MB card (ignoring AGP memory) will fail. You'll need to swap resources in and out of memory as needed, which basically is emulating the functionality of MANAGED resources.

In general, use MANAGED. Use DEFAULT when required (for example, DYNAMIC textures).

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!