Jump to content

  • Log In with Google      Sign In   
  • Create Account


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

  • You cannot reply to this topic
3 replies to this topic

#1 wil_   Members   -  Reputation: 277

Like
0Likes
Like

Posted 21 August 2014 - 03:02 AM

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?



Sponsor:

#2 tonemgub   Members   -  Reputation: 979

Like
-1Likes
Like

Posted 21 August 2014 - 04:58 AM

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



#3 MJP   Moderators   -  Reputation: 11038

Like
1Likes
Like

Posted 21 August 2014 - 01:20 PM

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.



#4 mhagain   Crossbones+   -  Reputation: 7866

Like
3Likes
Like

Posted 21 August 2014 - 01:52 PM

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.


It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.






PARTNERS