The details here get quite hairy, and it's not complete as not all functionality is implemented in glslang yet.