BVE-Reborn / rend3

MAINTENCE MODE ---- Easy to use, customizable, efficient 3D renderer library built on wgpu.
https://rend3.rs
Apache License 2.0
1.05k stars 59 forks source link

Confusing deadlock possibility. Not sure if it's really a bug #563

Closed pillowtrucker closed 5 months ago

pillowtrucker commented 6 months ago

I've been trying to get »mouse picking« to work with rend3 and for this I've been accessing the meshes and their bounding spheres from a gltf scene inside renderer.mesh_manager.lock_internal_data(). I don't know if it's a bug or not but there's nothing really suggesting here (other than common sense, which fails if you do a bunch of confusing linear algebra between the two invocations,) that calling renderer.add_mesh() afterwards to draw a line between the camera and the intersection point will cause a deadlock (when still holding the mesh_internal_data lock). I'm not sure how it interacts with the renderer.data_core managers. On that note - is there any particular reason why the interface to the mesh_manager is different than to the others ?