Quantcast
Channel: GameDev.net
Viewing all articles
Browse latest Browse all 17825

Swap chain creation failed

$
0
0
I create my swap chain in the following way: // Create a DXGI_SWAP_CHAIN_DESC1. DXGI_SWAP_CHAIN_DESC1 swap_chain_desc = {}; swap_chain_desc.Width = static_cast< UINT >(GetWidth()); swap_chain_desc.Height = static_cast< UINT >(GetHeight()); swap_chain_desc.Format = m_display_configuration->GetDisplayFormat(); swap_chain_desc.SampleDesc = m_display_configuration->GetMSAASampleDesc(); swap_chain_desc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT | DXGI_USAGE_SHADER_INPUT | DXGI_USAGE_UNORDERED_ACCESS; swap_chain_desc.BufferCount = 1u; swap_chain_desc.Flags = DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH; // Create a DXGI_SWAP_CHAIN_FULLSCREEN_DESC. DXGI_SWAP_CHAIN_FULLSCREEN_DESC swap_chain_fullscreen_desc = {}; swap_chain_fullscreen_desc.RefreshRate = m_display_configuration->GetDisplayRefreshRate(); swap_chain_fullscreen_desc.Windowed = TRUE; // Get the IDXGISwapChain1. ComPtr< IDXGISwapChain1 > swap_chain1; const HRESULT result_swap_chain1 = dxgi_factory3->CreateSwapChainForHwnd(m_device.Get(), m_hwindow, &swap_chain_desc, &swap_chain_fullscreen_desc, nullptr, swap_chain1.ReleaseAndGetAddressOf()); The only thing that changed is the addition of DXGI_USAGE_UNORDERED_ACCESS (without DXGI_USAGE_UNORDERED_ACCESS, everything works fine). The error code is 0x80070057 (E_INVALIDARG). Any ideas what's missing? If I remove DXGI_USAGE_SHADER_INPUT, the issue remains; so it has clearly something to do with DXGI_USAGE_UNORDERED_ACCES.

Viewing all articles
Browse latest Browse all 17825

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>