D3DXGetShaderInputSemantics

Gets the semantics for the shader inputs. Use this method to determine the input vertex format.

HRESULT D3DXGetShaderInputSemantics(
  CONST DWORD* pFunction,
  D3DXSEMANTIC* pSemantics,
  UINT* pCount
);

Parameters

pFunction
[in] Pointer to the shader function DWORD stream.
pSemantics
[in] Pointer to an array of D3DXSEMANTIC structures. The function will fill this array with the semantics for each input element referenced by the shader. This array is assumed to contain at least MAXD3DDECLLENGTH elements. However, calling D3DXGetShaderInputSemantics with pSemantics = NULL will return the number of elements needed for pCount.
pCount
[out] Returns the number of elements in pSemantics.

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.

Remarks

Use D3DXGetShaderInputSemantics to return a list of input semantics required by the shader. This is the way to find out what the input vertex format is for a high-level shader language (HLSL) shader. If the shader has additional inputs that your vertex declaration is missing, you could create an extra vertex stream that has a stride of 0 that has the missing components with default values. For instance, this technique could be used to provide default vertex color for models that do not specify it.

Requirements

Header: Declared in D3dx9shader.h.