I do get a valid pointer back from wglAllocateMemoryNV(). But every combination of readFrequency, writeFrequency, and priority gives me memory which is slower than memory allocated with malloc(). I only write chunks sequencially to the memory via memcpy(); I never read data back from it. Indices are not stored in the VAR-memory obtained by wglAllocateMemoryNV()!
Before rendering a primitive I verify via
GL_VERTEX_ARRAY_RANGE_VALID_NV that the VAR is valid.
Some (read, write, priority)-combinations give me less performance drops (about 10%) but other combinations are halving my FPS or even worse with respect to memory allocated by malloc().
void* ptr = wglAllocateMemoryNV(size, …);
glVertexArrayRangeNV(size, ptr);
glEnableClientState(GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV);
…
// setup vertex data by memcpy(ptr, …)
// check if VAR is valid
GLint varEnabled = false;
glGetIntegerv(GL_VERTEX_ARRAY_RANGE_VALID_NV, &varEnabled);
if(!varEnabled) {
// warning
} else {
glDrawArrays(…);
}
I have tried all possible combinations of read-frequency, write-frequency, and priority for wglAllocateMemory(), but memory allocated via malloc() is always faster (up to 200%).