Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
The following sequence of operations must be performed to pass a command buffer through the Windows graphics stack:
The user-mode display driver (UMD) initiates a command-buffer submission if the Direct3D runtime calls one of the following UMD functions to perform the specified operation:
- The Present function to display graphics.
- The Flush function to submit hardware commands.
- The Lock function to lock a resource, which is used in the current command batch.
The UMD also always initiates a command-buffer submission whenever the command buffer is full.
The UMD calls the Direct3D runtime's pfnRenderCb function to submit the command buffer to the runtime.
The DirectX graphics kernel subsystem (Dxgkrnl) calls the kernel-mode display miniport driver's (KMD) DxgkDdiRender or DxgkDdiRenderKm function to validate the command buffer, write a DMA buffer in the hardware's format, and produce an allocation list that describes the surfaces used. Note that the DMA buffer has not yet been patched (that is, assigned physical addresses). Note If the runtime initiated the command-buffer submission by calling the UMD's Present function, the graphics subsystem calls the KMD's DxgkDdiPresent function, rather than DxgkDdiRender or DxgkDdiRenderKm.
The video memory manager calls the KMD's DxgkDdiBuildPagingBuffer function to create special purpose DMA buffers, known as paging buffers, that move the allocations specified in the allocation list that accompanies the DMA buffer to and from GPU-accessible memory. For more information, see Paging Video Memory Resources.
The GPU scheduler calls the KMD's DxgkDdiPatch function to assign physical addresses to the resources in the DMA buffer. However, the scheduler is not required to call DxgkDdiPatch to assign physical addresses to the paging buffer because physical addresses for the paging buffer were passed in and assigned during the DxgkDdiBuildPagingBuffer call.
The GPU scheduler calls the KMD's DxgkDdiSubmitCommand function to request that the driver queue the paging buffer to the GPU execution unit.
The GPU scheduler calls the KMD's DxgkDdiSubmitCommand function to request that the driver queue the DMA buffer to the GPU execution unit. Each DMA buffer submitted to the GPU contains a fence identifier. After the GPU finishes processing the DMA buffer, the GPU generates an interrupt.
The KMD is notified of the interrupt in its DxgkDdiInterruptRoutine function. The KMD should read, from the GPU, the fence identifier of the DMA buffer that just completed.
The KMD should call the DxgkCbNotifyInterrupt function to notify the GPU scheduler that the DMA buffer completed.
The KMD should call the DxgkCbQueueDpc function to queue a deferred procedure call (DPC).
The KMD's DPC is notified to handle most of the DMA buffer processing.