private static void SavePrecompiledBinaryAndFormat(Shader shader, string compiledBinaryPath, string compiledFormatPath) { // Save program binary and format. BinaryFormat binaryFormat; byte[] programBinary = shader.GetProgramBinary(out binaryFormat); File.WriteAllBytes(compiledBinaryPath, programBinary); File.WriteAllBytes(compiledFormatPath, BitConverter.GetBytes((int)binaryFormat)); }