none
Swapchain not created with feature level 9_3 or below

    Dotaz

  • I have setup a project for a directx metro app, but when i run it with directx 10.1 hardware on a lower feature level (9_1), it will just crash after i create the swapchain. The console just has 1 simple message "D3D11: Removing Device." I am using an AMD Radeon HD 6570 with WDDM 1.2 driver. The game works fine in other feature levels (10 and above)

    Code:

     DXGI_SWAP_CHAIN_DESC1 swapChainDesc = {0};
            swapChainDesc.Width = 0;
            swapChainDesc.Height = 0;
            swapChainDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;           
            swapChainDesc.Stereo = m_stereoEnabled; 
            swapChainDesc.SampleDesc.Count = 1;                          
            swapChainDesc.SampleDesc.Quality = 0;
            swapChainDesc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;
            swapChainDesc.BufferCount = 2;  
    		swapChainDesc.Scaling = DXGI_SCALING_NONE;
    		swapChainDesc.SwapEffect = DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL; 
            swapChainDesc.Flags = 0;
    
            // Once the desired swap chain description is configured, it must be created on the same adapter as our D3D Device
    
            // First, retrieve the underlying DXGI Device from the D3D Device
            ComPtr<IDXGIDevice1>  dxgiDevice;
            DX::ThrowIfFailed(m_d3dDevice.As(&dxgiDevice));
    
            // Ensure that DXGI does not queue more than one frame at a time. This both reduces 
            // latency and ensures that the application will only render after each VSync, minimizing 
            // power consumption.
            DX::ThrowIfFailed(dxgiDevice->SetMaximumFrameLatency(1));
    
            ComPtr<IDXGIAdapter> dxgiAdapter;
            DX::ThrowIfFailed(dxgiDevice->GetAdapter(&dxgiAdapter));
    			
    
            ComPtr<IDXGIFactory2> dxgiFactory;
            DX::ThrowIfFailed(dxgiAdapter->GetParent(__uuidof(IDXGIFactory2),&dxgiFactory));
    		
            DX::ThrowIfFailed(
    			dxgiFactory->CreateSwapChainForCoreWindow(
                    m_d3dDevice.Get(),
    				DX::GetIUnknown(m_window),
                    &swapChainDesc,
                    nullptr,    // allow on all displays
                    &m_swapChain
                    )
                );

    I also tried running 3 samples from microsoft, and forcing the feature level to 9_1. They all show the same message (Device removed). Also when i try it on an actual DX9 device it will just crash. Other games such as cut the rope do seem to work fine (allthough laggish)

    Anyone know what i did wrong with creating my swapchain?

    3. dubna 2012 13:03

Odpovědi

  • Oke, i found the problem myself :)

    I did indeed use the reference driver to fix the warnings directx would spill out (mostly index buffers not being 16bit). Next was running the game in release mode and forcing directx to spill out all logs by using 'dxcpl.exe'.

    Than it would crash on creating shaders, apparently not all shaders were using the correct version when compiling (should be 4.0 level 9_1). After fixing that the game would run and it would display 2d images perfectly fine. 3D and 2d mixed was still a big problem. 

    Turns out the fix for that is, is to enable the depth buffer before rendering (i was calling 'present' with the depthbuffer disabled).

    Now its working perfectly fine. :)

    16. dubna 2012 13:14

Všechny reakce

  • No such problem on my NV GtX570. try D3D_DRIVER_TYPE_REFERENCE ?

    C++ DX11

    3. dubna 2012 13:37
  • Oke, i found the problem myself :)

    I did indeed use the reference driver to fix the warnings directx would spill out (mostly index buffers not being 16bit). Next was running the game in release mode and forcing directx to spill out all logs by using 'dxcpl.exe'.

    Than it would crash on creating shaders, apparently not all shaders were using the correct version when compiling (should be 4.0 level 9_1). After fixing that the game would run and it would display 2d images perfectly fine. 3D and 2d mixed was still a big problem. 

    Turns out the fix for that is, is to enable the depth buffer before rendering (i was calling 'present' with the depthbuffer disabled).

    Now its working perfectly fine. :)

    16. dubna 2012 13:14