Well I have 8GB of VRAM, not sure how that would work then. Therefore I've now grabbed my laptop with an Intel HD Graphics 5500, 3839MB shared system memory ("Gemeinsam genutzter Systemspeicher") - hopefully that doesn't make a difference in this case.
Same issue but with MAX_BMAPS = 212. Surprisingly, GetAvailableTextureMem() shows similar values here as well, and always > 4.0GB.
"Before the crash"
I put the call in the main function again, the switchResolution function, on_d3d_lost, on_d3d_reset, always > 4.0GB with only minor differences. I must be doing something wrong.
Tbh I'm majorly confused right now what I'm looking at or checking. Just for clarification:

Quote:
UINT GetAvailableTextureMem()
The function returns an estimate of the available texture memory. Remarks: The returned value is rounded to the nearest MB.

This is not true, right? Or is it? I assumed this was in bytes, as I get values like 4278190080 (which I just interpreted as 4,278,190,080 ~ 4.278GB). This value is awfully close to 4294967294, the range of uint (took the int range -2147483648 to 2147483647 from the manual, times 2). However, there's no unsigned int in lite-C - it's 4 bytes either way, so I guess %u interprets the bytes correctly.



So... back to the example/ test code:
I moved the bitmap creation into the main function like this:
Code:
if(num_bmaps < MAX_BMAPS)
{
	test_bmps[num_bmaps] = bmap_create("test8MB.tga");
	num_bmaps++;
}


sys_memory slowy builds up with each bitmap creation up until ~1641MB. However, d3d_texfree remains the same, that is the initial
Video memory found: 4094 MB (3838MB on my laptop)
minus 2MB (the nexus/ d3d_texbmaps). It just stays at 4092MB. GetAvailableTextureMem() always returns the same value, too (laptop and desktop). It only ever changes slightly when I change resolutions.
Just removed the render chain and this is what I got:
Click to reveal..
Quote:
D3D_DrawPrimitive: D3DERR_INVALIDCALL at 0.393
switchResolution() at frame 149: (GetAvailableTextureMem: 4290772992)
D3D_Resize Window: 1440x900
on_d3d_lost_event() at frame 149: (GetAvailableTextureMem: 4291821568)
on_d3d_reset_event() at frame 149: (GetAvailableTextureMem: 4284481536) -> Window: 1x1440x900x32
D3D_DrawPrimitive: D3DERR_INVALIDCALL
switchResolution() at frame 175: (GetAvailableTextureMem: 4278190080)
D3D_Resize Window: 1680x1050
on_d3d_lost_event() at frame 175: (GetAvailableTextureMem: 4279238656)
on_d3d_reset_event() at frame 175: (GetAvailableTextureMem: 4280287232) -> Window: 1x1680x1050x32
D3D_DrawPrimitive: D3DERR_INVALIDCALL
Malfunction W1246: DirectX driver failure: D3DERR_INVALIDCALL
Error E1005: Out of memory

This may be something else though, I get the first warning immediately (after "1st frame with 4094 MB").


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends