Пример #1
0
        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('"');
        }
Пример #2
0
        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);
        }
Пример #3
0
        public void WriteShaderData(ShaderGpuProgramType programType, byte[] shaderData)
        {
            ShaderTextExporter exporter = m_exporterInstantiator.Invoke(Shader.File.Version, programType);

            exporter.Export(shaderData, this);
        }
Пример #4
0
        public void WriteShaderData(GPUPlatform graphicApi, byte[] shaderData)
        {
            ShaderTextExporter exporter = m_exporterInstantiator.Invoke(Shader.File.Version, graphicApi);

            exporter.Export(shaderData, this);
        }