Hello,
I'm currently implementing DirectX 12 into an engine that we developing last few months.
I have now a basic renderer that is able to render models, textures and using shaders.
But now I'm running into a problem I can't figure out anymore. Since last week the D3D12CreateDevice() is failing.
The error happens when I loop through the adapters to find any adapter with DX12 support.
The code is very similar from the samples:
ComPtr<IDXGIAdapter1> adapter;
*ppAdapter = nullptr;
for (UINT adapterIndex = 0; DXGI_ERROR_NOT_FOUND != pFactory->EnumAdapters1(adapterIndex, &adapter); ++adapterIndex)
{
DXGI_ADAPTER_DESC1 desc;
adapter->GetDesc1(&desc);
if (desc.Flags & DXGI_ADAPTER_FLAG_SOFTWARE)
{
// Don't select the Basic Render Driver adapter.
continue;
}
// Check to see if the adapter supports Direct3D 12, but don't create the actual device yet.
HRESULT r = D3D12CreateDevice(adapter.Get(), D3D_FEATURE_LEVEL_11_0, _uuidof(ID3D12Device), nullptr);
if (SUCCEEDED(r))
{
break;
}
else
{
// Log why it cant create:
IS_FAILED(r);
}
}
*ppAdapter = adapter.Detach();
Return value of r:
HRESULT r = E_POINTER Invalid pointer.
The return value is bit unusual for me that I don't know what to do with it.
My GPU is a GeForce GT 650M, which should be able to run DirectX 12 to some point. (It also runs the DirectX12 Sample and Mini Engine.)
If there is more information needed, please tell and I will provide.
Many Thanks,
Joris