Compiles text-based FX source in memory using the fx_5_0 profile and then creates an effect.

HRESULT D3DX11CompileEffectFromMemory(
   _In_reads_bytes_(DataLength) LPCVOID pData,
   _In_ SIZE_T DataLength, 
   _In_opt_z_ LPCSTR srcName,
   _In_opt_ const D3D_SHADER_MACRO *pDefines,
   _In_opt_ ID3DInclude *pInclude,
   _In_ UINT HLSLFlags,
   _In_ UINT FXFlags,
   _In_ ID3D11Device *pDevice,
   _Out_ ID3DX11Effect **ppEffect,
   _Outptr_opt_result_maybenull_ ID3DBlob **ppErrors );

Parameters

pData, DataLength: Pointer to memory buffer containing the FX source to compile.

srcName: Optional source name used in compile error output and for 'debug object naming'

pDefines: An array of nul-terminated macro definitions. See D3D_SHADER_MACRO http://msdn.microsoft.com/en-us/library/ff728732.aspx

pInclude: A pointer to a ID3DInclude for handling include files. Can be set to D3D_COMPILE_STANDARD_FILE_INCLUDE when using D3DCompile #46 or later. Setting this to nullptr will cause an error if the source contains an #include statement. See ID3DInclude. http://msdn.microsoft.com/en-us/library/ff728746.aspx

HLSLFlags: Same as D3DCompile Flags1. See D3DCOMPILE constants. http://msdn.microsoft.com/en-us/library/gg615083.aspx

FXFlags: Same as D3DCompile Flags2. See D3DCOMPILE_EFFECT constants. http://msdn.microsoft.com/en-us/library/gg615084.aspx

pDevice: Direct3D device for creating rendering resources and modifying state

ppEffect: Pointer to the newly created effect instance.

ppErrors: Optional compiler error messages return.

Last edited Jul 16, 2013 at 1:32 AM by walbourn, version 5