DXGKDDI_CREATEDEVICE callback function
该DDI创建了gfx context device, 该对象会在之后调用KMD方法时使用。
Syntax
DXGKDDI_CREATEDEVICE DxgkddiCreatedevice;
NTSTATUS DxgkddiCreatedevice(
IN_CONST_HANDLE hAdapter,
INOUT_PDXGKARG_CREATEDEVICE pCreateDevice
)
{...}
Parameters
hAdapter
[in] 该参数为关联着一个显卡context的句柄。KMD之前在DXGK调用 DxgkDdiAddDevice时通过MiniportDeviceContext参数提供。
pCreateDevice
[in/out] 指向 DXGKARG_CREATEDEVICE 的指针, 该结构描述了gfx context device。
Return Value
DxgkDdiCreateDevice returns one of the following values:
Return code | Description |
---|---|
STATUS_SUCCESS | DxgkDdiCreateDevice successfully created the graphics context device. |
STATUS_NO_MEMORY | DxgkDdiCreateDevice could not allocate memory that was required for it to complete. |
Remarks
DXGK调用KMD的DxgkDdiCreateDevice创建gfx context device。KMD使用这个context device维护了一系列渲染状态。DXGK能够在一个进程内针对一个GPU创建多个gfx context device.
Note gfx context deivce的数量之受限于可用系统内存的数量,因此KMD不能通过硬编码限制能够创建的gfx context device的数量上限。
通常gfx context device互相独立,换句话说,在一个context device中创建的一个资源不能被其他context device引用或访问。但是夸进程资源例外。
DxgkDdiCreateDevice should be made pageable.
Requirements
Minimum supported client | Available in Windows Vista and later versions of the Windows operating systems. |
Target Platform | Desktop |
Header | d3dkmddi.h |
IRQL | PASSIVE_LEVEL |