SFGraphics
SFGraphics copied to clipboard
Validate buffer writes for uniform blocks
Buffers will most likely be initialized once and then bound to shaders many times, so there is little performance impact for doing these checks. Writes should only be checked to ensure they don't exceed the length of the variable in the uniform blocks. Writing a byte[3] to a float should still be valid, for example.
- [ ] check if write would exceed the buffer's storage
- [ ] check if write would exceed the size of the uniform variable
- [ ] check writes for arrays