PresentDXGI callback function

The PresentDXGI function notifies the user-mode display driver that an application finished rendering and requests that the driver display to the destination surface.

Syntax


pfnPresent PresentDXGI;

HRESULT __stdcall* PresentDXGI(
   DXGI_DDI_ARG_PRESENT *pPresentData
)
{ ... }

Parameters

pPresentData

[in] A pointer to a DXGI_DDI_ARG_PRESENT structure that describes how to display to the destination surface.

Return value

PresentDXGI returns one of the following values:

Return codeDescription
S_OK

The resource was successfully displayed.

D3DDDIERR_DEVICEREMOVED

The driver detected that the graphics adapter was removed. Therefore, the driver did not complete the present operation. If the driver never notices the adapter-removal condition, the driver is not required to return this error code.

 

Remarks

The hDevice member of the DXGI_DDI_ARG_PRESENT structure that the pPresentData parameter points to is the same handle that the driver's CreateDevice(D3D10) function passed back to the runtime in the hDrvDevice member of the D3D10DDIARG_CREATEDEVICE structure. Therefore, driver writers must define the type of this handle carefully. In addition, drivers can supply different implementations of the PresentDXGI function based on which device driver interface (DDI) implementation handled the call to CreateDevice(D3D10). The runtime will never mix driver handles across DDI implementations. Similarly, the hSurfaceToPresent and hDstResource members of DXGI_DDI_ARG_PRESENT are also driver-defined resource handles that the driver returned to the runtime in previous calls to the driver's CreateResource(D3D10) function.

The pDXGIContext member of DXGI_DDI_ARG_PRESENT is an opaque communication mechanism. The runtime passes this Microsoft DirectX Graphics Infrastructure (DXGI) context to the driver. The driver should copy this DXGI context unchanged to the pDXGIContext member of the DXGIDDICB_PRESENT structure when the driver calls the pfnPresentCbDXGI function.

The driver must submit all partially built render data (command buffers) using the pfnRenderCb function. Thereafter, the driver must translate the resource handle parameters into kernel handles and use those kernel handles in a call to pfnPresentCbDXGI.

Note   When the driver's PresentDXGI function copies sRGB-formatted content from a source surface to a non-sRGB destination surface, the driver should copy the sRGB content unchanged (that is, the driver should not perform the sRGB to linear conversion).
 

Requirements

Target platform

Desktop

Version

Available in Windows Vista and later versions of the Windows operating systems.

Header

Dxgiddi.h (include D3d10umddi.h)

See also

CreateDevice(D3D10)
CreateResource(D3D10)
D3D10DDIARG_CREATEDEVICE
DXGI_DDI_ARG_PRESENT
DXGI_DDI_BASE_FUNCTIONS
pfnRenderCb
pfnPresentCbDXGI

 

 

Send comments about this topic to Microsoft

Show: