Buffers & structured buffers at OM

Jul 28, 2012 at 6:27 PM
Edited Jul 28, 2012 at 6:28 PM

At page 58 the figure 2.16 demonstrates that we can use buffers at OM stage. Is it correct? Could you post any example how it works?

Jul 29, 2012 at 12:28 PM


The idea is that the buffer/structured buffer can be attached to the stage via an unordered access view.  To be perfectly honest, I haven't used this myself, but I have heard of many uses for UAVs on the output merger.  If you search for OIT (order independent transparency) you should be able to find some sample code that will show how it works.

If you decide to try using Hieroglyph 3 for this, there is a small change needed to the OM setting code.  If you are interested, I can take a closer look at this and see what it would take to get it up and running so you can try it out...

Jul 29, 2012 at 2:09 PM


Thank you for fast reply. I have implemented OIT via linked lists several years ago. I know that OMSetRenderTargetsAndUnorderedAccessViews allows to attach buffers to the pipeline, but buffers are available via pixel shader stage and compute shader stage (i.e. u# and t# registers). I have no information about how to bind buffers to rt# registers. And I don't hear that the Output Merger can access to UAV. Usually the OM gathers pixels from PS output and makes render ops such as blending.

I'm interested in a small piece of code, which demonstrates subject more closer. Could you post an example of interaction between OM and UAV?


Aug 4, 2012 at 1:11 PM

I haven't personally done this, but it does appear to be possible.  If you look at the members of the render target view description you will see that there is a buffer in the list of choices for view dimension.  If I recall correctly, the addressing simply works on a single axis - probably where the x-coordinate is used to index into the buffer.

I searched for a little while and found the following example online: Example

Most likely you could whip up an example, then see how things act by experimentation.  If you have any success or experiences to share afterward, I would really appreciate if you shared them here for others to see!