You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-07 12:30:27 +00:00
Use WorkerThreadPool for Server threads
* Servers now use WorkerThreadPool for background computation. * This helps keep the number of threads used fixed at all times. * It also ensures everything works on HTML5 with threads. * And makes it easier to support disabling threads for also HTML5. CommandQueueMT now syncs with the servers via the WorkerThreadPool yielding mechanism, which makes its classic main sync semaphore superfluous. Also, some warnings about calls that kill performance when using threaded rendering are removed because there's a mechanism that warns about that in a more general fashion. Co-authored-by: Pedro J. Estébanez <pedrojrulez@gmail.com>
This commit is contained in:
committed by
Pedro J. Estébanez
parent
c28f5901c7
commit
65686dedf9
@@ -83,25 +83,16 @@ static PackedInt64Array to_int_array(const Vector<ObjectID> &ids) {
|
||||
}
|
||||
|
||||
PackedInt64Array RenderingServer::_instances_cull_aabb_bind(const AABB &p_aabb, RID p_scenario) const {
|
||||
if (RSG::threaded) {
|
||||
WARN_PRINT_ONCE("Using this function with a threaded renderer hurts performance, as it causes a server stall.");
|
||||
}
|
||||
Vector<ObjectID> ids = instances_cull_aabb(p_aabb, p_scenario);
|
||||
return to_int_array(ids);
|
||||
}
|
||||
|
||||
PackedInt64Array RenderingServer::_instances_cull_ray_bind(const Vector3 &p_from, const Vector3 &p_to, RID p_scenario) const {
|
||||
if (RSG::threaded) {
|
||||
WARN_PRINT_ONCE("Using this function with a threaded renderer hurts performance, as it causes a server stall.");
|
||||
}
|
||||
Vector<ObjectID> ids = instances_cull_ray(p_from, p_to, p_scenario);
|
||||
return to_int_array(ids);
|
||||
}
|
||||
|
||||
PackedInt64Array RenderingServer::_instances_cull_convex_bind(const TypedArray<Plane> &p_convex, RID p_scenario) const {
|
||||
if (RSG::threaded) {
|
||||
WARN_PRINT_ONCE("Using this function with a threaded renderer hurts performance, as it causes a server stall.");
|
||||
}
|
||||
Vector<Plane> planes;
|
||||
for (int i = 0; i < p_convex.size(); ++i) {
|
||||
const Variant &v = p_convex[i];
|
||||
|
||||
Reference in New Issue
Block a user