• ### Announcements

#### Archived

This topic is now archived and is closed to further replies.

# What's with EXT_compiled_vertex_array?

## Recommended Posts

hh10k    589
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)

##### Share on other sites
666_1337    122
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) ...

##### Share on other sites
_the_phantom_    11250
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

##### Share on other sites
hh10k    589
Phantom, that''s why I did 1000 reps of drawing the grid. Isn''t that multi-pass enough?

##### Share on other sites
memon    152
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.

##### Share on other sites
_the_phantom_    11250
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
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.1501345932483673, "perplexity": 6614.345646824245}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2017-34/segments/1502886105955.66/warc/CC-MAIN-20170819235943-20170820015943-00156.warc.gz"}