What's in which memory?

BlitzMax Forums/BlitzMax Programming/What's in which memory?

Braincell(Posted 2005) [#1]
Ok, i'm confused.

Can you tell me what is likely to be possible (in your personal belief) to be done with the BlitzMax 3d engine in terms of what goes to which memory. I know there is a standard, but im confused.

Correct me on any of the following assumptions please, or give your opinion on likelyhood:

1-Textures go into VRAM (video card RAM) for speed, but can be loaded into RAM if space runs out (and additionally to SWAP file).

2-Textures can be switched between VRAM and RAM on the go, and we can and will have control over this.

3-Verts and geometry info always goes to RAM and cannot and does not get loaded into VRAM.

4-If textures start getting loaded into RAM it doesnt matter how many are in VRAM it is still going to reduce frames per second the same.


Chris C(Posted 2005) [#2]
basically opengl or directx control this at a low level.
(there is from memory a way to find out how much free video ram you have left, if you're that worried)
If you have textures in main memory you'll take hit on speed, I wouldnt think textures would ever get into a swap file that would be a case of spf not frames per second...
You can specify that you want a texture in memory, this is usually used for rendering to a texture
on some cards geom and lighting info is loaded into video ram and the card handles transforming the models
speed hits are going to differ depending which textures are in ram and how often they are used.


Leiden(Posted 2005) [#3]
Textures in VRAM are only loaded into Ram when the VRAM overflows with too much data. The Ram it uses is called 'AGP Apeature' It's mapped below the VRAM. You set the Apeature in the System BIOS and the GART will allocate space for this texture memory. The space is only allocated when needed, therefore System data and the Apeature data will become interspersed (fragmented). The GART prevents this by keeping automatically mapping the scattered pages and the AGP Apeature thus decresing the amount of logic needed to access the scattered pages locations. Additionaly the actual memory used when the VRAM overflows is only half of the Apeature. This is because its further split into two seperate fragments, One uncached half, and a write combined half.

Generally you do not need to worry about these operations as the system handles them fairly well.

Shaders (Pixel/Fragment/Vertex) are handled in VRAM as they move tremendious amounts of data around and would be too slow to handle that data in System Memory.