Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
EffectInputSignature.Direct3D.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 #if SILICONSTUDIO_PARADOX_GRAPHICS_API_DIRECT3D
4 using SiliconStudio.Core.Storage;
5 
6 namespace SiliconStudio.Paradox.Graphics
7 {
8  public partial class EffectInputSignature
9  {
10  private readonly byte[] bytecode;
11 
12  internal EffectInputSignature(ObjectId id, byte[] bytecode)
13  {
14  this.Id = id;
15  this.bytecode = bytecode;
16  }
17 
18  internal byte[] NativeSignature
19  {
20  get
21  {
22  return bytecode;
23  }
24  }
25 
26  public override string ToString()
27  {
28  var description = "Input Parameters: ";
29 
30  var shaderReflection = new SharpDX.D3DCompiler.ShaderReflection(NativeSignature);
31  for (int i = 0; i < shaderReflection.Description.InputParameters; i++)
32  {
33  var parameterDescription = shaderReflection.GetInputParameterDescription(i);
34  description += parameterDescription.SemanticName+parameterDescription.SemanticIndex;
35 
36  if (i != shaderReflection.Description.InputParameters - 1)
37  description += ", ";
38  }
39 
40  return description;
41  }
42  }
43 }
44 #endif