DMLCreateDevice function (directml.h)
Creates a DirectML device for a given Direct3D 12 device.
HRESULT DMLCreateDevice( ID3D12Device *d3d12Device, DML_CREATE_DEVICE_FLAGS flags, REFIID riid, void **ppv );
A pointer to an ID3D12Device representing the Direct3D 12 device to create the DirectML device over. DirectML supports any D3D feature level, and Direct3D 12 devices created on any adapter, including WARP. However, not all features in DirectML may be available depending on the capabilities of the Direct3D 12 device. See IDMLDevice::CheckFeatureSupport for more info.
If the call to DMLCreateDevice is successful, then the DirectML device maintains a strong reference to the supplied Direct3D 12 device.
A DML_CREATE_DEVICE_FLAGS value specifying additional device creation options.
A reference to the globally unique identifier (GUID) of the interface that you wish to be returned in device. This is expected to be the GUID of IDMLDevice.
Type: _COM_Outptr_opt_ void**
A pointer to a memory block that receives a pointer to the device. This is the address of a pointer to an IDMLDevice, representing the DirectML device created.
If the function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
A newer version of this function, DMLCreateDevice1, was introduced in DirectML version 1.1.0. DMLCreateDevice is equivalent to calling DMLCreateDevice1 and supplying a minimumFeatureLevel of DML_FEATURE_LEVEL_1_0.
|Minimum supported client||Windows 10 [desktop apps only]|
|Minimum supported server||Windows Server 2016 [desktop apps only]|