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

Started by
2 comments, last by 21st Century Moose 9 years, 8 months ago

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?

Advertisement

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

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.

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.

Direct3D has need of instancing, but we do not. We have plenty of glVertexAttrib calls.

This topic is closed to new replies.

Advertisement