D3DXGetShaderSamplers function

Get the sampler names referenced in a shader.

Syntax

HRESULT D3DXGetShaderSamplers(
  _In_    const DWORD  *pFunction,
  _Inout_       LPCSTR *pSamplers,
  _Out_         UINT   *pCount
);

Parameters

pFunction [in]

Type: const DWORD*

Pointer to the shader function DWORD stream.

pSamplers [in, out]

Type: LPCSTR*

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]

Type: UINT*

Returns the number of samplers referenced by the shader.

Return value

Type: HRESULT

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

Requirement Value
Header
D3DX9Shader.h
Library
D3dx9.lib

See also

Shader Functions