DrawMesh/DrawMeshInstanced do not work in-game

I’m trying to optimize some path indicator rendering, and I switched it from using gameObjects for each indicator to a direct call to DrawMesh.

This works great in-editor, it behaves exactly as expected. But it does not work on the target build. I’ve checked the shader to make sure instancing is properly enabled, which it is. But still, nothing appears.

There are no errors, the call to DrawMeshInstanced or DrawMesh (I’ve tried both) does occur but the render call does not appear in the frame profiler.

I’m certain it’s not just being clipped, or if it is being clipped, I’m not certain why.

The indicators draw OK if they’re dropped directly in the scene, so it doesn’t appear to be a shader issue.

I did manage to figure it out.

There was no “INSTANCING” version of the shader actually included in the build. I had to adjust graphics properties to switch stripping to “Strip Unused” and also add the shader types to the variants collection.

No error was received from this; probably because the material existed (with instancing enabled) but there was no compiled variant of the shader it could use.

It WOULD be helpful if it’d at least shown a pink shader. Better still, return an error.