implement full reference counting for vertex/fragment programs