[not a bug]Texture lock() doubles memory?

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.
Post Reply
MolokoTheMole
Posts: 109
Joined: Tue Jan 09, 2007 1:18 pm

[not a bug]Texture lock() doubles memory?

Post by MolokoTheMole »

I load 7mbs of textures. When I perform a lock() on them they use 14mbs in memory. I checked to be sure that is it and it is. What's up? I'm using Irrlicht 1.3.1
Crimson Glory full Irrlicht game source code!
What I Do - my blog & dev log
Currently developing Link-Dead
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

The texture is copied into a memory location which is accessible by the CPU. So it can indeed double the memory usage. However, an unlock should free that memory region again. I'm not sure if the system will free the memory immediately, though.
MolokoTheMole
Posts: 109
Joined: Tue Jan 09, 2007 1:18 pm

Post by MolokoTheMole »

Sorry for bumping this but I am curious.
Can I edit the textures pixels directly on the texture memory in vram? This would be mighty fast but I suspect it would need some uber skills.
Crimson Glory full Irrlicht game source code!
What I Do - my blog & dev log
Currently developing Link-Dead
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

At least we don't have an interface for this, so no, right now it's not possible.
DtD
Posts: 264
Joined: Mon Aug 11, 2008 7:05 am
Location: Kansas
Contact:

Post by DtD »

From my experience, copying the texture from the vram to the ram and vice-versa is very fast, I wouldn't worry about it too much.
loki1985
Posts: 214
Joined: Thu Mar 31, 2005 2:36 pm

Post by loki1985 »

MolokoTheMole wrote:Can I edit the textures pixels directly on the texture memory in vram?
can't that be done using shaders? a bit non-intuitive maybe, but probably much faster than letting the CPU do it, since that would require a roundtrip of the data on the graphics bus.
Post Reply