Jump to content
  • Advertisement
Sign in to follow this  
BlackJoker

Not possible to resize swapchain after DeferredContext.CopyResourse()

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

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
Advertisement

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 this post


Link to post
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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!