failed assertion `Set Vertex Buffer Offset Validation invalid usage because encoding has ended.

This error usually occurs when renderCommandEncoder.endEncoding() is placed incorrectly. In Metal, endEncoding() must be calledd exactly…