D3DXGetShaderSamplers

Get the sampler names referenced in a shader.

HRESULT D3DXGetShaderSamplers(
  CONST DWORD* pFunction,
  LPCSTR* pSamplers,
  UINT* pCount
);

Parameters

pFunction
[in] Pointer to the shader function DWORD stream.
pSamplers
[in, out] Pointer to an array of LPCSTRs. The function will fill this array with pointers to the sampler names contained within pFunction. The maximum array size is the maximum number of sampler registers (16 for vs_3_0 and ps_3_0).

To find the number of samplers used, check pCount after calling D3DXGetShaderSamplers with pSamplers = NULL.

pCount
[out] Returns the number of samplers referenced by the shader.

Return Values

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.

Requirements

Header: Declared in D3dx9shader.h.