1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-14 13:41:12 +00:00

Use idiomatic templating vargs in a few places to reduce code.

This commit is contained in:
Lukas Tenbrink
2025-03-10 11:59:17 +01:00
parent 42c7f14422
commit df7dab4946
3 changed files with 4 additions and 38 deletions

View File

@@ -107,16 +107,6 @@ class UniformSetCacheRD : public Object {
return _compare_args(idx + 1, uniforms, args...);
}
_FORCE_INLINE_ void _create_args(Vector<RD::Uniform> &uniforms, const RD::Uniform &arg) {
uniforms.push_back(arg);
}
template <typename... Args>
_FORCE_INLINE_ void _create_args(Vector<RD::Uniform> &uniforms, const RD::Uniform &arg, Args... args) {
uniforms.push_back(arg);
_create_args(uniforms, args...);
}
static UniformSetCacheRD *singleton;
uint32_t cache_instances_used = 0;
@@ -176,10 +166,7 @@ public:
// Not in cache, create:
Vector<RD::Uniform> uniforms;
_create_args(uniforms, args...);
return _allocate_from_uniforms(p_shader, p_set, h, table_idx, uniforms);
return _allocate_from_uniforms(p_shader, p_set, h, table_idx, Vector<RD::Uniform>{ args... });
}
template <typename... Args>