Imagine this:
When the application uses e.g. 1.5 GB of memory, can it allocate another 1 GB of textures? It would use in sum 2.5 GB of memory which is not possible for the 32 bit application itself.
AFAIK textures are only mapped into the address space of the application when it "locks" the texture to get a pointer to the memory. So my assumption is the address space is only needed during the lock. As only some textures are locked it shouldn't consume the whole address space.
When the application uses e.g. 1.5 GB of memory, can it allocate another 1 GB of textures?
There is no simple answer to this because textures can be allocated in video memory but they can be on system memory too.
So it depends on the usage.
Take this constructor and note the Pool parameter:
public Texture(
Device device,
int width,
int height,
int numLevels,
Usage usage,
Format format,
Pool pool
)
If you choose Pool.VideoMemory then the data is placed in video memory and only a few members using a few bytes are stored in system memory. If you choose Pool.SystemMemory then of course you use memory allocation space.
When you get the surface pointer of a video memory texture and use lock bits:
surface->LockRect(&bits,0,0)
You are actually allocating a new variable in local memory called bits. So the answer to this type of texture is still no. Another variable uses memory allocation space and that is the variable you get bits back into.
DX textures allocated on the VideoMemory Pool use only a few bytes of system memory for allocation.
Hope that helps, Mars.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With