Ejemplo n.º 1
0
 /// <summary>
 /// <p>Creates an effect from a binary effect or file.</p>
 /// </summary>
 /// <param name="dataRef"><dd>  <p>Blob of compiled effect data.</p> </dd></param>
 /// <param name="dataLength"><dd>  <p>Length of the data blob.</p> </dd></param>
 /// <param name="fXFlags"><dd>  <p>No effect flags exist. Set to zero.</p> </dd></param>
 /// <param name="deviceRef"><dd>  <p>Pointer to the <strong><see cref="SharpDX.Direct3D11.Device"/></strong> on which to create Effect resources.</p> </dd></param>
 /// <param name="effectOut"><dd>  <p>Address of the newly created <strong><see cref="SharpDX.Direct3D11.Effect"/></strong> interface.</p> </dd></param>
 /// <param name="srcName">No documentation.</param>
 /// <returns><p>The return value is one of the values listed in Direct3D 11 Return Codes.</p></returns>
 /// <remarks>
 /// <p><strong>Note</strong>??You must use Effects 11 source to build  your effects-type application. For more info about using Effects 11 source, see Differences Between Effects 10 and Effects 11.</p>
 /// </remarks>
 /// <include file='.\..\Documentation\CodeComments.xml' path="/comments/comment[@id='D3DX11CreateEffectFromMemory']/*"/>
 /// <msdn-id>ff476273</msdn-id>
 /// <unmanaged>HRESULT D3DX11CreateEffectFromMemory([In, Buffer] const void* pData,[In] SIZE_T DataLength,[In] unsigned int FXFlags,[In] ID3D11Device* pDevice,[Out, Fast] ID3DX11Effect** ppEffect,[In, Optional] const char* srcName)</unmanaged>
 /// <unmanaged-short>D3DX11CreateEffectFromMemory</unmanaged-short>
 public static void CreateEffectFromMemory(System.IntPtr dataRef,
                                           SharpDX.PointerSize dataLength,
                                           int fXFlags,
                                           SharpDX.Direct3D11.Device deviceRef,
                                           SharpDX.Direct3D11.Effect effectOut,
                                           string srcName)
 {
     unsafe
     {
         IntPtr         effectOut_ = IntPtr.Zero;
         IntPtr         srcName_   = Utilities.StringToHGlobalAnsi(srcName);
         SharpDX.Result __result__;
         if (IntPtr.Size == 4)
         {
             __result__ = D3DX11CreateEffectFromMemory_11_1_x86(dataRef, dataLength, fXFlags, deviceRef.NativePointer, out effectOut_, srcName_);
         }
         else
         {
             __result__ = D3DX11CreateEffectFromMemory_11_1_x64(dataRef, dataLength, fXFlags, deviceRef.NativePointer, out effectOut_, srcName_);
         }
         ((SharpDX.Direct3D11.Effect)effectOut).NativePointer = effectOut_;
         Marshal.FreeHGlobal(srcName_);
         __result__.CheckError();
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Compiles the effect10 from memory.
        /// </summary>
        /// <param name="dataRef">The data ref.</param>
        /// <param name="dataLength">Length of the data.</param>
        /// <param name="srcFileNameRef">The SRC file name ref.</param>
        /// <param name="definesRef">The defines ref.</param>
        /// <param name="includeRef">The include ref.</param>
        /// <param name="hlslFlags">The h LSL flags.</param>
        /// <param name="fxFlags">The f X flags.</param>
        /// <param name="compiledEffectOut">The compiled effect out.</param>
        /// <param name="errorsOut">The errors out.</param>
        /// <returns>Result code.</returns>
        /// <unmanaged>HRESULT D3D10CompileEffectFromMemory([In] void* pData,[In] SIZE_T DataLength,[In] const char* pSrcFileName,[In, Buffer, Optional] const D3D_SHADER_MACRO* pDefines,[In] ID3DInclude* pInclude,[In] D3DCOMPILE_SHADER_FLAGS HLSLFlags,[In] D3DCOMPILE_EFFECT_FLAGS FXFlags,[In] ID3D10Blob** ppCompiledEffect,[In] ID3D10Blob** ppErrors)</unmanaged>
        public static SharpDX.Result CompileEffect10FromMemory(
            System.IntPtr dataRef,
            SharpDX.PointerSize dataLength,
            string srcFileNameRef,
            SharpDX.Direct3D.ShaderMacro[] definesRef,
            System.IntPtr includeRef,
            SharpDX.D3DCompiler.ShaderFlags hlslFlags,
            SharpDX.D3DCompiler.EffectFlags fxFlags,
            out SharpDX.Direct3D.Blob compiledEffectOut,
            out SharpDX.Direct3D.Blob errorsOut)
        {
            unsafe
            {
                IntPtr srcFileNameRef_ = Marshal.StringToHGlobalAnsi(srcFileNameRef);
                SharpDX.Direct3D.ShaderMacro.__Native[] definesRef__ = (definesRef == null)
                                                                           ? null
                                                                           : new SharpDX.Direct3D.ShaderMacro.__Native[definesRef.Length];
                if (definesRef != null)
                {
                    for (int i = 0; i < definesRef.Length; i++)
                    {
                        definesRef[i].__MarshalTo(ref definesRef__[i]);
                    }
                }
                IntPtr         compiledEffectOut_ = IntPtr.Zero;
                IntPtr         errorsOut_         = IntPtr.Zero;
                SharpDX.Result __result__;
                fixed(void *definesRef_ = definesRef__)
                {
                    __result__ = SharpDX.D3DCompiler.LocalInterop.CalliFuncint(
                        (void *)dataRef,
                        (void *)dataLength,
                        (void *)srcFileNameRef_,
                        definesRef_,
                        (void *)includeRef,
                        unchecked ((int)hlslFlags),
                        unchecked ((int)fxFlags),
                        &compiledEffectOut_,
                        &errorsOut_,
                        (void *)D3D10CompileEffectFromMemory_);
                }

                Marshal.FreeHGlobal(srcFileNameRef_);
                if (definesRef != null)
                {
                    for (int i = 0; i < definesRef.Length; i++)
                    {
                        definesRef[i].__MarshalFree(ref definesRef__[i]);
                    }
                }
                compiledEffectOut = (compiledEffectOut_ == IntPtr.Zero) ? null : new SharpDX.Direct3D.Blob(compiledEffectOut_);
                errorsOut         = (errorsOut_ == IntPtr.Zero) ? null : new SharpDX.Direct3D.Blob(errorsOut_);
                __result__.CheckError();
                return(__result__);
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// <p> Deserializes a root signature so you can determine the layout definition (<strong><see cref="SharpDX.Direct3D12.RootSignatureDescription"/></strong>). </p>
        /// </summary>
        /// <param name="srcDataRef">No documentation.</param>
        /// <param name="srcDataSizeInBytes">No documentation.</param>
        /// <param name="rootSignatureDeserializerInterfaceRef">No documentation.</param>
        /// <param name="rootSignatureDeserializerOut">No documentation.</param>
        /// <returns><p> Returns <strong><see cref="SharpDX.Result.Ok"/></strong> if successful; otherwise, returns one of the Direct3D 12 Return Codes. </p></returns>
        /// <remarks>
        /// <p> If an application has a serialized root signature already or has a compiled shader that contains a root signature and wants to determine the layout definition, it can call <strong><see cref="SharpDX.Direct3D12.D3D12.CreateRootSignatureDeserializer"/></strong> to generate a <strong><see cref="SharpDX.Direct3D12.RootSignatureDeserializer"/></strong> interface. <strong>ID3D12RootSignatureDeserializer::GetRootSignature</strong> can return the deserialized data structure (<strong><see cref="SharpDX.Direct3D12.RootSignatureDescription"/></strong>). <strong><see cref="SharpDX.Direct3D12.RootSignatureDeserializer"/></strong> just owns the lifetime of the memory for the deserialized data structure. </p><p> The <strong>REFIID</strong>, or <strong><see cref="System.Guid"/></strong>, of the interface to the root signature deserializer can be obtained by using the __uuidof() macro. For example, __uuidof(<strong><see cref="SharpDX.Direct3D12.RootSignatureDeserializer"/></strong>) will get the <strong><see cref="System.Guid"/></strong> of the interface to a root signature deserializer. </p><p> The function signature PFN_D3D12_CREATE_ROOT_SIGNATURE_DESERIALIZER is provided as a typedef, so that you can use dynamic linking techniques (GetProcAddress) instead of statically linking. </p>
        /// </remarks>
        /// <include file='.\..\Documentation\CodeComments.xml' path="/comments/comment[@id='D3D12CreateRootSignatureDeserializer']/*"/>
        /// <msdn-id>dn859362</msdn-id>
        /// <unmanaged>HRESULT D3D12CreateRootSignatureDeserializer([In, Buffer] const void* pSrcData,[In] SIZE_T SrcDataSizeInBytes,[In] const GUID&amp; pRootSignatureDeserializerInterface,[Out] void** ppRootSignatureDeserializer)</unmanaged>
        /// <unmanaged-short>D3D12CreateRootSignatureDeserializer</unmanaged-short>
        public static void CreateRootSignatureDeserializer(System.IntPtr srcDataRef, SharpDX.PointerSize srcDataSizeInBytes, System.Guid rootSignatureDeserializerInterfaceRef, out System.IntPtr rootSignatureDeserializerOut)
        {
            unsafe {
                SharpDX.Result __result__;

                fixed(void *rootSignatureDeserializerOut_ = &rootSignatureDeserializerOut)
                __result__ =
                    D3D12CreateRootSignatureDeserializer_((void *)srcDataRef, (void *)srcDataSizeInBytes, &rootSignatureDeserializerInterfaceRef, rootSignatureDeserializerOut_);

                __result__.CheckError();
            }
        }
Ejemplo n.º 4
0
		// Method to marshal from native to managed struct
        internal unsafe void __MarshalFrom(ref __Native @ref)
        {            
            this.Name = ( @ref.Name == IntPtr.Zero )?null:Marshal.PtrToStringAnsi(@ref.Name);
            this.AnnotationCount = @ref.AnnotationCount;
            this.PIAInputSignature = @ref.PIAInputSignature;
            this.IAInputSignatureSize = @ref.IAInputSignatureSize;
            this.StencilReference = @ref.StencilReference;
            this.SampleMask = @ref.SampleMask;
            this.BlendFactor = @ref.BlendFactor;
        }
Ejemplo n.º 5
0
     /// <summary>	
     /// <p>Retrieves the name of this <strong><see cref="SharpDX.Direct3D9.XFileSaveData"/></strong> file data node.</p>	
     /// </summary>	
     /// <param name="arg0">No documentation.</param>	
     /// <param name="arg1">No documentation.</param>	
     /// <returns><p>If the method succeeds, the return value is <see cref="SharpDX.Result.Ok"/>. If the method fails, the following value will be returned: D3DXFERR_BADVALUE.</p></returns>	
     /// <remarks>	
     /// <p>For this method to succeed, either <em>szName</em> or <em>puiSize</em> must be non-<strong><c>null</c></strong>.</p>	
     /// </remarks>	
     /// <include file='.\..\Documentation\CodeComments.xml' path="/comments/comment[@id='ID3DXFileSaveData::GetName']/*"/>	
     /// <msdn-id>bb173950</msdn-id>	
     /// <unmanaged>HRESULT ID3DXFileSaveData::GetName([In] char* arg0,[Out] SIZE_T* arg1)</unmanaged>	
     /// <unmanaged-short>ID3DXFileSaveData::GetName</unmanaged-short>	
     public void GetName(string arg0, out SharpDX.PointerSize arg1) {
         unsafe {
             IntPtr arg0_ = Utilities.StringToHGlobalAnsi(arg0);
             arg1 = new SharpDX.PointerSize();
             SharpDX.Result __result__;
             fixed (void* arg1_ = &arg1)
                 __result__= 
 				SharpDX.Direct3D9.LocalInterop.Calliint(_nativePointer, (void*)arg0_, arg1_,((void**)(*(void**)_nativePointer))[4]);		
             Marshal.FreeHGlobal(arg0_ );
             __result__.CheckError();
         }
     }
Ejemplo n.º 6
0
     /// <summary>	
     /// <p>Retrieves the number of child objects in this file data object.</p>	
     /// </summary>	
     /// <param name="arg0"><dd>  <p>Address of a reference to receive the number of child objects in this file data object.</p> </dd></param>	
     /// <returns><p>If the method succeeds, the return value is <see cref="SharpDX.Result.Ok"/>. If the method fails, the following value will be returned: D3DXFERR_BADVALUE.</p></returns>	
     /// <include file='.\..\Documentation\CodeComments.xml' path="/comments/comment[@id='ID3DXFileEnumObject::GetChildren']/*"/>	
     /// <msdn-id>bb205849</msdn-id>	
     /// <unmanaged>HRESULT ID3DXFileEnumObject::GetChildren([Out] SIZE_T* arg0)</unmanaged>	
     /// <unmanaged-short>ID3DXFileEnumObject::GetChildren</unmanaged-short>	
     internal void GetChildren(out SharpDX.PointerSize arg0) {
         unsafe {
             arg0 = new SharpDX.PointerSize();
             SharpDX.Result __result__;
             fixed (void* arg0_ = &arg0)
                 __result__= 
 				SharpDX.Direct3D9.LocalInterop.Calliint(_nativePointer, arg0_,((void**)(*(void**)_nativePointer))[4]);		
             __result__.CheckError();
         }
     }