This repository is for the legacy Mixed Reality Toolkit (MRTK) v2. For the latest version of the MRTK please visit https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity
If you enable the visual profiler, an InvalidOperationException: "Instancing is not supported" could occur in MixedRealityToolkitVisualProfiler.cs line 384, if the platform doesn't support GPU draw call instancing. The method Graphics.DrawMeshInstanced() throws this exception.
To reproduce
WebGL 1.0 doesn't support it for example.
Change your Unity platform to WebGL
Edit -> Graphics emulation -> "WebGL 1.0"
Play in editor and you will get the exception at each frame
You can also compile for WebGL and execute it in a browser that only support WebGL 1.0.
Expected behavior
A clear and concise description of what you expected to happen.
Setup
Unity Version 2019.4.2f1
MRTK Version 2.4
Target platform
WebGL 1.0
Additional context
In MixedRealityToolkitVisualProfiler.cs, you already bypass Graphics.DrawMeshInstanced() if defaultInstancedMaterial == null, you coud just add the condition SystemInfo.supportsInstancing :
Describe the bug
If you enable the visual profiler, an InvalidOperationException: "Instancing is not supported" could occur in MixedRealityToolkitVisualProfiler.cs line 384, if the platform doesn't support GPU draw call instancing. The method
Graphics.DrawMeshInstanced()
throws this exception.To reproduce
WebGL 1.0 doesn't support it for example.
You can also compile for WebGL and execute it in a browser that only support WebGL 1.0.
Expected behavior
A clear and concise description of what you expected to happen.
Setup
Target platform
Additional context
In MixedRealityToolkitVisualProfiler.cs, you already bypass
Graphics.DrawMeshInstanced()
ifdefaultInstancedMaterial == null
, you coud just add the conditionSystemInfo.supportsInstancing
: