Gathers shader fragments into a buffer to be passed to the fragment linker.
HRESULT D3DXGatherFragmentsFromFile( LPCTSTR pSrcFile, CONST D3DXMACRO* pDefines, LPD3DXINCLUDE pInclude, DWORD Flags, LPD3DXBUFFER* ppShader, LPD3DXBUFFER * ppErrorMsgs );
If the function succeeds, the return value is D3D_OK. If the function fails, the return value can be one of the following: D3DERR_INVALIDCALL, D3DXERR_INVALIDDATA, E_OUTOFMEMORY.
The compiler setting also determines the function version. If Unicode is defined, the function call resolves to D3DXGatherFragmentsFromFileW. Otherwise, the function call resolves to D3DXGatherFragmentsFromFileA because ANSI strings are being used.
To compile a fragment within an effect call D3DXGatherFragmentsFromFile as shown here:
DWORD g_dwShaderFlags; // Shader compilation/linking flags LPD3DXBUFFER g_pCompiledFragments = NULL; // Compile the fragments to a buffer. The fragments must be linked together to form // a shader before they can be used for rendering. V_RETURN( D3DXGatherFragmentsFromFile( L"FragmentLinker.fx", NULL, NULL, g_dwShaderFlags, &g_pCompiledFragments, NULL ) );
Header: Declared in D3dx9shader.h.