Esempio 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 = "linkage">A dynamic class linkage interface.</param>
        public GeometryShader(Device device, byte[] shaderBytecode, ClassLinkage linkage = null)
            : base(IntPtr.Zero)
        {
            if (shaderBytecode == null)
            {
                throw new ArgumentNullException("shaderBytecode", "ShaderBytecode cannot be null");
            }

            unsafe
            {
                fixed(void *pBuffer = shaderBytecode)
                device.CreateGeometryShader((IntPtr)pBuffer, shaderBytecode.Length, linkage, this);
            }
        }