LPD3DHAL_DRAWPRIMITIVES2CB - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
// d3dhal.h

LPD3DHAL_DRAWPRIMITIVES2CB Lpd3dhalDrawprimitives2cb;

DWORD Lpd3dhalDrawprimitives2cb(
  LPD3DHAL_DRAWPRIMITIVES2DATA unnamedParam1
)
{...}
View the official Windows Driver Kit DDI reference

NtDoc

No description available.

Windows Driver Kit DDI reference (nc-d3dhal-lpd3dhal_drawprimitives2cb)

LPD3DHAL_DRAWPRIMITIVES2CB callback function

Description

The D3dDrawPrimitives2 function renders primitives and returns the updated render state.

Parameters

unnamedParam1

pdp [in]

Points to a D3DHAL_DRAWPRIMITIVES2DATA structure that contains the information required for the driver to render one or more primitives.

Return value

D3dDrawPrimitives2 returns one of the following callback codes:

Remarks

D3dDrawPrimitives2 must be implemented in Microsoft Direct3D drivers.

The driver must do the following:

The driver does not need to probe for readability of the memory where the command and vertex buffers are stored. However, the driver must stay within the bounds specified by the dwCommandLength and dwVertexLength members of D3DHAL_DRAWPRIMITIVES2DATA.

If the driver must fail D3dDrawPrimitives2, it should fill in the dwErrorOffset member of D3DHAL_DRAWPRIMITIVES2DATA with the offset into the command buffer where the first unhandled D3DHAL_DP2COMMAND can be found.

Note The following comments are valid only for applications that are written using Microsoft DirectX 7.0 interfaces and that communicate with drivers through DirectX 8.0 and DirectX 8.1 runtimes.

The following comments are not valid for applications that are written using DirectX 8.0 and later interfaces because such applications no longer use the concept of a current vertex buffer (that is, vertex data is no longer passed in via the lpDDVertex member of D3DHAL_DRAWPRIMITIVES2DATA). Therefore, with these applications, the driver's D3dDrawPrimitives2 function should never cause rendering from a vertex buffer to stall even if the buffer is implicit or explicit and there is an outstanding lock on it.

If the driver is used with a DirectX 8.1 or later runtime, the driver's D3dDrawPrimitives2 function should never cause rendering from the current vertex buffer (passed in via lpDDVertex) to stall if the buffer is implicit. If the buffer is explicit and there is an outstanding lock on it, the driver should stall at the end of its D3dDrawPrimitives2 function if it does not rename the buffer (does not set D3DHALDP2_SWAPVERTEXBUFFER). If the driver renames the buffer, then the driver does not stall. DirectX 8.1 and later runtimes call the driver's D3dDrawPrimitives2 function to render from a locked explicit vertex buffer only when necessary so performance is rarely affected. An implicit vertex buffer is created by the driver's CreateD3DBuffer callback with only the DDSCAPS_EXECUTEBUFFER flag set. An explicit vertex buffer is created by the driver's CreateD3DBuffer callback with the DDSCAPS_EXECUTEBUFFER and DDSCAPS2_VERTEXBUFFER flags set. The explicit vertex buffer becomes locked by the driver's LockD3DBuffer callback.

If the driver is used with a DirectX 8.0 runtime, the driver should sometimes stall when rendering from an implicit current vertex buffer to prevent synchronization issues and resulting corruption. In addition, the DirectX 8.0 runtime calls the driver's D3dDrawPrimitives2 function to render from a locked explicit current vertex buffer more often then really necessary so performance is degraded. The following are stalling workarounds for a driver that is used with a DirectX 8.0 runtime: