Jump to content
  • Advertisement
Sign in to follow this  
tonymontana

Lost Devices and D3DXCreateTextureFromFileEx

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

Before we reset device we release() our textures...and after it we recreate them...(ofcourse only resources created with D3DPOOL_DEFAULT ..render target etc..) I suddenly realized that the time elapsed between them resetting device and reacquiring my textures/surfaces takes more than the games i play.(maybe 1-2 seconds more).I thinks this is because every time i reset device i am using D3DXCreateTextureFromFileEx to recreate my texture from FILE (which means disk access and slow operation).does loading texture to memory first and then creating texture with D3DXCreateTextureFromFileInMemory() decrease time delay? I mean what is the best way of loading textures/surfaces for waiting lesser in Lost device..(I want to fix my texture manager accordingly)

Share this post


Link to post
Share on other sites
Advertisement
There's nothing DirectX specific about disk-access being slow. Just a simple fact of how most modern computers work - HDD access is an order of magnitude slower than RAM....

Storing a copy of the data in memory and then using D3DXCreateTextureFromFileInMemory() would probably be faster on a device-reset scenario. The downside is that you'd need to maintain that system memory copy for the lifetime of the DEFAULT texture - regardless of whether you lose the device or not. The other part that makes it pointless is that you're gonna end up with something very similar to a MANAGED pool resource [lol]

Why re-invent the wheel when Microsoft already provided you with the feature? [smile]

The Direct3D and driver resource-managers should be pretty efficient. Apart from some isolated cases I've never really come across any good reason to not rely on them.

Render targets need to be created in the default pool, but a simple input texture/vb/ib doesn't NEED to be the in the default pool. Why not just move them to managed and leave it at that?

hth
Jack

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!