Am Donnerstag, 19. Juli 2007 00:13 schrieb H. Verbeet:
On 18/07/07, Stefan Dösinger stefan@codeweavers.com wrote:
This code does not really have a home. For one part the device is in charge of managing the gl fbos, on the other hand this is gl surface specific code and should go into IWineD3DSurface::Release.
No, the surface release code shouldn't know about render targets, FBOs, etc. (It's not really surface specific either, other than that the pointers we're cleaning up happen to be surfaces.) The device gets notified when resources of a certain type are destroyed here, so it can do extra cleanup on it's internal structures, so this is the correct place to do this kind of stuff.
What I meant was that selecting the gl codepath or the no gl codepath. This is preferably done by calling a COM method on the right vtable(d3d surface / non d3d surface). My first patch(never sent here) checked the vtable address to find out if the surface is d3d or gdi, this was ugly. Now this patch checks a device internal status flag, which is better because the device can decide on which path to take based on it's own properties, rather than depending on the surface type.