How to get data from render-target when device is lost?
#1 Members - Reputation: 101
Posted 12 February 2012 - 08:54 AM
"Failing copy from video-memory surface to system-memory or managed surface because device is lost. UpdateSurface returns D3DERR_DEVICELOST"
Is there another way to restore the D3DPOOL_DEFAULT resources after a device losing?
#3 Members - Reputation: 3830
Posted 12 February 2012 - 02:51 PM
It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.
#4 Members - Reputation: 101
Posted 12 February 2012 - 09:52 PM
Thank you. But how could the program predict the device's losing? Or just copy the data every frame? It seems not so efficient.Once you lose the device, you lose all of your render targets. You would have to copy the data before you lose the device.
Because those render targets are used for saving states of a GPU-based particle system. I think it'll be weird when all particles are disappeared or reseted at their initial position or other states after a device' losing.Why not just re-render what was originally rendered into your render targets?
#5 Moderators - Reputation: 5487
Posted 13 February 2012 - 12:19 AM
Thank you. But how could the program predict the device's losing? Or just copy the data every frame? It seems not so efficient.
I don't think you can in a reliable manner. You can detect a focus change, but I don't know if the device will already be considered "lost" at that point.
If you want, you can detect if your app is running on Vista or Win7 and create D3D9Ex interfaces. If you use those, you won't get a lost device scenario. Doesn't help you for at all for XP, obviously.
#6 Members - Reputation: 101
Posted 13 February 2012 - 11:12 PM
Thank you. As a matter of fact, losing device is not an usual thing, and I think most people would ignored the resetting of particles after that case, so I'd better ignore this problem too.
Thank you. But how could the program predict the device's losing? Or just copy the data every frame? It seems not so efficient.
I don't think you can in a reliable manner. You can detect a focus change, but I don't know if the device will already be considered "lost" at that point.
If you want, you can detect if your app is running on Vista or Win7 and create D3D9Ex interfaces. If you use those, you won't get a lost device scenario. Doesn't help you for at all for XP, obviously.






