IDirect3DDevice9::CreateVertexShader
Creates a vertex shader.
HRESULT CreateVertexShader(
CONST DWORD * pFunction,
IDirect3DVertexShader9** ppShader
);
Parameters
- pFunction
- [in] Pointer to an array of tokens that represents the vertex shader, including any embedded debug and symbol table information.
- ppShader
- [out, retval] Pointer to the returned vertex shader interface (see IDirect3DVertexShader9).
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: D3DERR_INVALIDCALL, D3DERR_OUTOFVIDEOMEMORY, E_OUTOFMEMORY.
Remarks
When a device is created, IDirect3D9::CreateDevice uses the behavior flag to determine whether to process vertices in hardware or software. There are three possibilities:
- Process vertices in hardware by setting D3DCREATE_HARDWARE_VERTEXPROCESSING.
- Process vertices in software by setting D3DCREATE_SOFTWARE_VERTEXPROCESSING.
- Process vertices in either hardware or software by setting D3DCREATE_MIXED_VERTEXPROCESSING. To switch a mixed-mode device between software and hardware processing, use IDirect3DDevice9::SetSoftwareVertexProcessing.
For an example using D3DXCompileShader, see HLSLwithoutEffects Sample.
Requirements
Header: Declared in D3d9.h.