// d3dumddi.h
PFND3DDDI_DRAWRECTPATCH Pfnd3dddiDrawrectpatch;
HRESULT Pfnd3dddiDrawrectpatch(
[in] HANDLE hDevice,
const D3DDDIARG_DRAWRECTPATCH *unnamedParam2,
const D3DDDIRECTPATCH_INFO *unnamedParam3,
const FLOAT *unnamedParam4
)
{...}
View the official Windows Driver Kit DDI referenceNo description available.
The DrawRectPatch function draws a new or cached rectangular patch or updates the specification of a previously defined patch.
hDevice [in]A handle to the display device (graphics context).
unnamedParam2pData [in]
A pointer to a D3DDDIARG_DRAWRECTPATCH structure that describes the rectangular patch to draw.
unnamedParam3pInfo [in]
Optional. A pointer to a D3DDDIRECTPATCH_INFO structure that describes information about the rectangular patch.
unnamedParam4pPatch [in]
Optional. A pointer to a buffer that contains four floating-point values (D3DFLOAT[4]) that provide the segment counts for each of the four edges of the rectangular patch.
DrawRectPatch returns S_OK or an appropriate error result if the rectangular patch is not successfully drawn.
When the Microsoft Direct3D runtime callspPatch the user-mode display driver's DrawRectPatch function, it can optionally supply information in the pInfo and parameters. The runtime sets flags in the Flags member of the D3DDDIARG_DRAWRECTPATCH structure that is specified by pData to indicate if it supplies this optional information.
The runtime supplies a UINT value in the Handle member of D3DDDIARG_DRAWRECTPATCH to refer to the patch surface. Whenever the runtime redraws the patch surface, it passes the patch handle value and is not required to re-specify the D3DDDIRECTPATCH_INFO data structure for the patch surface. The user-mode display driver can precompute and cache forward-difference coefficients and any other information. Therefore, subsequent calls to the driver's DrawRectPatch function that use the same patch handle value run more efficiently.
The actual value in Handle is determined by the application and is not under runtime control. Therefore, the driver must handle any value that can be specified by a UINT.
The special Handle value of zero indicates that the patch is dynamic; therefore, the driver cannot precompute or cache information for the patch. A nonzero value for Handle indicates that the patch is static (or updated with low frequency); therefore, the driver can precompute and cache information for the patch.
The driver must handle the following scenarios in its DrawRectPatch function:
The driver receives notification to release cached patch information through the D3DRS_DELETERTPATCH render state. The value of this render state is the patch to delete.