Description
The automatic uniform bindings in the QML ShaderProgram element should be extensible, enabling users to define their own QML types that bind uniforms in unanticipated ways.
This mechanism could be used immediately to enable support for cubemaps and 3d textures.
This task is related to QTBUG-19847 (Cannot assign QImage or QDeclarativeImage as a texture on a shader program) and QTBUG-21840 (Add support for binding cubemaps 3D textures to QML3D ShaderProgram items).
In practice, this would mean that a properly constructed class would enable the user to simply add an instance of their custom class to a ShaderProgram item, and have it be exposed to the shader programs automatically. e.g.:
ShaderProgram { property variant myCustomUniform: MyCustomUniform {} vertexShader: " /*...*/ ; uniform TYPE myCustomUniform // TYPE is the approriate GLSL type for the uniform, and is potentially a struct" }