Drawables could specify if they're instanciable. The engine could then sort drawables by some unique identifier. For a sprite renderer this could be the the sprite, so that loitsu automatically creates a instance group for the same type of sprite.
Implementation notes:
Sprite change: Imagine that a sprite drawable gets a request to change. This should be handled properly, as this would lead to the sprite getting removed from the instance group and potentially joining another instance group
We could just make every instanciable drawable into a instance drawcall. This way we have one drawcall per type of sprite, and then just count how many of each type. So the sprite drawable wouldn't even have an implementation for rendering a sprite using a normal drawcall.
Drawables could specify if they're instanciable. The engine could then sort drawables by some unique identifier. For a sprite renderer this could be the the sprite, so that loitsu automatically creates a instance group for the same type of sprite.
Implementation notes: Sprite change: Imagine that a sprite drawable gets a request to change. This should be handled properly, as this would lead to the sprite getting removed from the instance group and potentially joining another instance group
We could just make every instanciable drawable into a instance drawcall. This way we have one drawcall per type of sprite, and then just count how many of each type. So the sprite drawable wouldn't even have an implementation for rendering a sprite using a normal drawcall.