Is PatchParameter a link-time attribute of the GL program?

Hi,

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?

Thanks,
Fred

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.

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 :slight_smile:

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.