Jump to content
  • Advertisement
Sign in to follow this  

DX11 Data processing (queue?) in compute shader

Recommended Posts


I have a simple traversal algorithm that I want to implement in a compute shader, it looks something like this:

while (!isEmpty(itemList))
	a = itemList.Pop();
  	results = Process(a);
	for each r in results:

My initial though was to do it with multiple passes/Dispatch calls - each one creating a new list of items and swapping the lists between dispatch's. the problem is there is no way to know when you're done with out a read back.

But then I thought I could possibly use a RWStructuredBuffer as a circular buffer to implement a processing queue, and have atomic operations that increment the read/write position to the buffer. This way I could do it with a single large dispatch.

Has anyone done something like this? Are there any references/tips/ideas you could give me?


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Advertisement

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!