glsl/serialize: restructure remap table code