Skip to main content
gamedev.net
🔒 Locked

D3DPOOL_DEFAULT

Started by greldik Apr 9, 2005 at 8:37 AM 0 replies 750+ views
Original Post
greldik
greldik
It's not clear from the documentation whether DX uploads D3DPOOL_DEFAULT resources to video memory _when they are used_. Quotues from the documentation "D3DPOOL_DEFAULT Resources are placed in the memory pool most appropriate (...)" "When creating resources with D3DPOOL_DEFAULT, if video card memory is already committed, managed resources will be evicted to free enough memory (...)" So let's say that video mem is filled with D3DPOOL_DEFAULT resources and another D3DPOOL_DEFAULT texture is activated. How will DX handle that texture at that point? // Martin
circlesoft
circlesoft
Quote:
Original post by greldik
It's not clear from the documentation whether DX uploads D3DPOOL_DEFAULT resources to video memory _when they are used_.

IIRC, the memory for a D3DPOOL_DEFAULT resource is allocated upon it's creation. That resource gets updated when you make a function call like IDirect3D*Buffer9::Lock/Unlock(), or IDirect3DTexture9::Lock/UnlockRect(). This means that the resources isn't uploaded upon first use, but rather, right after it's updated. This prevents unexpected lag during the first rendering frames.

Quote:
So let's say that video mem is filled with D3DPOOL_DEFAULT resources and another D3DPOOL_DEFAULT texture is activated. How will DX handle that texture at that point?

The *Create*() call should return D3DERR_OUTOFVIDEOMEMORY.

Topic Locked

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

Sign in to reply to this topic.