D3DHAL_DP2CREATEQUERY structure (d3dhal.h)

DirectX 9.0 and later versions only.

One or more D3DHAL_DP2CREATEQUERY structures are parsed from the command buffer by the D3dDrawPrimitives2 callback when the D3DHAL_DP2COMMAND structure's bCommand member is set to D3DDP2OP_CREATEQUERY, and are used to create resources for queries.

Syntax

typedef struct _D3DHAL_DP2CREATEQUERY {
  DWORD        dwQueryID;
  D3DQUERYTYPE QueryType;
} D3DHAL_DP2CREATEQUERY;

Members

dwQueryID

Identifies the query.

QueryType

Specifies a value from the D3DQUERYTYPE enumeration that indicates the query capability for which the driver creates resources.

Remarks

The runtime uses D3DHAL_DP2CREATEQUERY to identify each query with a unique identifier and a query type. The driver's D3dDrawPrimitives2 callback must process wPrimitiveCount D3DHAL_DP2CREATEQUERY structures from the command buffer. The value of wPrimitiveCount is specified in the D3DHAL_DP2COMMAND structure. The driver parses these structures and creates resources for the queries that they represent as necessary.

The driver creates resources for the following query types:

  • BOOL for D3DQUERYTYPE_EVENT. Before responding with D3DDP2OP_RESPONSEQUERY for an event, the driver must ensure that the graphics processing unit (GPU) is finished processing all D3DHAL_DP2OPERATION operations that are related to the event. That is, the driver only responds after the event's ISSUE_END state occurs. The driver must always set the event's BOOL value to TRUE when responding.
  • DWORD for D3DQUERYTYPE_OCCLUSION. The driver sets this DWORD to the number of pixels for which the z-test passed for all primitives between the begin and end of the query. If the depth buffer is multisampled, the driver determines the number of pixels from the number of samples. However, if the display device is capable of per-multisample z-test accuracy, the conversion to number of pixels should generally be rounded up. An application can then check the occlusion result against 0, to effectively mean "fully occluded". Drivers that convert multisampled quantities to pixel quantities should detect render target multisampling changes and continue to compute the query results appropriately.
  • D3DDEVINFO_VCACHE structure for D3DQUERYTYPE_VCACHE.

Requirements

Requirement Value
Header d3dhal.h (include D3dhal.h)

See also

D3DDEVINFO_VCACHE

D3DDP2OP_CREATEQUERY

D3DHAL_DP2COMMAND

D3DHAL_DP2DELETEQUERY

D3dDrawPrimitives2