Android device not support GPU instancing. Immediate mode Using Draw.Command throw error
I was expecting the GPU instancing Draw command will still draw something if device not support instancing.
It did not draw anything and only an error was throw on Android device say instancing is not supported on this device.
So I have to manually check if device support instancing or not.
if(SystemInfo.supportsInstancing)
using (Draw.Command(cam))
{
Drawing();
}
else Drawing();
I suggest the package add some documents so other people can avoid it.
Or better Draw.Command() handle non gpu-instancing device internally.
https://docs.unity3d.com/ScriptReference/SystemInfo-supportsInstancing.html
Note: this also happen to some specific newer devices. Not old android Android.
I do not have specific data but you could expect around 10% users on country like Brazil have good android Device but still not support GPU instancing.
After taking a stab at solving this my own way, I came up with this solution. Just in case anyone else stumbles upon this thread and has the same issue.
I add the below code to my GameStartState which is some of the first code that executes in my game.
Because ShapesConfig is a ScriptableObject I add the !UNITY_EDITOR preprocessor directive to ensure it doesn't keep getting changed and show up in my version control.