// d3d10umddi.h
PFND3D11DDI_CREATERESOURCE Pfnd3d11ddiCreateresource;
VOID Pfnd3d11ddiCreateresource(
D3D10DDI_HDEVICE unnamedParam1,
const D3D11DDIARG_CREATERESOURCE *unnamedParam2,
D3D10DDI_HRESOURCE unnamedParam3,
D3D10DDI_HRTRESOURCE unnamedParam4
)
{...}
View the official Windows Driver Kit DDI referenceNo description available.
Creates a resource.
unnamedParam1hDevice [in]
A handle to the display device (graphics context).
unnamedParam2pCreateResource [in]
A pointer to a D3D11DDIARG_CREATERESOURCE structure that describes the parameters that the user-mode display driver uses to create a resource.
unnamedParam3hResource [in]
A handle to the driver's private data for the resource.
unnamedParam4hRTResource [in]
A handle to the resource that the driver will use when it calls back into the Direct3D runtime.
The driver can use the pfnSetErrorCb callback function to set an error code.
The driver might run out of memory. Therefore, the driver can pass E_OUTOFMEMORY or D3DDDIERR_DEVICEREMOVED in a call to the pfnSetErrorCb function. The driver can also pass DXGI_DDI_ERR_UNSUPPORTED in a call to pfnSetErrorCb. For more information about passing DXGI_DDI_ERR_UNSUPPORTED, see the Remarks section of the BltDXGI reference page. The Direct3D runtime determines that any other errors are critical. If the driver passes any errors, which includes D3DDDIERR_DEVICEREMOVED, the Direct3D runtime determines that the handle is invalid; therefore, the runtime does not call the DestroyResource(D3D10) function to destroy the handle that the hResource parameter specifies.
The runtime validates all parameters against the parameters that an application sent to create the resource. Therefore, the driver should not receive invalid combinations.
If the application does not require the contents of the resource to persist across presentations, the runtime sets the D3D10_DDI_RESOURCE_MISC_DISCARD_ON_PRESENT flag of the D3D10_DDI_RESOURCE_MISC_FLAG enumeration in the MiscFlags member of the D3D11DDIARG_CREATERESOURCE structure that the pCreateResource parameter points to. Presentation occurs when the driver's PresentDXGI or BltDXGI (with the Present flag set in the DXGI_DDI_ARG_BLT_FLAGS structure) function is called. The runtime uses the D3D10_DDI_RESOURCE_MISC_DISCARD_ON_PRESENT flag to create swap-chain back buffers when an application uses the DXGI_SWAP_EFFECT_DISCARD value to request swap chains.
Starting in Windows 8, if the driver must create a stereo back buffer, it must set members of the D3D11DDIARG_CREATERESOURCE structure pointed to by pCreateResource as follows:
Additionally, to support stereo presentation, the BltDXGI function must allow any values for the DstSubresource and SrcSubresource members of the DXGI_DDI_ARG_BLT structure that are within the range of the source and destination resources.
For Windows Display Driver Model (WDDM) 1.3 and later drivers, the Microsoft Direct3D runtime supplies a restricted set of input values used by this function. For a list of all restricted values, see Direct3D rendering performance improvements.
CalcPrivateResourceSize(D3D11)