Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
CompilerParameterGeneratorBase.cs
Go to the documentation of this file.
1 // Copyright (c) 2014 Silicon Studio Corp. (http://siliconstudio.co.jp)
2 // This file is distributed under GPL v3. See LICENSE.md for details.
3 using System.Collections.Generic;
4 
5 using SiliconStudio.Assets.Compiler;
6 using SiliconStudio.Core.Diagnostics;
7 using SiliconStudio.Paradox.Effects;
8 using SiliconStudio.Paradox.Effects.Data;
9 using SiliconStudio.Paradox.Shaders.Compiler;
10 
11 namespace SiliconStudio.Paradox.Assets.Effect
12 {
14  {
15  public virtual int GeneratorPriority { get; private set; }
16 
17  public abstract IEnumerable<CompilerParameters> Generate(AssetCompilerContext context, CompilerParameters baseParameters, ILogger log);
18 
19  /// <summary>
20  /// Adds the parameters from the ParameterCollectionData to the destination ParameterCollection. Excludes GraphicsResourceBase parameters.
21  /// </summary>
22  /// <param name="sourceParameters">The source ParameterCollectionData.</param>
23  /// <param name="destParameters">The destination ParameterCollection.</param>
24  protected static void AddToParameters(ParameterCollectionData sourceParameters, ParameterCollection destParameters)
25  {
26  if (sourceParameters != null)
27  {
28  foreach (var keyValue in sourceParameters)
29  {
30  // only keep what can be assigned
31  if (keyValue.Value.GetType().IsAssignableFrom(keyValue.Key.PropertyType))
32  destParameters.SetObject(keyValue.Key, keyValue.Key.ConvertValue(keyValue.Value));
33  }
34  }
35  }
36  }
37 }
static void AddToParameters(ParameterCollectionData sourceParameters, ParameterCollection destParameters)
Adds the parameters from the ParameterCollectionData to the destination ParameterCollection. Excludes GraphicsResourceBase parameters.
Data type for SiliconStudio.Paradox.Effects.ParameterCollection.
Definition: ParadoxData.cs:31
The context used when compiling an asset in a Package.
A dynamic generator of CompilerParameters from a source parameters. See remarks.
Interface for logging.
Definition: ILogger.cs:8
A container to handle a hierarchical collection of effect variables.