We know what type we're releasing 99% of the time, we don't need to
play a guessing game in lovrRelease, just have the caller say which
destructor to use.
There is lovrGenericRelease for situations where we need it, which
does the slower lookup of the destructor.
Now Ref has a type id instead of a destructor/name, and use the type to
lookup the destructor and name when needed.
This improves performance, since now Ref contains a lot less data and we
can do an integer comparison instead of a string comparison when reading
objects from Lua.
Currently we turn off SSE based on the OS (Android or Emscripten),
but this causes a build error on non-android arm CPUs. Now we
correctly look at the CPU architecture.
- When reading points from a table of numbers, the array
indexing was not correct and vertex positions were not
getting correctly written.
- The normals/texture coordinates weren't getting written,
so their values were using whatever was in the buffer.
Now they are always set to zero.
Currently glBindBufferRange does not seem to work properly if the
offset is bigger than the maximum size of a uniform buffer. The
size of the draw data buffer is being limited as a workaround.
There appears to be some sort of problem where syncing on WASM and
Android leads to dropped frames. The only sync that causes this
problem is the delayed sync that occurs after rolling over a
buffer -- in that case the sync is often placed one frame late
once we realize that the rollover has occurred. I'm not sure if
this is a driver quirk or an improper use of glFenceSync but for
right now avoiding the fence on the problematic platforms fixes
the immediate issue.