[MDX] device.Dispose() taking up to 4 seconds?

Started by
0 comments, last by ViLiO 17 years, 8 months ago
Hi, I'm writing a D3D game in MDX. I added post-processing shader effects last night, and now my device.Dispose() is taking up to 4 seconds... I'm using a bunch of surfaces for post processing, but should it really take that long just to dispose all that? Anyone had a similar perf problem and want to share their solution? :) Thanks, David
Advertisement
It could be that your surfaces are not getting cleaned up by the GC and get promoted to higher levels. For instance, if you were to call something like ...
Surface originalSurface = device.GetRenderTarget(0);
...every frame and not explicitly dispose that surface once you have restored it as your rendertarget (or put it in a using) it will survive GC collections and the memory it occupies will essentially leak.

Regards,
ViLiO
Richard 'ViLiO' Thomasv.net | Twitter | YouTube

This topic is closed to new replies.

Advertisement