Subroutines buffers

I don’t know if it is implemented or not, but let’s start with the problem.
Like indirect drawing and indirect dispatch I think there should be an extension for passing subroutine uniforms from a buffer instead of from the CPU memory. The API could be like this:


GLuint nSubroutineBuffer;
glGenBuffers(1, &nSubroutineBuffer);


// Handle nSubroutineBuffer like any other buffer.


// In draw routine:
glBindBuffer(GL_SUBROUTINE_BUFFER, nSubroutineBuffer);
glUniformSubroutinesuiv​(<shader type>​, <count>​, (const GLuint *)(<offset>));
glDraw*();

glBindBuffer(GL_SUBROUTINE_BUFFER, 0);
glUniformSubroutinesuiv(<shader type>, <count>, <indices>);
glDraw*();