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

2D: Fix clip children

We were not reusing the last index, same issue as #102161
This commit is contained in:
Stuart Carnie
2025-11-19 06:12:49 +11:00
parent 9c561027fc
commit bd2d596ca7

View File

@@ -3243,7 +3243,6 @@ RendererCanvasRenderRD::Batch *RendererCanvasRenderRD::_new_batch(bool &r_batch_
if (!must_remap) {
state.instance_data = state.prev_instance_data;
state.instance_data_index = state.prev_instance_data_index;
new_batch.start = state.instance_data_index;
}
state.prev_instance_data = nullptr;
state.prev_instance_data_index = 0;
@@ -3253,6 +3252,9 @@ RendererCanvasRenderRD::Batch *RendererCanvasRenderRD::_new_batch(bool &r_batch_
if (state.instance_data == nullptr) {
// If there is no existing instance buffer, we must allocate a new one.
_allocate_instance_buffer();
} else {
// Otherwise, just use the existing one from where it last left off.
new_batch.start = state.instance_data_index;
}
new_batch.instance_buffer = state.instance_buffers._get(0);
state.canvas_instance_batches.push_back(new_batch);