66.31 bug or expected behaviour? glProgramEnvParameter and contexts

Should glProgramEnvParameterARB update environment variables if called from a non-main (wrt ARB_*_program creation) context?

On the latest NVidia drivers I could find, it does not. My contexts are shared via wglShareLists.

I was doing:

make pbuffer context current
make main context current
use rendered texture with fragment program

but had to move the envParam updates above the pbuffer context switch.

It also seems that the texture bound to image unit 3 is being ignored in the pbuffer context.

My understanding of the spec is that ProgramEnvParameter() sets per-context state, while ProgramLocalParameter() sets per-program state.

So I would expect program.env to be different between contexts (even shared ones), while I would expect program.local to be the same if you use the same program in different (sharing) contexts. However, I haven’t tested that.


program environment parameter - A set of 96+ 4-component vectors
belonging to the GL context that can be used as constants during the
execution of any vertex program.

Thanks for confirming that. It seems odd that you can share objects, but not environment parameters.