4 ms·
Juggling uniforms and buffers is something that will get messy fast unless you take the time to organize it early on. I wrote my own preprocessor that can dyna
by gavanwoolery 11y ago
Juggling uniforms and buffers is something that will get messy fast unless you take the time to organize it early on. I wrote my own preprocessor that can dynamically bake values into the actual shader code (by injecting text and recompiling the shader during run time) - which is useful for putting in values that are determined by the CPU but more or less constant through the life of the program (the preprocessor allows other neat tricks like automatically binding a slider to a variable to test a range of values for that variable). This also saves time where possible by minimizing CPU-GPU communication. During one test I did (which certainly is not conclusive) I noticed uniform buffers performed slower than using normal uniforms - not in uploading the uniforms but rather reading them in the code. This may have been due to needing to compute an extra offset or something.