Slightly offtopic, but how fast are the GLSL variable location enquiry functions such as getAttribLocation () and getUniformLocation ()? Should I be caching the results for performance or does it not make much odds. I’m presuming at the least that the bytes of the string are not copied across to JOGL but I’m aware that some GL enquiry functions can have significant overhead.
Yes, you should be caching both Attribute and Uniform locations. That’s the purpose of the corresponding functions.
[quote]7) Do we load uniforms using their string representation?
DISCUSSION: Loading uniforms is still performance sensitive, although
not as much as vertex attributes. Passing in a string into the load
uniform command seems too big of a performance hit. Every time the load
is called the string needs to be parsed and the location for the data
computed. It is better to move this performance cost outside the load
uniform command into GetUniformLocationARB.
RESOLUTION: NO.
[/quote]
Thanks!