Rakete1111
Rakete1111

Reputation: 49018

IDXGIFactory4::CreateSwapChain returns DXGI_ERROR_INVALID_CALL

I am creating my Swapchain like this

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);

In Debug mode, this works fine, but in Release (either in x86 or x64), CreateSwapChain returns DXGI_ERROR_INVALID_CALL.

Can anyone explain to me why this is working in Debug mode, but not in Release mode?

Thanks!

Note: I'm using Direct3D 12

Upvotes: 1

Views: 1041

Answers (1)

Rakete1111
Rakete1111

Reputation: 49018

I found the solution! Yay :)

I forgot to link the DX12 libs....

Upvotes: 1

Related Questions