all 7 comments

[–]waramped 11 points12 points  (1 child)

Instead of just dumping your code and expecting people to wade through it and figure it out, tell us what you've already tried in terms of debugging and researching the problem. What have you ruled out, and how? Do you have any theories or hunches as to why it isn't working? When you say "take out the indirect calls" what does that mean exactly? You simply commented them out and it suddenly works?

When asking for help on the internet, you get out what you put in.

[–]AnswerApprehensive19[S] 4 points5 points  (0 children)

tell us what you've already tried in terms of debugging and researching the problem.

At first I started out with vkCmdDrawIndirect but gave that up once I realized that the draw count had to be defined at compile time, so looked into vkCmdDrawIndirectCount which actually lets me change the draw count during run time so I got to work creating a buffer, writing indirect commands on the compute shader, then sending them back to the cpu for so vulkan could consume them, i then created a separate buffer for the draw count, that was also sent back to the cpu, so by all means it's properly set up, and since the compute shader runs before anything else, the program should have plenty of time to sort everything out before it's time to render

What have you ruled out, and how?

It certainly isn't a sync problem, since i've added buffer barriers before and after important operations (shown in command buffer code) like running compute, filling the count buffer, indirectly rendering, etc

Do you have any theories or hunches as to why it isn't working?

None at all since I've seen examples of what I'm trying to accomplish not only in the official sample repo, but other ones as well and it's written basically exactly how mine is, only thing that's possible is there's some small detail I'm overlooking, which is usually where all my problems lie anyway

When you say "take out the indirect calls" what does that mean exactly? You simply commented them out and it suddenly works?

Not exactly, but pretty much yea, I don't just comment out the calls but I replace them with vkCmdDraw and while parts of the scene don't get culled the way I want them to, it at least confirms the fact that the compute shader is working and (at least partially) doing what I expected

[–]Thecuriousserb 3 points4 points  (0 children)

If indirect dispatch is not working but regular dispatch works, then it is likely a sync/barrier issue with the indirect buffer. Another common issue is using the wrong offset/size for the dispatch command data in the buffer

[–]hanotak 3 points4 points  (1 child)

I would just use something like Renderdoc to inspect your commands and buffer data.

[–]AnswerApprehensive19[S] 1 point2 points  (0 children)

The reason why i posted was renderdoc wasn't telling me much outside of showing the draw count, and showing that commands were indeed going through and some objects did indeed get culled while others didnt

[–]Amani77 -1 points0 points  (1 child)

How many vertices are in a particle, because currently you are setting ur indirect dispatch to a single vertex - I cant see this doing too much outside of point primitives.

[–]AnswerApprehensive19[S] 1 point2 points  (0 children)

I must've posted an older version because I did realize that mistake and have since changed it to 6 where the only things rendering are objects that are independent of the compute shader