Fix crash on Mac and Android caused by a buffer validation error fix in #92 #105
No reviewers
Labels
No labels
audio
bug
confirmed
cpu
critical
development
enhancement
gpu
graphics-backend:opengl
graphics-backend:vulkan
gui
help wanted
horizon/hle
i18n
infra
input
kernel
linux
macos
suggestion
windows
No assignees
1 participant
Notifications
Due date
No due date set.
Reference
projects/Ryubing!105
Loading…
Reference in a new issue
No description provided.
Delete branch "AsperTheDog/Ryubing:fix-vertex-crash-mvk"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR fixes a bug introduced in #92. In that PR, the problematic commit did its work directly on the updater's own arrays, calling Auto.Get() on each entry as it went, and nulling entries out along the way. The problem is that Get() can call back into Commit (via ClearMirrors -> Rebind), and when it did, that reentrant Commit would read from the same arrays the outer call was still in the middle of processing, hit one of the entries the outer had already nulled, and throw an NullReferenceException. The fix is to have Commit start by copying everything it needs into local variables and resetting _count to zero, so a reentrant call sees a clean updater and operates on its own data. The outer call then writes its snapshot back into the native arrays just before recording the Vulkan bind.