Direct3D rendering performance improvements
Windows Display Driver Model (WDDM) 1.3 and later drivers can support Microsoft Direct3D rendering performance improvements that let Direct3D 9 hardware make better use of hardware command buffers and counters and make efficient copies of system memory to subresources. These capabilities, which mirror some of the capabilities available for Direct3D Version 10 hardware, are new starting with Windows 8.1.
New Direct3D 11.1 resource trim and map default performance improvements are also available. The map default scenario is outlined in the Behavior changes section below.
Rendering performance reference
This reference section describes the user-mode device driver interfaces (DDIs).
Direct3D rendering performance functions implemented by the user-mode driver
This section contains functions that a Windows Display Driver Model (WDDM) 1.3 and later user-mode display driver implements in order to support Microsoft Direct3D rendering performance improvements.
PFND3DDDI_FLUSH1: PFND3DDDI_CHECKCOUNTERINFO
PFND3DDDI_CHECKCOUNTER: PFND3DDDI_UPDATESUBRESOURCEUP
Direct3D rendering performance structures and enumerations
These user-mode structures and enumerations support rendering performance improvements and are new or updated for Windows 8.1. All apply to Direct3D Level 9 drivers except for D3D11_1_DDI_FLUSH_FLAGS.
- D3DDDI_FLUSH_FLAGS (new)
- D3DDDIARG_COPYFLAGS (new)
- D3DDDIARG_COUNTER_INFO (new)
- D3DDDIARG_UPDATESUBRESOURCEUP (new)
- D3DDDICAPS_SIMPLE_INSTANCING_SUPPORT (new)
- CreateResource2 (WDDM 1.3 and later Direct3D Level 9 drivers must return the E_INVALIDARG error code if the CaptureBuffer flag value is set)
- D3D11_1_DDI_FLUSH_FLAGS (D3DWDDM1_3DDI_TRIM_MEMORY constant added)
- D3DDDI_DEVICEFUNCS (pfnFlush1, pfnCheckCounterInfo, pfnCheckCounter, pfnUpdateSubresourceUP members added)
- D3DDDI_POOL (D3DDDIPOOL_STAGINGMEM constant added)
- D3DDDICAPS_TYPE (D3DDDICAPS_GET_SIMPLE_INSTANCING_SUPPORT constant added)
- GetCaps (new info in Remarks)
DDI implementation requirements starting with WDDM 1.3
Starting with WDDM 1.3, the following functions are required or optional for user-mode drivers to implement.
Function group | Description |
---|---|
Direct3D 9 functions that are optional prior to WDDM 1.3. Now required: |
|
Direct3D 9 functions that are available starting with WDDM 1.3. A driver must either implement all of these functions or none of them: |
|
When the WDDM 1.3 and later optional functions immediately above are implemented, these functions have associated behavior changes: |
These scenarios apply when GetCaps is called:
|
These Direct3D 11 functions have associated behavior changes: |
|
Behavior changes for calls to resource create, map, and unmap functions
For these functions that are implemented by WDDM 1.3 and later drivers, the Direct3D runtime supplies a restricted set of input values for the map default scenario. These restricted values apply only to drivers that support feature level 11.1 and later.
CreateResource(D3D11) function—
These input D3D11DDIARG_CREATERESOURCE structure members are restricted:
Member | Description |
---|---|
ResourceDimension and Usage |
These behavior changes only apply when the Direct3D runtime supplies type D3D10DDIRESOURCE_BUFFER for ResourceDimension and type D3D10_DDI_USAGE_DEFAULT for Usage. |
BindFlags |
The Direct3D runtime sets only the D3D10_DDI_BIND_SHADER_RESOURCE and D3D11_DDI_BIND_UNORDERED_ACCESS values. |
MapFlags |
If all the other member requirements listed here are met, the runtime can set D3D10_DDI_MAP_READ, D3D10_DDI_MAP_WRITE, and D3D10_DDI_MAP_READWRITE values. The driver must support these values. Values of D3D10_DDI_MAP_WRITE_DISCARD and D3D10_DDI_MAP_WRITE_NOOVERWRITE are invalid. |
MiscFlags |
The runtime sets only the D3D11_DDI_RESOURCE_MISC_BUFFER_ALLOW_RAW_VIEWS and D3D11_DDI_RESOURCE_MISC_BUFFER_STRUCTURED values. |
Format |
The runtime sets only the DXGI_FORMAT_UNKNOWN value. |
SampleDesc |
The runtime sets the DXGI_SAMPLE_DESC.Count member to 1, and the Quality member to zero. |
MipLevels |
The runtime sets the value to 1. |
ArraySize |
The runtime sets the value to 1. |
pPrimaryDesc |
The runtime sets the value to NULL. |
ResourceMap function—
These input parameters to ResourceMap are restricted:
Parameter | Description |
---|---|
hResource |
The Direct3D runtime sets only a D3D10DDIRESOURCE_BUFFER resource when a non-zero value for MapFlags is set in the creation call to CreateResource(D3D11). |
The runtime sets only the DXGI_FORMAT_UNKNOWN value. |
|
Subresource |
The runtime only sets the value to 0. |
DDIMap |
If all the other member requirements listed here are met, the runtime can set D3D10_DDI_MAP_READ, D3D10_DDI_MAP_WRITE, or D3D10_DDI_MAP_READWRITE values, matching the MapFlags value set in the creation call to CreateResource(D3D11). |
Flags |
Although the input value from the runtime isn't restricted, the driver must be able to support the D3D10_DDI_MAP_FLAG_DONOTWAIT value. |
pMappedSubResource |
Although the input value from the runtime isn't restricted, the driver must assign a valid CPU-cacheable pointer to the D3D10DDI_MAPPED_SUBRESOURCE.pData member and must set the RowPitch and DepthPitch to match the size of the buffer and the data provided in pData. |
ResourceUnmap function—
These input parameters to ResourceUnmap are restricted:
Parameter | Description |
---|---|
hDevice |
Although the input value from the Direct3D runtime isn't restricted, the value which match the hDevice value from the original ResourceMap call. |
hResource |
The runtime sets only a D3D10DDIRESOURCE_BUFFER resource when a non-zero value for MapFlags is set in the creation call to CreateResource(D3D11). |
Subresource |
The runtime only sets the value to 0. |