PDA

View Full Version : Redundant shader code



kaffiene
09-18-2010, 04:14 PM
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 :)

david_f_knight
09-18-2010, 06:49 PM
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.

Ilian Dinev
09-19-2010, 02:37 PM
You don't need to care about redundant code; your only problem may become compilation times.