When I start drawing with VARs, it works fine but as soon as I try to draw something with normal arrays I can never get the VAR to work again properly (it retreats into slowmotion, fetching data from agp mem and sending it to the card.)
it should be possible to do this:
main
{
void *mem = glAllocateMemoryNV(1000,0,1,.5)
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_VERTEX_ARRAY_RANGE_NV);
glVertexArrayRangeNV(1000,mem);
Each time you disable VAR, the driver flushes. So what you essentially are doing, is disabling parallelisme of your GF
You should probably draw your non-VAR stuff first to minimize flushes, or last, I’m not really sure. (Matt?)
And then afterwards, VAR stuff, so you only disable VAR once, per frame.
Strictly looking at your code, I noticed that after your first call to
glEnableClientStat(GL_VERTEX_ARRAY_RANGE_NV);
you called
glVertexArrayRangeNV(1000,mem);
but not after additional calls to
glEnableClientStat(GL_VERTEX_ARRAY_RANGE_NV);
Ive hardly touched VAR and dont remember much about coding it, so I dont remember what the call to glVertexArrayRangeNV does, but it just kinda stands out to me.
I actually did that in my main code, I just forgot it in the example. (I really should learn to write more small test cases rather than incorporating stuff in the big engine and test there.)
Nevertheless, if you draw using VAR’s, then build a displaylist with geometry using normal vertex arrays, everytime you call that list the driver does a flush! I can’t really see the reason for that.
At least my current drivers (7.58).
[This message has been edited by macke (edited 04-23-2001).]