public void Export(TextWriter writer, Func <ShaderGpuProgramType, ShaderTextExporter> exporterInstantiator) { if (Keywords.Count > 0) { writer.Write("Keywords { "); foreach (string keyword in Keywords) { writer.Write("\"{0}\" ", keyword); } writer.Write("}\n"); writer.WriteIntent(5); } if (m_programData.Length == 0) { return; } writer.Write("\"!!{0}\n", ProgramType.ToString()); writer.WriteIntent(5); ShaderTextExporter exporter = exporterInstantiator.Invoke(ProgramType); exporter.Export(m_programData, writer); writer.Write('"'); }
public void WriteShaderData(ref ShaderSubProgram subProgram) { GPUPlatform graphicApi = subProgram.ProgramType.ToGPUPlatform(Platform); ShaderTextExporter exporter = m_exporterInstantiator.Invoke(Shader.File.Version, graphicApi); exporter.Export(this, ref subProgram); }
public void WriteShaderData(ShaderGpuProgramType programType, byte[] shaderData) { ShaderTextExporter exporter = m_exporterInstantiator.Invoke(Shader.File.Version, programType); exporter.Export(shaderData, this); }
public void WriteShaderData(GPUPlatform graphicApi, byte[] shaderData) { ShaderTextExporter exporter = m_exporterInstantiator.Invoke(Shader.File.Version, graphicApi); exporter.Export(shaderData, this); }