Graphics.DrawProceduralin a shader that uses
SV_VertexIDto fetch elements from a
StructuredBuffer, things work perfectly fine in standalone builds, but on Quest everything goes crazy. All the vertices end up with bizarre positions, normals, etc, resulting in huge triangles going everywhere. Even stranger, vertices that aren't part of my system, such as the default Avatar hands, also have their vertices corrupted! I've experienced similar problems in the past using
Graphics.DrawMeshInstancedIndirecton the Unity forum over a year ago, which you can view here
Hi! Yeah I did in the end, thanks to some help from Unity - as it turns out it was all my fault haha.
You can read about the solution to this here:
Long story short, the vertex shader needs to completely initialize its vertex output, and if it doesn't, but has 'inout' rather than 'out' in the function declaration, this error results. So either make sure you fully initialize the vertex or, preferably, just use the 'out' keyword.