So far I read chapter 1 to 5 and almost all the draw calls are repeating the same commands over and over. So I modified the code for Chapter 5 so that the command buffer only gets to be created once and encoder only encodes once. But the draw call only successfully ran once and, for the second time, the program said:
"failed assertion `Scheduled handler provided after commit call'"
.
It seems that I do need to create and encode command buffers every frame. But why is that the case? Since encoding render commands is so repetitive, why does not the API allow us to reuse command buffers to save time?