PDA

View Full Version : about wglAllocateMemoryNV



holocaust
03-22-2001, 02:29 PM
Hey, here is the code i use to determine how many memory i can get from an nVidia card :



#define INC (long)(256 * (1 << 10))
long T_FASTCALL extCalcMaxWGLMemoryNV (void)
{
void * p_mem;
long max;

max = INC;

do {
if ((p_mem = extInfos.wglAllocateMemoryNV(max, 0.0f, 0.0f, 0.0f)) != 0) {
extInfos.wglFreeMemoryNV(p_mem);
max += INC;
}
else
max -= INC;
} while (p_mem);

debugPrintf("extCalcMaxWGLMemoryNV : %dKb available\n", max >> 10);

return max;
}


All i could get from my geforce 2 mx was... 0Kb ! How can this be possible ?
Cass ? Matt ? Someone ?

[This message has been edited by holocaust (edited 03-22-2001).]

Ysaneya
03-22-2001, 03:24 PM
You can allocate video or AGP memory with wglAllocateMemoryNV.. but it requires the last parameter to be correct !

I think it's 1 for video memory and 0.5 for AGP memory. I don't know what a value of 0 is supposed to do, but i wouldn't be surprised if it caused your problem.

Y

sualkdimsch
03-22-2001, 11:57 PM
To be precise (Taken from VertexArrayRange.pdf from NVIDIA's site)

AGP:
wglAllocateMemoryNV(size, [0 to 0.25], [0 to 0.25], [0.25 to .75])

Video Memory:
wglAllocateMemoryNV(size, [0 to 0.25], [0 to 0.25], [0.75 to .1])

holocaust
03-23-2001, 03:23 AM
Ysaneya, sualkdimsch thanks :)

I tried wglAllocateMemoryNV(max, 0.0f, 0.0f, 1.0f) and i got 'extCalcMaxWGLMemoryNV : 15872Kb available'. I think it's better ;)