So I have a bunch of predetermined/prebaked data that I want to nest on a shader.
Making a complex storage buffer for it or a uniform seemed like the wrong path since the data is never going to mutate after the initial creation of the shader.
So I decided to construct the shader parts as strings and just inject that into the code:
At what point does this become bad practice? Will this overload my shaders if I do too much data? Is there a better way to do this? I’m including this data on both a compute shader and my vertex and fragment shader.
Regarding your question, I would say that it’s ok to do it in the code only for very small amount of data because it will consume valuable register resources, which are quite sparse. Even if static, I would pass the data through a ubo, or a storage buffer, or even through a texture (I don’t know which one would be the fastest, though).