What's with EXT_compiled_vertex_array?

Started by
4 comments, last by hh10k 20 years ago
I don''t understand why, but EXT_compiled_vertex_array seems to give me slower performance than without it. My little glut ''test'' program goes like this:

glVertexPointer(3, GL_FLOAT, sizeof(grid[0]), grid);
glEnableClientState(GL_VERTEX_ARRAY);
glLockArraysEXT(0, GRID_X * GRID_Y);
for (int reps = 0; reps < 1000; ++reps)
	for (int i = 0; i < GRID_X - 1; ++i)
		glDrawElements(GL_TRIANGLE_STRIP, GRID_Y * 2, GL_UNSIGNED_INT, &indicies[i * GRID_Y * 2]);
glUnlockArraysEXT();
glDisableClientState(GL_VERTEX_ARRAY);
''grid'' is an array of GRID_X by GRID_Y verticies, and ''indicies'' are (surpise) the indicies that make the rows. Using a grid of 8 by 8 and shrinking the render window to an insignificant size (so fill rates do not influence the test), I get 253 FPS. If I remove glLockArraysEXT/glUnlockArraysEXT, this goes up to 550 FPS! Surely drawing something 1000 times with the same array should benefit from CVAs? I''ve tried playing with the grid size, repetitions and such, but no matter what I do the CVA version is always slower. If this happens to be a NVidia problem, I have a Geforce FX 5600 with 53.03 drivers. (also, I know VBOs are the way to go, but this is my fallback option for older cards)
Advertisement
I also have a fx 5600 and detonator 1.0.5336 ( yes, linux ).
At me locking the arrays has NO effect on terrain-meshes ( i guess that is what your grid is supposed to be ) with a size less than 64x64, and it''s little ( at most 5% ) faster than unlocked arrays at increased mesh size (the largest i tested was 512x512) ...
our new version has many new and good features. sadly, the good ones are not new and the new ones are not good
the CVA extension really only comes into play when you are doing multiple pass rendering.
By locking the array you are telling OpenGL it can copy/cache the content until you unlock as you wont be changing it.
This means that on the 2nd pass with the same vertex data OGL can use the cache''d version which is possibly in faster ram, to let the 2nd pass run faster.
Doing what you are doing wont help at all as the vertex data doesnt get reused and cached in fast ram, you''ll be better off with normal VA or VBOs
Phantom, that''s why I did 1000 reps of drawing the grid. Isn''t that multi-pass enough?
Just try to upgrade drivers. I got boost from 7fps to 37 fps, just by downloading the latest drivers (this is on nVidia).

The funny thing is that on some older drivers with the same scene I got 90 fps with the VCA, and 80fps with VBO. Not I get ~30 fps with VCA, and 50 with VBO :/ Funny...

I suggest to go for VBO if possible... especially if you have static geometry. If you have the VCA up and running, it''s quite easy to add the VBO thing there too.
quote:Original post by hh10k
Phantom, that''s why I did 1000 reps of drawing the grid. Isn''t that multi-pass enough?


hehe, sorry, i mis-read that line of the code

This topic is closed to new replies.

Advertisement