View Full Version : Lock/UnlockArraysEXT
What is the right use of this extension, and what are the benefits?
02-03-2003, 12:08 AM
It's used by locking your vertex arrays after specifying vertex, normal etc. pointers. Then you call glDrawElements, and after that unlock the arrays.
The arrays can be precompiled at the locking time by the driver. A common advantage is, that shared vertice get transformed only once. The advantage gets bigger if you multipass over the same object, since you can compile (lock) the object once and draw it several times.
Thanks. So if one vertex is common for n triangles it's tranformed just once, and you spare n-1 transformations, right?
And one more question : is it compatible with glInterleavedArrays?
02-03-2003, 10:32 AM
Yes, it is compatible.
The real benefit comes for multi-pass algorithms:
foreach texture layer:
02-04-2003, 12:14 AM
Hey, are you really allowed to change texCoordPointer after lockArrays? That would be great, but I thought you can't do that.
02-04-2003, 01:00 AM
The CVA spec is about as vague as you can get on this point. So you can probably change it, but it might trigger a re transform of geometry. On the other hand, that's what happens on hw T&L cards anyway, since they can't "save" transformed vertices.
It might trigger a re transform of geometry. On the other hand, that's what happens on hw T&L cards anyway, since they can't "save" transformed vertices.
Wouldn´t this mean, that CVA´s are good with shared vertices, but not with mutlipass rendering, because the computations of the first pass are not available in the second?
02-04-2003, 02:58 PM
With CVA, the computations ARE available for second passes, if you change nothing except bind new textures and change texenv.
However, an optimized driver may realize that it doesn't need to re-transform vertex position and normal values just because you re-specify the texture coordinate array, unless you have texgen enabled.
Even when it has to re-transform, it can do it in a much more efficient way, because you tell it what the minimum and maximum vertex index you'll use is; it can use a highly efficient streaming transform path to just transform the entire chunk between start and end.
Powered by vBulletin® Version 4.2.2 Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.