Example #1
0
        /// <summary>
        ///   Initializes a new instance of the <see cref = "T:SharpDX.Direct3D11.DomainShader" /> 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 DomainShader(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.CreateDomainShader((IntPtr)pBuffer, shaderBytecode.Length, linkage, this);
            }
        }