Redundant shader code

Is redundant shader code removed at link/assembly time? I’m wondering whether I need to worry about splitting up collections of library code so that only used functions are compiled?

I’m a shader newb so excuse me if this is a dumb question but I’ve Googled to no avail :slight_smile:

I don’t believe the OpenGL specification dictates how the implementation is done, and if not then it is implementation dependent. But I find it extremely unlikely that GLSL linkers would include functions that aren’t referenced.

I don’t think you need to worry about splitting up collections of your library code.

You don’t need to care about redundant code; your only problem may become compilation times.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.