rate up
0
rate down
Directx12 - Adapter not supported
Hello , I have followed the tutorial 3 for Directx12 Init through and I noticed the system is stuck in the while loop and then I downloaded the example project and it did the same thing. I am running on a NVIDIA 675M graphics device which run Directx11 and the feature 11_0 but not it seems to not work for Directx12 device Any advice would be great as i'm desperate to get stuck in with the API Thank You
Comments
Hey aaronsmith, just in case you looked at the code in my answer before I fixed it right now, want to let you know I forgot to add the adapter index increment in the code until just now.
on Mar 23 `16
iedoc
rate up
0
rate down
Thanks AaronSmith for posting this question. You have found a bug in the code. I will update the tutorial as soon as i can What is happening is that your dxgi factory is finding a software device before a hardware device, and continues the while loop. The problem is that it is not incrementing the adapter index variable before it continues To fix this, add the line: adapterIndex++; Right above the continue; statement where you check if its a software device. The final while loop will look like this: while (dxgiFactory->EnumAdapters1(adapterIndex, &adapter) != DXGI_ERROR_NOT_FOUND) { DXGI_ADAPTER_DESC1 desc; adapter->GetDesc1(&desc); if (desc.Flags & DXGI_ADAPTER_FLAG_SOFTWARE) { // we dont want a software device adapterIndex++; continue; } hr = D3D12CreateDevice(adapter, D3D_FEATURE_LEVEL_11_0, _uuidof(ID3D12Device), nullptr); if (SUCCEEDED(hr)) { adapterFound = true; break; } adapterIndex++; }
Comments
Ahh thanks yes i did notice this but sadly for me it still shows my GTX 675M is not suitable for Directx12 so guess i got to wait for the update for the driver :(
on Mar 28 `16
AaronSmith
rate up
0
rate down
I had similar problem but you card should suport Dx12 :) try this function :) bool Dx12::CheckDx12() { HRESULT hr = CreateDXGIFactory1(IID_PPV_ARGS(&factory)); if (FAILED(hr)) { PrintError(L"CreateDXGIFactory1"); return false; } int Adapt{ 0 }; bool AdaptFound{ false }; ComPtr<IDXGIAdapter1> hardwareAdapter{ nullptr }; ComPtr<IDXGIAdapter> warpAdapter{ nullptr }; while (factory->EnumAdapters1(Adapt, &hardwareAdapter) != DXGI_ERROR_NOT_FOUND) { DXGI_ADAPTER_DESC1 desc; hardwareAdapter->GetDesc1(&desc); wsprintf(GPU_Name, L"%s", desc.Description); if (desc.Flags & DXGI_ADAPTER_FLAG_SOFTWARE) { factory->EnumWarpAdapter(IID_PPV_ARGS(&warpAdapter)); hr = D3D12CreateDevice(warpAdapter.Get(), D3D_FEATURE_LEVEL_11_0, _uuidof(ID3D12Device), nullptr); if (SUCCEEDED(hr)) { Software = true; AdaptFound = true; break; } else { Software = false; AdaptFound = false; } } hr = D3D12CreateDevice(hardwareAdapter.Get(), D3D_FEATURE_LEVEL_11_0, _uuidof(ID3D12Device), nullptr); if (SUCCEEDED(hr)) { AdaptFound = true; Software = false; break; } else if (FAILED(hr)) { factory->EnumWarpAdapter(IID_PPV_ARGS(&warpAdapter)); hr = D3D12CreateDevice(warpAdapter.Get(), D3D_FEATURE_LEVEL_11_0, _uuidof(ID3D12Device), nullptr); if (SUCCEEDED(hr)) { AdaptFound = true; Software = true; break; } } Adapt++; } if (AdaptFound == false) { PrintError(cLang->Translate(Lang_Err, L"Not_Compatible")); return false; } // Init DX12 if (Software == true) { hr = D3D12CreateDevice(warpAdapter.Get(), D3D_FEATURE_LEVEL_11_0, __uuidof(ID3D12Device), (void**)&pDevice); if (FAILED(hr)) { PrintHrError(hr); return false; } } else if (Software == false) { hr = D3D12CreateDevice(hardwareAdapter.Get(), D3D_FEATURE_LEVEL_11_0, __uuidof(ID3D12Device), (void**)&pDevice); if (FAILED(hr)) { PrintHrError(hr); return false; } } return true; } Of course some of those are my funcions and some are in main class but that shouldn't be a problem :)
Sign in to answer!