For the vulkan port we are looking for a way to handle default uniforms.
Vulkan doesn't support default uniforms and GL_EXT_vulkan_glsl_relaxed isn't widely supported (yet).
The idea of this batch is to have builtin uniform block (named shaderBlock) that wraps the needed default uniforms in a define struct.
When constructing a shader the internal data structure of the shaderBlock can be selected (see GPU_shader_create_ex#shader_block.
This creates a uniform buffer managed by the shader containing. When setting an default uniform it is checked if it is inside the
shaderBlock. If that is the case the uniform buffer is updated and marked dirty.
Before each draw call the uniform buffer is uploaded (if dirty) and bound to the shaderBlock.
This patch also migrates GPU_SHADER_TEXT to the new structure. After reviewing and making sure that this is the right direction
we can migrate shaders per internal dependancy.
TODO
- Add support for none builtin uniforms. Most builtin shaders don't have their uniforms defined as builtin. We could add them as buitin uniforms or relax our implementation to support non-buitin uniforms.