Hello. I hope this is the right place to ask about this.
I'm very new to Direct3D, and I'm trying to create a D3D11 device with a reference driver for software rendering. Now, I don't really need a reference driver, but I'd still like to understand why the call fails, giving me error code 0x887a0004, and telling me the device interface + feature level is not supported. Here's the code:
UINT creationFlags = D3D11_CREATE_DEVICE_BGRA_SUPPORT;
#if defined(_DEBUG)
creationFlags |= D3D11_CREATE_DEVICE_DEBUG;
#endif
D3D_FEATURE_LEVEL featureLevels[] =
{
D3D_FEATURE_LEVEL_11_1,
D3D_FEATURE_LEVEL_11_0,
D3D_FEATURE_LEVEL_10_1,
D3D_FEATURE_LEVEL_10_0,
D3D_FEATURE_LEVEL_9_3,
D3D_FEATURE_LEVEL_9_1
};
ID3D11Device* d3dDevice;
ID3D11DeviceContext* d3dDeviceContext;
HRESULT result = D3D11CreateDevice(
nullptr,
D3D_DRIVER_TYPE_REFERENCE,
nullptr,
creationFlags,
featureLevels,
ARRAYSIZE(featureLevels),
D3D11_SDK_VERSION,
&d3dDevice,
nullptr,
&d3dDeviceContext
);
This same code returns S_OK if I instead create a hardware driver with D3D_DRIVER_TYPE_HARDWARE, so I don't think this failure is due to my computer not supporting D3D11 (very recent gpu as well). I also read here that D3D_DRIVER_TYPE_REFERENCE should work on all feature levels on D3D11.1, but I'm not entirely sure how to create a D3D11.1 device in the first place. I thought adding D3D_FEATURE_LEVEL_11_1 to the featureLevels list would be enough, but I'm not sure. Also it may be worth mentioning that I have COM initialized.
So what am I missing here, and what articles should I be looking at to help me understand this?
Thank you in advance.