The cacheData structure might hold an old uvs array when a region is updated.
The PR just always reassigns the current uvs to the cache.
The alternative would have been to check if the uvs length differs like this:
if (cacheData.uvs !== attachment.uvs)
{
cacheData.uvs = attachment.uvs as Float32Array;
}
But the result would have been almost the same with an additional if check. In general uvs array changes very rarely, so in most of the case the if body would not have been executed.
I don't see any performance improvement in keeping that if, so I just removed it and kept only the assignment.
The
cacheData
structure might hold an olduvs
array when a region is updated.The PR just always reassigns the current
uvs
to the cache. The alternative would have been to check if the uvs length differs like this:But the result would have been almost the same with an additional if check. In general
uvs
array changes very rarely, so in most of the case the if body would not have been executed. I don't see any performance improvement in keeping that if, so I just removed it and kept only the assignment.This fixes a bug reported by a user on discord: https://discord.com/channels/734147990985375826/968068622327111681/1270951771564675134