Push constants have been introduced with vulkan and the main difference with uniform buffers are that they are transported inside the command buffer and not bound.
Push constants buffers are limited to 128 bytes.
This patch adds the ability to add push constants to shaders. On the OpenGL backend the GLSL is patched to use uniform buffers. It contains:
- Changes to GPU API to set push constants for a shader GPU_shader_uniform_push_constants.
- GL_Shader will create a ubo to store the data locally. The UBO is updated when the push constants are changed. This saves some data management and matches closer to the workings of vulkan.
- Adds test cases for to validate syntax checks.
- Adds a Draw manager command for push commands. DRW_shgroup_call_push_constants
- Use the mechanism in draw_hair compute shader. This is just an example and can be removed before this patch lands.
The GLSL source patches is a template for how to patch GLSL source code. In the vulkan branch a similar structure is needed for parsing binding names.