Jump to content
  • Advertisement
Sign in to follow this  
Mr_Fox

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

This topic is 642 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!