• 9
• 11
• 9
• 20
• 12

# Not possible to resize swapchain after DeferredContext.CopyResourse()

This topic is 904 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

HI,

I am trying to deal with deferred contexts and they seem to work, but  I am rendering into texture and to see something on screen after all I do Context.CopyResourse().

This is working well with Immediate context, but when I do the same for deferred context, I cannot resize my swapchain after that.

It says that not all outstanding buffers were released.

DeferredContext.CopyResource(ResourceSet.BackBuffer, presenter.BackBuffer);


This line leads to improper behavior, but I dont understand why. With Immediate context it working without any problems.

Is there a way to "fix" this?

Edited by BlackJoker

##### Share on other sites

Appearently resizing requires a little bit more to do before when using deferred contexts.

Quote from MSDN:

Before you call ResizeBuffers, ensure that the application releases all references (by calling the appropriate number of Release invocations) on the resources, any views to the resource, and any command lists that use either the resources or views, and ensure that neither the resource nor a view is still bound to a device context. You can use ID3D11DeviceContext::ClearState to ensure that all references are released. If a view is bound to a deferred context, you must discard the partially built command list as well (by callingID3D11DeviceContext::ClearState, then ID3D11DeviceContext::FinishCommandList, then Release on the command list). After you callResizeBuffers, you can re-query interfaces via IDXGISwapChain::GetBuffer.

##### Share on other sites

OK, Seems I understand my problem.

CopyResource() on deferred context is not immediately done and I must call FinishCommandList() and ExecuteCommandLst() to execute it and after that also - dispose commandList.

After that everything is ok.

Thanks for pointing me.

Edited by BlackJoker