ah  i missed this comment  this may be why we see issues  in statemanagergl it will sync the active program before syncing the transform feedback so no  it wont go back and reset the program to the correct one for the upcoming draw call  you should reset it here  changing gl state while syncing dirty bits is one place we need to be careful 