1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-22 15:06:45 +00:00

Batching across z_indices

Extra functions canvas_render_items_begin and canvas_render_items_end are added to RasterizerCanvas, with noop stubs for non-GLES2 renderers. This enables batching to be spready over multiple z_indices, and multiple calls to canvas_render_items.

It does this by only performing item joining within canvas_render_items, and deferring rendering until canvas_render_items_end().
This commit is contained in:
lawnjelly
2020-04-12 13:52:25 +01:00
parent 1fb6181ba6
commit 93af8e7d1b
4 changed files with 73 additions and 36 deletions

View File

@@ -1066,6 +1066,8 @@ public:
virtual void canvas_begin() = 0;
virtual void canvas_end() = 0;
virtual void canvas_render_items_begin(const Color &p_modulate, Light *p_light, const Transform2D &p_base_transform) {}
virtual void canvas_render_items_end() {}
virtual void canvas_render_items(Item *p_item_list, int p_z, const Color &p_modulate, Light *p_light, const Transform2D &p_base_transform) = 0;
virtual void canvas_debug_viewport_shadows(Light *p_lights_with_shadow) = 0;