mirror of
https://github.com/overte-org/overte.git
synced 2025-04-22 22:13:29 +02:00
Merge pull request #9877 from hyperlogic/bug-fix/debug-draw-races
Fixes for race conditions in DebugDraw
This commit is contained in:
commit
495deba771
3 changed files with 7 additions and 3 deletions
|
@ -17,6 +17,7 @@ module.exports = {
|
|||
"Clipboard": false,
|
||||
"Controller": false,
|
||||
"DialogsManager": false,
|
||||
"DebugDraw": false,
|
||||
"Entities": false,
|
||||
"FaceTracker": false,
|
||||
"GlobalServices": false,
|
||||
|
|
|
@ -608,6 +608,8 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
|||
}
|
||||
}
|
||||
|
||||
// make sure the debug draw singleton is initialized on the main thread.
|
||||
DebugDraw::getInstance().removeMarker("");
|
||||
|
||||
_runningMarker.startRunningMarker();
|
||||
|
||||
|
|
|
@ -346,7 +346,9 @@ void AnimDebugDraw::update() {
|
|||
numVerts += (int)markerMap.size() * VERTICES_PER_BONE;
|
||||
auto myAvatarMarkerMap = DebugDraw::getInstance().getMyAvatarMarkerMap();
|
||||
numVerts += (int)myAvatarMarkerMap.size() * VERTICES_PER_BONE;
|
||||
numVerts += (int)DebugDraw::getInstance().getRays().size() * VERTICES_PER_RAY;
|
||||
auto rays = DebugDraw::getInstance().getRays();
|
||||
DebugDraw::getInstance().clearRays();
|
||||
numVerts += (int)rays.size() * VERTICES_PER_RAY;
|
||||
|
||||
// allocate verts!
|
||||
std::vector<AnimDebugDrawData::Vertex> vertices;
|
||||
|
@ -398,10 +400,9 @@ void AnimDebugDraw::update() {
|
|||
}
|
||||
|
||||
// draw rays from shared DebugDraw singleton
|
||||
for (auto& iter : DebugDraw::getInstance().getRays()) {
|
||||
for (auto& iter : rays) {
|
||||
addLine(std::get<0>(iter), std::get<1>(iter), std::get<2>(iter), v);
|
||||
}
|
||||
DebugDraw::getInstance().clearRays();
|
||||
|
||||
data._vertexBuffer->resize(sizeof(AnimDebugDrawData::Vertex) * numVerts);
|
||||
data._vertexBuffer->setSubData<AnimDebugDrawData::Vertex>(0, vertices);
|
||||
|
|
Loading…
Reference in a new issue