How simultaneously both read from and write to a texture works through UAV

Started by
0 comments, last by Hodgman 7 years, 6 months ago

Hey Guys,

As we know if we want to perform some in-place edit over texture (both 2D and 3D), the MSDN page shows that how to do that in a hacky way through DX11 api by using uav. Now in DX12 with Typed UAV load support, we don't need that hack anymore, we just do normal uav read and write.

But how that actually works? Is the 'in-place' edit only in cache and flush to memory when it's necessary? or every write by pass cache and get directly to memory (I guess probably not)? Since both GPU thread runs 'simultaneously' when one thread's write is visible to other thread? Or this in-place edit require no scattered write at all?

I have tested the correctness of strict in-place edit(every thread read and write to its own location), but I hope to know a little bit more about how it implemented in a lower level.

Thanks

Advertisement

If you've got potential race conditions (e.g. scattered writes, with multiple threads writing to the same locations), then it's up to you to specify appropriate memory barriers within your shader to provide appropriate synchronization between threads.

This topic is closed to new replies.

Advertisement