https://bugs.winehq.org/show_bug.cgi?id=54701
--- Comment #9 from Stefan Dösinger stefan@codeweavers.com --- The problem is that WINED3DUSAGE_PRIVATE resources don't get unloaded on wined3d_device_reset() calls because they are not added to the resource list. ddraw can't piggy-pack on this flag to prevent per-resource video memory accounting.
After recreating the context, the draw texture still has a GL texture id assigned. wined3d will try to download data from this texture. With core contexts, glBindTexture rejects the bad texture name and glGetTexImage will return data from a different, larger texture, corrupting the heap.
I think I'll do away with WINED3D_VIDMEM_ACCOUNTING and replace it with a per-resource flag.
I contemplated unloading the draw texture in the reset() callback, but wined3d does not export a per-resource unload function and I don't think it should.