New DP2 Stream Drawing Tokens

DirectX 8.0's support for multiple streams of vertex data requires that new DP2 drawing tokens be introduced. These new tokens are necessary because existing drawing tokens assumed that there was a single pointer to vertex data for a particular drawing instruction. With multiple streams, this is no longer the case. A drawing command may well access multiple vertex data buffers simultaneously through streams.

Note that these drawing tokens replace the existing primitive type specific tokens (for example, D3DDP2OP_POINTS, D3DDP2OP_TRIANGLELIST, D3DDP2OP_TRIANGLESTRIP) for calls through the new DirectX 8.0 interfaces only. Calls made through DX7 or earlier interfaces are still passed through the DDI as the old style drawing tokens. Therefore, a DX8 driver is required to support both old and new style drawing tokens.

The indexed and nonindexed drawing tokens have two variants. For example, nonindexed drawing is accomplished by the tokens D3DDP2OP_DRAWPRIMITIVE and D3DDP2OP_DRAWPRIMITIVE2. Similarly, indexed drawing is accomplished by the tokens D3DDP2OP_DRAWINDEXEDPRIMITIVE and D3DDP2OP_DRAWINDEXEDPRIMITIVE2.

The main distinction between the two variants is that D3DDP2OP_DRAWPRIMITIVE2 and D3DDP2OP_DRAWINDEXEDPRIMITIVE2 are used when the vertex data has been transformed by the runtime. This is either because the driver/hardware combination does not support hardware vertex processing or the software vertex processing has been explicitly selected. For these tokens, only stream zero is used and it contains transformed and lit vertices.

D3DDP2OP_DRAWPRIMITIVE and D3DDP2OP_DRAWINDEXEDPRIMITIVE are used then the runtime has not processed the vertex data. Thus, these tokens can supply untransformed vertex data when the hardware supports hardware vertex processing or transformed vertex data when the application supplies transformed data directly to the runtime. In this case, any number of streams (up to MaxStreams) can be active. These variants (along with the other new drawing token, D3DDP2OP_CLIPPEDTRIANGLEFAN) enable optimal code paths in the runtime and the distinctions beyond those described here are not significant to the driver.



Send comments about this topic to Microsoft