diff options
author | Juan Linietsky <reduzio@gmail.com> | 2023-04-25 00:21:32 +0200 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2023-04-30 20:01:26 +0200 |
commit | 1c93606e470f0cad5f14af104ccb89a95a89931c (patch) | |
tree | fad6e8c9e15c3a3a211d4b2fff98a4e81a5ae2ca /servers/rendering/rendering_device_binds.h | |
parent | 14c582bca81046fdde35e16088ddfd5df0136d56 (diff) | |
download | redot-engine-1c93606e470f0cad5f14af104ccb89a95a89931c.tar.gz |
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.
Diffstat (limited to 'servers/rendering/rendering_device_binds.h')
-rw-r--r-- | servers/rendering/rendering_device_binds.h | 11 |
1 files changed, 8 insertions, 3 deletions
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<StringName> get_version_list() const { + TypedArray<StringName> get_version_list() const { Vector<StringName> vnames; for (const KeyValue<StringName, Ref<RDShaderSPIRV>> &E : versions) { vnames.push_back(E.key); } vnames.sort_custom<StringName::AlphCompare>(); - return vnames; + TypedArray<StringName> 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<StringName> vnames = get_version_list(); + TypedArray<StringName> vnames = get_version_list(); Dictionary ret; for (int i = 0; i < vnames.size(); i++) { ret[vnames[i]] = versions[vnames[i]]; |