Jump to content
  • Advertisement
nOoNEE

OpenGL what does glLinkProgram and glBindAttribLocation do ?

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement

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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!