Пример #1
0
		public static void GenerateAllHeaderCode(EffectCodeGenerator generator, StitchedEffectSymbol stitchedEffect)
		{
			List<string> seenFragmentTypes = new List<string>();
			foreach (StitchedFragmentSymbol stitchedFragmentNode in stitchedEffect.StitchedFragments)
			{
				if (seenFragmentTypes.Contains(stitchedFragmentNode.FragmentNode.Name))
					continue;
				GenerateHeaderCode(generator, stitchedFragmentNode);
				seenFragmentTypes.Add(stitchedFragmentNode.FragmentNode.Name);
			}
		}
Пример #2
0
		public EffectCodeGenerator(
			StitchedEffectSymbol stitchedEffect, ShaderProfile targetShaderProfile,
			TextWriter writer)
		{
			_stitchedEffect = stitchedEffect;
			_targetShaderProfile = targetShaderProfile;
			_output = new ScriptTextWriter(writer);
			_context = new GeneratorContext
			{
				TargetShaderProfile = _targetShaderProfile
			};
		}
		public static List<ExportedValue> GetExportedValues(StitchedEffectSymbol stitchedEffect)
		{
			ExportDictionary exports = new ExportDictionary();
			List<ExportedValue> exportedValues = new List<ExportedValue>();
			foreach (StitchedFragmentSymbol stitchedFragment in stitchedEffect.StitchedFragments)
			{
				foreach (ShaderCodeBlockNode codeBlock in stitchedFragment.FragmentNode.VertexShaders)
					PreProcessCodeBlock(stitchedFragment.UniqueName, codeBlock, exports, exportedValues, true);
				foreach (ShaderCodeBlockNode codeBlock in stitchedFragment.FragmentNode.PixelShaders)
					PreProcessCodeBlock(stitchedFragment.UniqueName, codeBlock, exports, exportedValues, true);
			}
			return exportedValues;
		}
Пример #4
0
		public static void GenerateAllSamplers(EffectCodeGenerator generator, StitchedEffectSymbol stitchedEffect)
		{
			generator.ForEachFragment(WriteSamplers);
		}
Пример #5
0
		public static void GenerateAllTechniques(EffectCodeGenerator generator, StitchedEffectSymbol stitchedEffect,
			bool generateVertexShader)
		{
			foreach (TechniqueSymbol technique in stitchedEffect.Techniques)
				GenerateTechnique(generator, technique, generateVertexShader);
		}
Пример #6
0
		public static void WriteAllVertexInputStructures(EffectCodeGenerator generator, StitchedEffectSymbol stitchedEffect)
		{
			generator.ForEachPass(WriteVertexInputStructures);
		}
Пример #7
0
		public static void WriteAllPixelOutputStructs(EffectCodeGenerator generator, StitchedEffectSymbol stitchedEffect)
		{
			generator.ForEachPass(WritePixelOutputStructs);
		}
Пример #8
0
		public static void WriteAllVertexShaders(EffectCodeGenerator generator, StitchedEffectSymbol stitchedEffect)
		{
			generator.ForEachPass(WriteVertexShaders);
		}