Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved Automatically get parameters of a QOpenGLShaderProgram?

    General and Desktop
    2
    2
    152
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • W
      wrosecrans last edited by

      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?

      1 Reply Last reply Reply Quote 0
      • mrjj
        mrjj Lifetime Qt Champion last edited by

        Hi
        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
        https://github.com/graphitemaster/glsl-parser
        or similar parser.

        1 Reply Last reply Reply Quote 1
        • First post
          Last post