Metal Best Practices Guide states that

The setVertexBytes:length:atIndex: method is the best option for binding a very small amount (less than 4 KB) of dynamic buffer data to a vertex function

I believe this means that instead storing uniforms in an overly complicated manually memory managed dynamic buffer, it's best to simply update model/view/projection matrices without using any buffer at all, by using setVertexBytes and setFragmentBytes.

My question is, that in this case, as there is no dynamic buffer at all (only static vertex data), what are we calling triple buffering?

Is it simply because we have a semaphore with value: 3 left now?

  • $\begingroup$ I suspect that this is where "a very small amount" comes in, you'd still want triple buffering for larger data. $\endgroup$ – porglezomp Jan 22 '18 at 18:40
  • $\begingroup$ Not sure I understand the question. Presumably your render targets are still double or triple buffered, regardless of how you manage uniform data...? $\endgroup$ – Nathan Reed Jan 22 '18 at 18:55
  • $\begingroup$ This might be a particularity of Metal, I'm not sure. But I think in case of Metal you just manually manage your render targets, with a semaphore. I'm just guessing, but if I remove the semaphore it behaves like double-buffering (GPU displays one frame while CPU is encoding the next). $\endgroup$ – hyperknot Jan 23 '18 at 2:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.