Details
-
Suggestion
-
Resolution: Incomplete
-
Not Evaluated
-
None
-
4.8.4, 5.1.0 Beta 1
Description
It would be really easy to cache uniform and attribute locations by name in the QGLShaderProgram, and it would improve performance.
The attributeLocation(char *name) method could cache the values. All of the other setUniformValue/setAttributeValue methods that take strings call through to attributeLocation(char *name) to get the location. That method could cache the value with the name.
The cache could be cleared whenever link() is called.
It's already a standard design pattern to call attributeLocation() and store the values in member variables. This would make it much easier to get the same performance advantage, but without the extra coding, especially for programs with many shaders and many uniform/attributes.