Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-31362

QGLShaderProgram cache uniform and attribute locations

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Incomplete
    • Not Evaluated
    • None
    • 4.8.4, 5.1.0 Beta 1
    • GUI: OpenGL

    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.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            rodal Samuel Rødal
            dzedsystems Dyami Caliri
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes