We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4ba079c commit 397d269Copy full SHA for 397d269
PluginSource/source/RenderingPlugin.cpp
@@ -262,6 +262,13 @@ static void ModifyVertexBuffer()
262
return;
263
int vertexStride = int(bufferSize / vertexCount);
264
265
+ // Unity should return us a buffer that is the size of `vertexCount * sizeof(MeshVertex)`
266
+ // If that's not the case then we should quit to avoid unexpected results.
267
+ // This can happen if https://docs.unity3d.com/ScriptReference/Mesh.GetNativeVertexBufferPtr.html returns
268
+ // a pointer to a buffer with an unexpected layout.
269
+ if (static_cast<unsigned int>(vertexStride) != sizeof(MeshVertex))
270
+ return;
271
+
272
const float t = g_Time * 3.0f;
273
274
char* bufferPtr = (char*)bufferDataPtr;
0 commit comments