In the last days, I tried to learn the basics of Direct3D12, using some online resources and tutorials/demos.
After failing to run the demos, I created a new project in Visual Studio 2015, added the necessary configurations and tried to get the basic initialization done. However, running that project, it fails at the same location, which is D3D12CreateDevice() (builds without any warnings/errors).
The return value I keep receiving is DXGI_NOT_SUPPORTED. I changed my code to enumerate through all adapters of the DXGIFactory, which ended up with the same result (the same applies to the warp adapter).
This is the part of the device creation:
bool created = false;
UINT i = 0;
ComPtr<IDXGIAdapter1> pAdapter;
HRESULT hr = S_OK;
while (SUCCEEDED(m_dxgiFactory->EnumAdapters1(i++, pAdapter.ReleaseAndGetAddressOf())))
{
DXGI_ADAPTER_DESC1 desc = {};
pAdapter->GetDesc1(&desc);
if (SUCCEEDED((hr = D3D12CreateDevice(pAdapter.Get(), D3D_FEATURE_LEVEL_11_0, IID_PPV_ARGS(&m_device)))))
{
created = true;
pAdapter.ReleaseAndGetAddressOf();
break;
}
}
if (!created)
{
ComPtr<IDXGIAdapter1> pWarpAdapter;
CHK(m_dxgiFactory->EnumWarpAdapter(IID_PPV_ARGS(&pWarpAdapter)));
CHK((hr = D3D12CreateDevice(
pWarpAdapter.Get(),
D3D_FEATURE_LEVEL_11_0,
IID_PPV_ARGS(&m_device)
)));
}
My system is running on Windows 10, 64 bit and has integrated Intel HD Graphics, as well as a NVIDIA GeForce GT540M, using the Optimus Technology. I did make appropriate changes to the NVIDIA Control Panel, to make the program run on the GeForce 540M, which - according to the Control Panel - supports the DX12 Runtime and feature level 11.0.
The integrated card however, only supports DX11. According GPU-Z, the Intel card only supports DX10 and the GeForce DX11.
I did install all the latest Windows Updates and drivers for both cards.
My guess is, that this is a driver related problem, since I am not able to run the demos either.
Can this be any issue related to the program itself, or should I try to get help from NVIDIA(or Microsoft?) about this problem?