D3DXGetShaderInputSemantics function

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

Syntax


HRESULT D3DXGetShaderInputSemantics(
  _In_   const DWORD *pFunction,
  _In_   D3DXSEMANTIC *pSemantics,
  _Out_  UINT *pCount
);

Parameters

pFunction [in]

Type: const DWORD*

Pointer to the shader function DWORD stream.

pSemantics [in]

Type: D3DXSEMANTIC*

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]

Type: UINT*

Returns the number of elements in pSemantics.

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.

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

D3DX9Shader.h

Library

D3dx9.lib

 

 

Community Additions

ADD
Show:
© 2014 Microsoft