You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please
read the bug posting guidelines first.
EViruS
Posts: 19 Joined: Sat Jul 07, 2007 8:32 pm
Post
by EViruS » Mon Jul 23, 2007 10:13 am
Memory leak inside:
void *pTexData = pTexture->lock();
pTexture->unlock();
hybrid
Admin
Posts: 14143 Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:
Post
by hybrid » Tue Jul 24, 2007 8:07 am
ITexture->lock() is pure virtual, moreover the code seems to be ok. Could you explain a little more?
EViruS
Posts: 19 Joined: Sat Jul 07, 2007 8:32 pm
Post
by EViruS » Wed Jul 25, 2007 4:45 am
hybrid wrote: ITexture->lock() is pure virtual, moreover the code seems to be ok. Could you explain a little more?
I use Direct3D9 debug runtime and this two lines contain memory leak, which detected by D3D9 debuger.
vitek
Bug Slayer
Posts: 3919 Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR
Post
by vitek » Wed Jul 25, 2007 5:46 am
The D3D8/9 Implementations of
lock definitely do leak when dealing with a RTT. The
surface needs to be released. Have a look
here .
Travis
hybrid
Admin
Posts: 14143 Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:
Post
by hybrid » Wed Jul 25, 2007 8:39 am
Is it possible to unlock the surface when the RTTSurface is still being locked, or do I have to keep both locked?
zet.dp.ua
Posts: 66 Joined: Sat Jul 07, 2007 8:10 am
Post
by zet.dp.ua » Wed Jul 25, 2007 9:21 am
from DX9SDK:
IDirect3DDevice9::GetRenderTargetData
Copies the render-target data from device memory to system memory.
seems what surface can be release after GetRenderTargetData was called
vitek
Bug Slayer
Posts: 3919 Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR
Post
by vitek » Wed Jul 25, 2007 10:30 am
Yes, it is safe to Release() as soon as GetRenderTaretData() has returned.
devsh
Competition winner
Posts: 2057 Joined: Tue Dec 09, 2008 6:00 pm
Location: UK
Contact:
Post
by devsh » Wed Dec 01, 2010 6:33 pm
I think the same happens in openGL... how do I get rid of the data?
devsh
Competition winner
Posts: 2057 Joined: Tue Dec 09, 2008 6:00 pm
Location: UK
Contact:
Post
by devsh » Thu Dec 02, 2010 9:29 am
any1?
hybrid
Admin
Posts: 14143 Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:
Post
by hybrid » Thu Dec 02, 2010 12:58 pm
The opengl driver creates a copy internally. This is not released until destruction of the RTT, but it will also not leak. So it's not really a bug, but a missing feature. There's already a ticket for this problem. We simply need more flags for the texture generation and handling.
devsh
Competition winner
Posts: 2057 Joined: Tue Dec 09, 2008 6:00 pm
Location: UK
Contact:
Post
by devsh » Thu Dec 02, 2010 2:38 pm
wait so if I generate 500 cubemaps for SH computation and not delete and re-create the RTT I will leak 1GB?? This is gonna slow me down real BAD
hybrid
Admin
Posts: 14143 Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:
Post
by hybrid » Thu Dec 02, 2010 11:03 pm
No, you don't leak that memory. It's just a copy in CPU memory. It might be the case that if you create RTT and not lock it, you even don't have a mem copy. Check sources to be sure.