Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
Shader.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 System;
5 using SharpDX.Direct3D11;
6 
7 using SiliconStudio.Paradox.Shaders;
8 
9 namespace SiliconStudio.Paradox.Graphics
10 {
11  public partial class Shader
12  {
13  internal byte[] NativeInputSignature;
14 
15  private Shader(GraphicsDevice device, ShaderStage shaderStage, byte[] shaderBytecode)
16  : base(device)
17  {
18  this.stage = shaderStage;
19 
20  switch (shaderStage)
21  {
22  case ShaderStage.Vertex:
23  NativeDeviceChild = new VertexShader(device.NativeDevice, shaderBytecode);
24  NativeInputSignature = shaderBytecode;
25  break;
26  case ShaderStage.Hull:
27  NativeDeviceChild = new HullShader(device.NativeDevice, shaderBytecode);
28  break;
29  case ShaderStage.Domain:
30  NativeDeviceChild = new DomainShader(device.NativeDevice, shaderBytecode);
31  break;
32  case ShaderStage.Geometry:
33  NativeDeviceChild = new GeometryShader(device.NativeDevice, shaderBytecode);
34  break;
35  case ShaderStage.Pixel:
36  NativeDeviceChild = new PixelShader(device.NativeDevice, shaderBytecode);
37  break;
38  case ShaderStage.Compute:
39  NativeDeviceChild = new ComputeShader(device.NativeDevice, shaderBytecode);
40  break;
41  default:
42  throw new ArgumentOutOfRangeException("shaderStage");
43  }
44  }
45  }
46 }
47 #endif
ShaderStage
Enum to specify shader stage.
Definition: ShaderStage.cs:12