Advertisement

what does glLinkProgram and glBindAttribLocation do ?

Started by June 20, 2018 11:35 AM
1 comment, last by Zorinthrox 6 years, 7 months ago

hello guys , i have some questions  what does glLinkProgram  and  glBindAttribLocation do?  i searched but there wasnt any good resource 

Off the top of my head, glLinkProgram 'stitches' together the compiled shader stages currently attached to the specified program object into a shading program that can be used. Shader compilation under OpenGL works more or less the same as C compilation: each file is preprocessed, then compiled into machine code, then linked together into an executable, albeit one that runs on the GPU.

Same requirements apply. If you attach a new shader stage means you have to compile that new stage and link the program again; you would not have to recompile any stages that haven't changed if they are already attached and compiled for the given program object. Names that are used across shader stages have to match. Linking can fail for any number of reasons, so check the error state religiously.

As for the other one.

This topic is closed to new replies.

Advertisement