Who can tell me the difference between setVertexBuffer() and setVertexBytes() ？
setVertexBuffer() requires a
MTLBuffer. You fill this buffer with data (such as vertices) and pass it to the vertex shader.
setVertexBytes() is a shortcut, which bypasses the step of having to put the data into a
MTLBuffer. You can pass a
struct directly to the vertex shader. There is a limit of 4k bytes, however.
setVertexBytes() is a great way to pass small bits of data such as the uniforms, or a timer, for example.
Thank you very much. And I hope you could add the above to your book for the next version.