Sign in to follow this  
wilfrid

Is it possible to bind an ID3D11RenderTargetView to different slots at the same time?

Recommended Posts

Hi.

 

I am writing a rendering library and was wondering if it was possible to bind an ID3D11RenderTargetView to different OMSetRenderTargets() slots at the same time.

It would be easier for me if I did not have to support that case. I feel like it's impossible, but I am not completely sure.

 

I don't see any case where that would work, but I ask just to be sure. For example could a shader write to one part of the render target via one of the slots, and to an other part of the same target via an other slot?

I am not yet familiar with Unordered Access Views and wondered if they could be used to such a thing? Or am I safe in ignoring that case?

Share this post


Link to post
Share on other sites

The answer to your question was the top result in Google - it was even right there, in the result text shown by Google, but not anymore - you just made it the second result: https://www.google.com/search?hl=en&q=Is+it+possible+to+bind+an+ID3D11RenderTargetView+to+different+slots+at+the+same+time

Share this post


Link to post
Share on other sites

I haven't actually tried it, but I'm fairly certain that it won't work since it would result in ambiguity as to which pixel shader output actually gets written to memory. You could verify very easily by trying it with the debug runtimes enabled, and checking for errors in the debugger output.

Share this post


Link to post
Share on other sites

http://msdn.microsoft.com/en-us/library/windows/desktop/ff476464%28v=vs.85%29.aspx

 

 

It is invalid to try to set the same subresource to multiple render target slots.

 

And also:

 

 

The same resource view cannot be bound to multiple render target slots simultaneously. However, you can set multiple non-overlapping resource views of a single resource as simultaneous multiple render targets.

 

Where I guess you need to be careful is with a setup like render-to-cubemap where you may have multiple render target views of the same resource.

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