Ejemplo n.º 1
0
 /// <summary>
 ///   Initializes a new instance of the <see cref = "T:SharpDX.Direct3D11.GeometryShader" /> class.
 /// </summary>
 /// <param name = "device">The device used to create the shader.</param>
 /// <param name = "shaderBytecode">The compiled shader bytecode.</param>
 /// <param name = "elements">An array of <see cref = "T:SharpDX.Direct3D11.StreamOutputElement" /> instances describing the layout of the output buffers.</param>
 /// <param name = "bufferedStrides">An array of buffer strides; each stride is the size of an element for that buffer.</param>
 /// <param name = "rasterizedStream">The index number of the stream to be sent to the rasterizer stage. Set to NoRasterizedStream if no stream is to be rasterized.</param>
 /// <param name = "linkage">A dynamic class linkage interface.</param>
 public GeometryShader(Device device, byte[] shaderBytecode, StreamOutputElement[] elements,
                       int[] bufferedStrides, int rasterizedStream, ClassLinkage linkage = null)
     : base(IntPtr.Zero)
 {
     unsafe
     {
         fixed(void *pBuffer = shaderBytecode)
         device.CreateGeometryShaderWithStreamOutput((IntPtr)pBuffer, shaderBytecode.Length, elements, elements.Length,
                                                     bufferedStrides, bufferedStrides.Length, rasterizedStream,
                                                     linkage, this);
     }
 }