Currently shaders (even the user ones) are encoded as rather sloppy combinations of C++ objects and runtime file dependencies. Those are packed into a boost::variant and then sorted out at runtime.
Contrast that with a data-driven model: Shaders are essentially data and can/should be treated as such:
In vertex and fragment shaders, rename all inputs/outputs to shared names.
In the engine, create a new kind of shader object, that can modify and return the values of shader inputs/outputs, accept a bgfx shader file, handle drawcalls, etc.
Carefully replace old shader code with new shader code.
Profit.
Currently shaders (even the user ones) are encoded as rather sloppy combinations of C++ objects and runtime file dependencies. Those are packed into a boost::variant and then sorted out at runtime.
Contrast that with a data-driven model: Shaders are essentially data and can/should be treated as such: