3 using System.Collections.Generic;
6 using SiliconStudio.Assets.Compiler;
7 using SiliconStudio.BuildEngine;
8 using SiliconStudio.Core;
9 using SiliconStudio.Core.Diagnostics;
10 using SiliconStudio.Paradox.Assets.Effect.ValueGenerators;
11 using SiliconStudio.Paradox.Effects;
12 using SiliconStudio.Paradox.Shaders.Compiler;
14 namespace SiliconStudio.
Paradox.Assets.Effect
16 internal class LightingCompileGenerator : PermutationGeneratorBuildStep
18 protected readonly LightingAsset Asset;
21 : base(context, EffectLibraryAssetCompiler.RegisteredCompilerParametersGenerators.ToList())
26 public override string Title
30 return "LightingCompileGenerator";
34 public List<CompilerParameters>
Execute()
36 var steps =
new List<BuildStep>();
40 var log =
new LoggerResult(
"Lighting permutation of asset [{0}]".ToFormat(Asset.Id));
44 Platform = Context.GetGraphicsPlatform(),
45 Profile = Context.GetGraphicsProfile()
49 var children = Asset.Permutations == null ? null : Asset.Permutations.Children;
51 var result =
new List<CompilerParameters>();
53 foreach (var parametersPerPermutation
in GeneratePermutation(rootParameters, keys, children, log))
55 var parameters = parametersPerPermutation.Clone();
56 result.Add(parameters);
63 if (keys == null || keys.Count == 0)
65 if (permutations == null || permutations.Count == 0)
67 yield
return parameters;
71 for (
int permutationIndex = 0; permutationIndex < permutations.Count; permutationIndex++)
73 var permutation = permutations[permutationIndex];
74 foreach (var parametersPerPermutations
in GeneratePermutation(parameters, permutation.
Keys, permutation.Children, log))
76 yield
return parametersPerPermutations;
83 foreach (var parametersPerKeyValuePermutations
in GenerateKeysPermutation(parameters, keys.GenerateKeyValues()))
85 foreach (var subParameters
in GeneratePermutation(parametersPerKeyValuePermutations, null, permutations, log))
87 yield
return subParameters;
SiliconStudio.Core.Diagnostics.LoggerResult LoggerResult
Parameters used for compilation.
Default implementation for a IEffectParameterGenerator using a dictionary of ParameterKey associated ...
The context used when compiling an asset in a Package.
IEnumerable< ParameterKey > Keys
Gets the keys of this collection.