Share via


D3DHAL_DP2VERTEXSHADER

This structure is only supported to set the current fixed function FVF (flexible vertex format).

The D3DHAL_DP2VERTEXSHADER structure is used to set the current vertex shader, or delete a vertex shader, depending on the opcode received (D3DDP2OP_SETVERTEXSHADER or D3DDP2OP_DELETEVERTEXSHADER) by D3dDrawPrimitives2.

typedef struct _D3DHAL_DP2VERTEXSHADER {
  DWORD dwHandle;
} D3DHAL_DP2VERTEXSHADER, *LPD3DHAL_DP2VERTEXSHADER;

Members

  • dwHandle
    Specifies the handle assigned by the run time to the vertex shader to set or delete. For delete, the handle is guaranteed to be non-zero. For set, the supplied handle can be zero indicating that no vertex shader is currently realized. In this case the driver should invalidate all previously set streams and free any data associated with them. The run time guarantees that streams will be reinitialized with D3DDP2OP_SETSTREAMSOURCE or D3DDP2OP_SETSTREAMSOURCEUM and a new vertex shader will be selected using D3DHAL_DP2VERTEXSHADER before any subsequent rendering operations.

Remarks

All Direct3D drivers must support the D3DDP2OP_SETVERTEXSHADER token because it will be sent even if the driver does not support programmable vertex processing. In that case, however, the shader handle will always be an FVF code indicating fixed function processing of the vertex data. The driver should use the FVF code stored in the dwHandle field as the format of the vertex data in stream zero. A driver that does support programmable vertex processing must examine the handle to determine whether it refers to a shader previously created with D3DDP2OP_CREATEVERTEXSHADER or an FVF code and take the appropriate action.

Pixel and vertex shaders are orthogonal. Thus, if a legacy FVF code is selected as the current vertex shader this does not imply legacy pixel processing. In order to reset pixel processing to a nonprogrammable mode the current pixel shader must also be set to zero. Care should be taken in the driver to only reset vertex-processing state to a fixed function mode and not pixel processing state when the vertex shader is set to an FVF code.

When switching from fixed function vertex processing to programmable vertex processing, the values of legacy render state and matrices should be preserved. If and when a switch from programmable to fixed function vertex processing occurs (the driver receives a D3DDP2OP_SETVERTEXSHADER with an FVF as the shader handle), that preserved state should be restored.

When switching between programmable shaders, any constant register that has a value specified in the definition of that shader should be set to that value. The values of all other constant registers should remain unchanged.

Requirements

OS Versions: Windows CE .NET 4.0 and later.
Header: D3dhal.h.

See Also

D3DDP2OP_SETVERTEXSHADER | D3DDP2OP_DELETEVERTEXSHADER | D3dDrawPrimitives2 | D3DDP2OP_SETSTREAMSOURCE | D3DDP2OP_SETSTREAMSOURCEUM | D3DDP2OP_CREATEVERTEXSHADER | D3DHAL_XXX Structures

 Last updated on Tuesday, May 18, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.