Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MVK Access to Indirect Command Buffers #2247

Open
EricAtPlanGrid opened this issue Jun 3, 2024 · 1 comment
Open

MVK Access to Indirect Command Buffers #2247

EricAtPlanGrid opened this issue Jun 3, 2024 · 1 comment

Comments

@EricAtPlanGrid
Copy link

My application (CAD visualization) is heavily draw-call bound. As a result we find that on larger models we spend upwards of 80% of frametime simply encoding these calls. I was able to prototype a simple Metal renderer which encodes the drawcalls upfront using ICBs, which was able to reduce the CPU usage from 100% during rendering to about 10%.

My question here is in two parts:

  1. is there a reason that Vulkan secondary command buffers cannot be treated as ICBs?
  2. if the answer to one is "yes", have you considered / is there a known way to work around this somehow so that performance critical applications could still benefit from ahead-of-time encoding?

Thank you!

@cdavis5e
Copy link
Collaborator

cdavis5e commented Jun 4, 2024

  1. is there a reason that Vulkan secondary command buffers cannot be treated as ICBs?

Yes, because not everything that can be encoded to a secondary command buffer can be represented in an ICB. In particular, IMR GPUs on Intel Macs don't support compute from ICBs. (Admittedly, this particular instance should become less of a problem as Intel Macs become rarer and rarer.)

  1. if the answer to one is "yes", have you considered / is there a known way to work around this somehow so that performance critical applications could still benefit from ahead-of-time encoding?

It should actually be mostly straightforward--I wouldn't quite say "trivial"--to implement secondary command buffers with ICBs. The big sticking point I think would be checking if all commands could be encoded to the ICB, and, if not, falling back to the old path.

@cdavis5e cdavis5e added Enhancement Question Answered A question was answered labels Jun 4, 2024
@billhollings billhollings removed Question Answered A question was answered labels Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants