View Full Version : Is PatchParameter a link-time attribute of the GL program?

06-05-2013, 02:57 AM

Do I have to call PatchParameter only once at link time when creating the program, or do I have to call setPatchParameter every time I actually use the program (after glUseProgram)?

I have two different programs and it seems the PatchParameter state is not restored when glUseProgram is called - is this expected?


06-05-2013, 04:54 AM
The patch parameters are part of the global GL state, and not part of the shader program. That is likely why you need to set them when you switch programs, if the programs have different patch settings.

06-06-2013, 01:11 AM
Thanks. I'm confused sometimes as to what belongs to the program, to the global state, what I need to rebind and so on. Still looking for a neat PDF diagram that would tell me everything :)

06-06-2013, 06:47 AM
The OpenGL specifications have a section on "state tables" which you can use to figure out where various states live. It's section 6.2 in the GL specs 4.2 and lower, and Chapter 23 in the GL 4.3 spec.