PDA

View Full Version : ARB_vertex_program and vertex attribute arrays



Asgard
09-09-2002, 12:51 AM
Hello,

I'm just integrating ARB_vertex_program support into my engine, and I was wondering why the extension, unlike NV_vertex_program, does not support querying the enable state of the generic vertex arrays. All you can do is enable or disable them with glEnable/glDisableVertexAttribArrayARB. But there's no IsEnabled or something similar. Not that it's a big deal, but it would be nice to have for reasons of symmetry.

On a similar topic, how ineffecient is it to enable an already enabled array? For example, if I called glEnableVertexAttribArrayARB every frame for an array, even though that particular array is already enabled, would that be a bad idea? I guess it just sets a flag in the driver, but who knows? Does anyone have any experience with this?

Cheers.

pbrown
09-09-2002, 03:18 AM
The vertex attribute array enables can be queried using GetVertexAttribARB (passing in VERTEX_ATTRIB_ARRAY_ENABLED_ARB). See Table X.7 in the spec.

The performance hit from enabling an already enabled array is driver-dependent. If you're going to change some other enable, it shouldn't be too bad. I'd suggest avoiding this kind of redundant state change when possible, but I wouldn't rewrite my app to do so.

Asgard
09-09-2002, 06:21 AM
The vertex attribute array enables can be queried using GetVertexAttribARB


Oops, I totally missed that (damn, the spec is looooong ;-)
Thanks for the hint.
Cheers.