IDXGIFactory4 :: CreateSwapChain返回DXGI_ERROR_INVALID_CALL

时间:2015-09-06 10:08:41

标签: directx-12

我正在创建我的Swapchain

ComPtr<IDXGIFactory4> factory;
CreateDXGIFactory1(__uuidof(IDXGIFactory4), (void**)&factory);

DXGI_SWAP_CHAIN_DESC scd;
ZeroMemory(&scd, sizeof(DXGI_SWAP_CHAIN_DESC));
scd.BufferCount = 2;
scd.BufferDesc.Width = mWidth;
scd.BufferDesc.Height = mHeight;
scd.BufferDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
scd.OutputWindow = mHwnd;
scd.Windowed = true;
scd.SwapEffect = DXGI_SWAP_EFFECT_FLIP_DISCARD;
scd.SampleDesc.Count = 1;
scd.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;

ComPtr<IDXGISwapChain> swapchain;
factory->CreateSwapChain(mQueue.Get(), &scd, &swapchain);

在调试模式下,这样可以正常工作,但在Release(在x86或x64中),CreateSwapChain返回DXGI_ERROR_INVALID_CALL。< / p>

任何人都可以向我解释为什么它在调试模式下工作,而不是在发布模式下工作?

谢谢!

注意:我使用的是Direct3D 12

1 个答案:

答案 0 :(得分:0)

我找到了解决方案!耶:)

我忘了链接DX12库....