Sign in to follow this  
Volgogradetzzz

Does OMSetRenderTargets() is the same as having D3D12_RESOURCE_STATE_RENDER_TARGET barrier state?

Recommended Posts

Hello.

 

In d3d12 I noticed that if I have a barrier with Transition.StateAfter = D3D12_RESOURCE_STATE_RENDER_TARGET and later clear the render target with ClearRenderTargetView() - everything works even without calling commandList->OMSetRenderTargets() - I can see the correct window color even when I have several buffers. Is it correct or I missed something?

Share this post


Link to post
Share on other sites

I'm not quite sure what you're asking... but OMSetRenderTargets and ClearRenderTargetView have no relationship.
You don't need to bind an RT with OMSetRenderTargets prior to calling ClearRenderTargetView.
You do need to transition an RT resource to STATE_RENDER_TARGET before binding it or clearing it.

Share this post


Link to post
Share on other sites


You don't need to bind an RT with OMSetRenderTargets prior to calling ClearRenderTargetView.

Thank you for the answer. I have several buffers, and all I did - just cleared them but didn't say to use a particular buffer as an active. How the system knows that it needs to show me a colored window?

 

I'm following several hello world tutorials. Some of them are setting a render target before present, some not.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this