View Full Version : NV VAR renders while CPU's free
03-22-2004, 08:30 AM
I'm rendering my scene with NV Vertex Array Range and after that I change data in that buffer. It causes errors, beacuse while I'm changing data (after rendering function DrawElements) scene is still being rendered from that buffer. Do you know how to wait until the scene is rendered (buffer isn't used)? I'm doing glFlush after rendering functions but it doesn't make program to wait for full render.
I don't know if my english is enough to explain this problem...
03-22-2004, 08:53 AM
Check this demo
But you might want to look into vertex buffer objects (VBO) which are easier to use and implemented by more vendors.
VAR is deprecated.
Donīt even think of using it.
03-22-2004, 02:39 PM
The spec (http://oss.sgi.com/projects/ogl-sample/registry/NV/vertex_array_range.txt) says:
"When the vertex array range is valid, the vertex array coherency
model is relaxed so that changes made to array data until the next
"vertex array range flush" may affects calls to ArrayElement in
non-sequential ways. That is a call to ArrayElement that precedes
a change to array data (without an intervening "vertex array range
flush") may access the changed data, and a call that follows a change
(without an intervening "vertex array range flush") to array data
may access original data."
To enforce coherency, you can use glFlushVertexArrayRangeNV.
NV_fence (http://oss.sgi.com/projects/ogl-sample/registry/NV/fence.txt) may be useful, too.
03-23-2004, 12:08 AM
VAR is maybe "deprecated" but it's still usefull. All the Geforce fx PCI cards i have tested, for some reason, are extremely slow with VBOs. Using VAR is the only way i've found to get "correct" performance.
03-23-2004, 08:49 AM
Users often have older drivers, that don't even support VBO. Thus, you need a VAR path if you care about performance and compatibility. And, as others said, the right solution to the sychronization problem in that case is NV_fence. Flushing the vertex array range causes noticeable stalls.
Additionally, initial implementations of VBO on NVIDIA drivers were slow, so we don't turn on VBO unless users have recent enough drivers that it's actually comparable to VAR in performance.
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.