OutputMerger.SetUnorderedAccessView resets all previously bound UAVs
Raveler opened this issue · comments
There are a couple of functions in SharpDX that have a similar signature:
Context.VertexShader.SetShaderResource(slot, view);
Context.PixelShader.SetShaderResource(slot, view);
Context.ComputerShader.SetUnorderedAccessView(slot, view);
Context.OutputMerger.SetUnorderedAccessView(slot, view);
However, OutputMerger.SetUnorderedAccessView is the ONLY method that resets all previously bound UAVs and SRVs! This is because internally, that method is just a wrapper around a call to SetRenderTargetsAndUnorderedAccessViews, which resets all the bound resources according to the comments in the source file:
This is extremely confusing. It took me days to figure out why my UAVs weren't all bound correctly. I suggest removing that method entirely, forcing people to use SetUnorderedAccessViews instead. That method is more obvious because you give it all the UAVs at once.