System Memory or Video Memory?

Blitz3D Forums/Blitz3D Beginners Area/System Memory or Video Memory?

Matty(Posted 2004) [#1]
This is a fairly basic question, but I would like to know:

When a texture is loaded does it use up memory on my video card, or system memory.

So if I have 256 Mb of system memory and only 32 Mb of memory on my graphics card am I
limited to loading textures so that the total memory consumed must be less than 32 Mb by
those textures?


Bot Builder(Posted 2004) [#2]
I believe by default it is system memory, but you can 'force VRAM' with flag 256 in the loadtexture command.


Mustang(Posted 2004) [#3]
am I limited to loading textures so that the total memory consumed must be less than 32 Mb by those textures?


Nope - that's why we have DX and AGP. DX (or Mark & Blitz) manages textures so that what ever is needed is uploaded through AGP to the card (VRAM) and used for rendering. Of course if you have enough free VRAM for all your textures everything is faster because there is no need to swap textures in and out meny times every frame. AGP is fast but not that fast...

And of course you don't have all of the 16mb VRAM available for your textures because screens take big part of it (front buffer, back buffer, z-buffer) and more is consumed if you have AA enabled or triple buffering. And upping the screen resolution or screen / texture color depth (16bit -> 32bit) takes a lot more VRAM too.

And do not forget that vertices (geometry) needs VRAM too, and sometimes surprisingly much if you have hi-polygon models.

1024*768*32 screen mode uses basically ALL of the VRAM from 16mb cards (if you reserve space for geometry too) because screen buffers alone take 9.44 megs! So as you can see, AGP really has to swap stuff a lot.

Check my formulas for calculating texture / VRAM usage:

http://www.blitzbasic.co.nz/Community/posts.php?topic=24157


Hansie(Posted 2004) [#4]
@Mustang

Love your explanation of this

help me also

thanks


PowerPC603(Posted 2004) [#5]
If you use a PCI graphics card, then your computer loads
the textures into system RAM.
When the graphics card uses the textures (i.e. when it is needed for rendering), the texture is copied to VRAM.
When it isn't needed anymore, it is deleted from VRAM to make room for other textures.

So in fact, with PCI cards, the texture exists 2 times in memory (one in system mem, one in VRAM).
This uses much more memory than needed, and is slower, because of copying and deleting all the time.

An AGP card uses system memory, instead of VRAM.
So the texture is loaded only once.
No need for copying the textures when needed.
The AGP card uses the texture from system memory when needed.

That's the reason why AGP is also much faster.

This explanation can be found on http://howstuffworks.com