public void WriteShaderData(ref ShaderSubProgram subProgram) { ShaderGpuProgramType programType = subProgram.GetProgramType(Version); GPUPlatform graphicApi = programType.ToGPUPlatform(Platform); ShaderTextExporter exporter = m_exporterInstantiator.Invoke(Shader.File.Version, graphicApi); exporter.Export(this, ref subProgram); }
public void Export(ShaderWriter writer, ShaderType type, bool isTier) { writer.WriteIndent(4); #warning TODO: convertion (DX to HLSL) ShaderGpuProgramType programType = GetProgramType(writer.Version); GPUPlatform graphicApi = programType.ToGPUPlatform(writer.Platform); writer.Write("SubProgram \"{0} ", graphicApi); if (isTier) { writer.Write("hw_tier{0} ", ShaderHardwareTier.ToString("00")); } writer.Write("\" {\n"); writer.WriteIndent(5); int platformIndex = writer.Shader.Platforms.IndexOf(graphicApi); writer.Shader.Blobs[platformIndex].SubPrograms[BlobIndex].Export(writer, type); writer.Write('\n'); writer.WriteIndent(4); writer.Write("}\n"); }