Chapter 31: Is triple buffering needed when using setVertexBytes?

Chapter 31 uses the example of updating Uniforms every frame to highlight the need for triple buffering to avoid race conditions.

However, the code uses encoder.setVertexBytes to pass the uniforms to the GPU, which if I understand correctly, makes a copy of the data each time, so there’s no risk of a race condition. I think triple buffering is needed only if using an MTLBuffer and calling setVertexBuffer, but I’m not sure. Can the authors clarify?

Yes, you’re quite right. I will make a note to clarify this in the next version.

Thank you, and welcome to the forums :blush:!