Hi all, this is probably the second time in the last 4 years I posted here. I usually manage to solve the issue myself, but this issue has given me a real headace
Hopefully there are someone out there that could help me, googling the issue has lead me nowhere...
The problem is this:
I have a laptop which has two GPU:s, one "Intel HD 4400 Graphics 4600" and one "NVIDIA GeForce GTX 860M". Right now I am developing a game which gives the player the option from start to choose which graphic adapter, which output device and what resolution the game should have. This is done by calling IDXGIFactory1, IDXGIAdapter1 and IDXGIOutput. The problem is that both graphic adaptors is found when enumerating them, but only the "Intel HD 4400 Graphics 4600" card has any IDXGIOutput options. This is not a problem when running the game in windowed mode on the NVIDIA card, but once I try to go fullscreen with "m_pSwapChain->SetFullscreenState" it gives me the error:
DXGI ERROR: IDXGISwapChain::GetContainingOutput: The swapchain's adapter does not control the output on which the swapchain's window resides. [ MISCELLANEOUS ERROR #80: ]
After a long and tedious search I decided to check out one of the Direct3D11 SDK tutorials called "BasicHLSL11", when running this tutorial the "NVIDIA GeForce GTX 860M" had IDXGIOutput options and works nicely in fullscreen. The weird thing is that it didn't have any output options for the Intel card.
When looking through the code to see what the differences were between my code and the code in the tutorial I found no differerance at all.
I ran this code directly under the winmain() in my game and in the tutorial and the result was different, and I can't for the world of it figure out what it is that is causing the different result.
IDXGIFactory1* pDXGIFactory;
CreateDXGIFactory1(__uuidof(IDXGIFactory), (void**)(&pDXGIFactory));
IDXGIAdapter1* pAdapter = NULL;
pDXGIFactory->EnumAdapters1( 0, &pAdapter ); // <--- Gives a different order of adaptors
DXGI_ADAPTER_DESC adapterDesc;
pAdapter->GetDesc(&adapterDesc);
IDXGIOutput* pOutput;
if( FAILED( pAdapter->EnumOutputs( 0, &pOutput ) ) )
{
__debugbreak(); // <--- Here it breaks when running it from my game and on the NVIDIA card, it doesn't break when running the BasicHLSL tutorial.
} Don't mind the lack of error checking in the code, I have shrunken it down deliberatly for this purpose and there are no errors or warnings.
- In the BasicHLSL tutorial the result was that EnumAdapters1 with index 0 gave me the NVIDIA card with output options, and Index 1 the Intel card with no output options.
- In my game the EnumAdapters1 with index 0 gave me the Intel card with output options, and Index 1 the NVIDIA card with no output options.
So as I see it, it seems that the primary adaptors is switched somehow, but I have no idea what is the reason for this switching. I was hoping that some of you could have some knowledge about this?
Looking forward too your reply :)