<p><a href="https://developer.apple.com/library/content/documentation/3DDrawing/Conceptual/MTLBestPracticesGuide/BufferBindings.html" rel="nofollow noreferrer">Metal Best Practices Guide</a> states that </p>

<blockquote>
  <p>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</p>
</blockquote>

<p>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 <code>setVertexBytes</code> and <code>setFragmentBytes</code>.</p>

<p>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?</p>

<p>Is it simply because we have a semaphore with <code>value: 3</code> left now?</p>

CC BY-SA 3.0
2018-01-22T18:40:10.633Z
I suspect that this is where "a very small amount" comes in, you'd still want triple buffering for larger data.
porglezomp
CC BY-SA 3.0
2018-01-22T18:55:12.750Z
Not sure I understand the question. Presumably your render targets are still double or triple buffered, regardless of how you manage uniform data...?
Nathan Reed
CC BY-SA 3.0
2018-01-23T02:03:54.623Z
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).
hyperknot
<metal>
Triple buffering without buffers?
hyperknot
# Triple buffering without buffers?

(Asked by: username_0 on 2018-01-22)

[Metal Best Practices Guide](https://developer.apple.com/library/content/documentation/3DDrawing/Conceptual/MTLBestPracticesGuide/BufferBindings.html) 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?

**Tags:** metal

> **Comments:**
> **username_1**: I suspect that this is where "a very small amount" comes in, you'd still want triple buffering for larger data.  
> **username_2**: Not sure I understand the question. Presumably your render targets are still double or triple buffered, regardless of how you manage uniform data...?  
> **username_0**: 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).  

---

## 0 answers

