Qt World Summit: Submit your Presentation

Automatically get parameters of a QOpenGLShaderProgram?

  • QOpenGLShaderProgram has a bunch of convenience functions for setAttributeValue("my_parameter_name", someValue); but you have to know the parameters of a shder in advance. If I am trying to wire up a UI automatically that will look at a shader and then present the user with a dialog with various settings, I need to figure out what those available attributes/uniforms are that I could set the values of. Does Qt have any convenience classes or methods for interrograting a shader like that? Either the source, or the linked shader program? Or, failing that, is there a convenient way to do it using raw OpenGL without some Qt convenience class?

  • Lifetime Qt Champion

    This is outside my knowledge
    but as far as i know, there is no convenient class for enumerating the shader
    attributes. At least i never saw one.
    I was wondering if you could reuse
    or similar parser.

Log in to reply