I am sure this is an elementary question, but I am new to Swift and Metal, but have a fair amount of experience using Objective C and OpenGL.
I would like to render some mathematically generated surfaces in Metal and need to fill the vertex buffer with positions and normals. I would guess that creating a one dimensional array and adding to it using "append" is not the most efficient way to do this. The buffer might be quite large and I would like to set aside the memory for it in advance, which is how I did it using Objective C. Can anyone suggest the best way to do this? Thanks in advance.