For OpenGL there need to be two paths implemented:
Using GL_ARB_separate_shader_objects extension.
Using an internal pool to look up existing shader programs that already exist for a combination of the specified shaders, i.e. the GLShaderProgram implementation will remain as internal class as fallback when the extension (see 1.) is not available.
All the shader reflection will move into Shader interface, which might be a bit chellenging for the 2nd case for OpenGL, because all shader related glGet* function need a shader program, i.e. a dummy shader program needs to be created, e.g. with a dummy vertex or fragment shader.
Replace the
ShaderProgram
interface and useShader
instances individually in various combinations for aGraphicsPipeline
:Before:
After:
For OpenGL there need to be two paths implemented:
GL_ARB_separate_shader_objects
extension.GLShaderProgram
implementation will remain as internal class as fallback when the extension (see 1.) is not available.All the shader reflection will move into
Shader
interface, which might be a bit chellenging for the 2nd case for OpenGL, because all shader relatedglGet*
function need a shader program, i.e. a dummy shader program needs to be created, e.g. with a dummy vertex or fragment shader.