ID3DXFragmentLinker::LinkShader

Bb173984.XDK_CHM_BANNER_left(en-us,VS.85).jpg Bb173984.XDK_CHM_BANNER_right(en-us,VS.85).jpg

ID3DXFragmentLinker::LinkShader

Link a compiled shader at run time. This is a very lightweight operation.

  HRESULT 
  LinkShader(
  LPCSTR pProfile,
  DWORD Flags,
  CONST D3DXHANDLE * rgFragmentHandles,
  UINT cFragments,
  LPD3DXBUFFER* ppBuffer,
  LPD3DXBUFFER * ppErrorMsgs
);

Parameters

  • pProfile
    [in] Pointer to a shader profile which determines the shader instruction set. See D3DXGetVertexShaderProfile or D3DXGetPixelShaderProfile for a list of the profiles available.
  • Flags
    [in] Link options identified by various flags. The Direct3D 10 HLSL compiler is now the default. See D3DXSHADER Flags for details.
  • rgFragmentHandles
    [in] An array of shader fragment handles. See Handles (Direct3D 9).
  • cFragments
    [in] Number of fragments to be linked.
  • ppBuffer
    [out] Pointer to a buffer that contains compiled shader code. See ID3DXBuffer.
  • ppErrorMsgs
    [out, retval] Buffer containing at least the first compile error message that occurred. This includes effect compiler errors and high-level language compile errors. For more information about accessing the buffer, see ID3DXBuffer.

Return Values

If the method succeeds, the return value is D3D_OK. If the method fails, the return value can be one of the following: E_FAIL, D3DERR_INVALIDCALL, D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

Requirements

Header: Declared in D3DX9Shader.h.

Library: Use D3dx9.lib.