コード例 #1
0
ファイル: ShaderReflection.cs プロジェクト: wyrover/SharpDX
        /// <summary>
        ///   Initializes a new instance of the <see cref = "T:SharpDX.D3DCompiler.ShaderReflection" /> class from a <see cref = "T:SharpDX.D3DCompiler.ShaderBytecode" />.
        /// </summary>
        /// <param name = "shaderBytecode"></param>
        public unsafe ShaderReflection(byte[] shaderBytecode)
        {
            IntPtr temp;

            fixed(void *ptr = shaderBytecode)
            D3D.Reflect((IntPtr)ptr, shaderBytecode.Length, Utilities.GetGuidFromType(GetType()), out temp);

            NativePointer = temp;
        }
コード例 #2
0
ファイル: LibraryReflection.cs プロジェクト: wyrover/SharpDX
        /// <summary>
        ///   Initializes a new instance of the <see cref = "T:SharpDX.D3DCompiler.LibraryReflection" /> class from a <see cref = "T:SharpDX.D3DCompiler.ShaderBytecode" />.
        /// </summary>
        /// <param name = "libraryBytecode"></param>
        public unsafe LibraryReflection(byte[] libraryBytecode)
        {
            IntPtr temp;

            fixed(void *ptr = libraryBytecode)
            D3D.ReflectLibrary((IntPtr)ptr, libraryBytecode.Length, Utilities.GetGuidFromType(GetType()), out temp);

            NativePointer = temp;
        }
コード例 #3
0
ファイル: ShaderSignature.cs プロジェクト: wpwen/SharpDX
        /// <summary>
        ///   Extracts the output signature from a compiled shader or effect.
        /// </summary>
        /// <param name = "shaderBytecode">The bytecode of the compiled shader or effect.</param>
        /// <returns>The output signature of the shader or effect.</returns>
        /// <unmanaged>HRESULT D3DGetOutputSignatureBlob([In, Buffer] const void* pSrcData,[In] SIZE_T SrcDataSize,[Out] ID3D10Blob** ppSignatureBlob)</unmanaged>
        /// <msdn-id>dd607331</msdn-id>
        /// <unmanaged>HRESULT D3DGetOutputSignatureBlob([In, Buffer] const void* pSrcData,[In] SIZE_T SrcDataSize,[Out] ID3D10Blob** ppSignatureBlob)</unmanaged>
        /// <unmanaged-short>D3DGetOutputSignatureBlob</unmanaged-short>
        public unsafe static ShaderSignature GetOutputSignature(byte[] shaderBytecode)
        {
            Blob shaderSignature;

            fixed(void *ptr = shaderBytecode)
            if (D3D.GetOutputSignatureBlob((IntPtr)ptr, shaderBytecode.Length, out shaderSignature).Failure)
            {
                return(null);
            }
            return(new ShaderSignature(shaderSignature));
        }
コード例 #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Module"/> class.
        /// </summary>
        /// <param name="bytecode">The source data of the module.</param>
        public Module(ShaderBytecode bytecode)
        {
            if (bytecode == null)
            {
                throw new ArgumentNullException("bytecode");
            }

            var data = bytecode.Data;

            unsafe
            {
                fixed(void *dataPtr = &data[0])
                D3D.LoadModule(new IntPtr(dataPtr), new PointerSize(data.Length), this);
            }
        }
コード例 #5
0
 /// <summary>
 /// Initializes a new instance of <see cref="FunctionLinkingGraph"/>.
 /// </summary>
 public FunctionLinkingGraph()
 {
     D3D.CreateFunctionLinkingGraph(0, this);
 }
コード例 #6
0
 /// <summary>
 /// Initializes a new instance of <see cref="Linker"/> class.
 /// </summary>
 public Linker()
 {
     D3D.CreateLinker(this);
 }