Saving/Restoring uniforms breaks shader reloading (NVIDIA GTX 970)
When I enable shader reloading and edit the attached shader, the screen turns black after the first reload, even if there are no compilation errors.
The issue disappears, when I do not save/restore uniforms before I relink the program.
Program.cc:425
// save uniforms
auto uniforms = program->getUniforms();
// relink
program->link();
// restore (program is relinked)
uniforms->restore();
The only uniform which Program::getUniforms()
picks up is _main_0_gp5vp[0]
of type GL_FLOAT_VEC2
.
EDIT:
Upon further investigation, it seems like the uniform is generated for the const array declared in Blit.vsh.
The issue with reloading uniforms is caused by not reloading uniform arrays properly (only the first element of the array is reloaded, uniformSize
is ignored).