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

Merge pull request #106732 from stuartcarnie/rd_reduce_allocations

Renderer: Eliminate `String` allocations for all labels in the renderer
This commit is contained in:
Thaddeus Crews
2025-05-28 09:47:43 -05:00
10 changed files with 30 additions and 19 deletions

View File

@@ -6200,7 +6200,11 @@ void RenderingDevice::set_resource_name(RID p_id, const String &p_name) {
#endif
}
void RenderingDevice::draw_command_begin_label(String p_label_name, const Color &p_color) {
void RenderingDevice::_draw_command_begin_label(String p_label_name, const Color &p_color) {
draw_command_begin_label(p_label_name.utf8().span(), p_color);
}
void RenderingDevice::draw_command_begin_label(const Span<char> p_label_name, const Color &p_color) {
ERR_RENDER_THREAD_GUARD();
if (!context->is_debug_utils_enabled()) {
@@ -7450,7 +7454,7 @@ void RenderingDevice::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_resource_name", "id", "name"), &RenderingDevice::set_resource_name);
ClassDB::bind_method(D_METHOD("draw_command_begin_label", "name", "color"), &RenderingDevice::draw_command_begin_label);
ClassDB::bind_method(D_METHOD("draw_command_begin_label", "name", "color"), &RenderingDevice::_draw_command_begin_label);
#ifndef DISABLE_DEPRECATED
ClassDB::bind_method(D_METHOD("draw_command_insert_label", "name", "color"), &RenderingDevice::draw_command_insert_label);
#endif