public void Export(ShaderWriter writer, ShaderType type) { writer.WriteIndent(3); writer.Write("Program \"{0}\" {{\n", type.ToProgramTypeString()); int tierCount = GetTierCount(SubPrograms); for (int i = 0; i < SubPrograms.Length; i++) { SerializedSubProgram subProgram = SubPrograms[i]; Platform uplatform = writer.Platform; GPUPlatform platform = subProgram.GpuProgramType.ToGPUPlatform(uplatform); int index = writer.Shader.Platforms.IndexOf(platform); ref ShaderSubProgramBlob blob = ref writer.Shader.SubProgramBlobs[index]; subProgram.Export(writer, ref blob, type, tierCount > 1); }