From 1c93606e470f0cad5f14af104ccb89a95a89931c Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Tue, 25 Apr 2023 00:21:32 +0200 Subject: Add ValidatedCall to MethodBind * This should optimize GDScript function calling _enormously_. * It also should simplify the GDScript VM considerably. NOTE: GDExtension calling performance has most likely been affected until going via ptrcall is fixed. --- servers/rendering/rendering_device_binds.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'servers/rendering/rendering_device_binds.h') diff --git a/servers/rendering/rendering_device_binds.h b/servers/rendering/rendering_device_binds.h index 01d0f178c7..e173400299 100644 --- a/servers/rendering/rendering_device_binds.h +++ b/servers/rendering/rendering_device_binds.h @@ -349,13 +349,18 @@ public: return versions[p_version]->get_stages(); } - Vector get_version_list() const { + TypedArray get_version_list() const { Vector vnames; for (const KeyValue> &E : versions) { vnames.push_back(E.key); } vnames.sort_custom(); - return vnames; + TypedArray ret; + ret.resize(vnames.size()); + for (int i = 0; i < vnames.size(); i++) { + ret[i] = vnames[i]; + } + return ret; } void set_base_error(const String &p_error) { @@ -395,7 +400,7 @@ public: protected: Dictionary _get_versions() const { - Vector vnames = get_version_list(); + TypedArray vnames = get_version_list(); Dictionary ret; for (int i = 0; i < vnames.size(); i++) { ret[vnames[i]] = versions[vnames[i]]; -- cgit v1.2.3