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

2D: Fix rendering artefacts when using BackBufferCopy.

Fixes both GLES3 and RendererRD implementations
This commit is contained in:
Stuart Carnie
2025-01-25 07:59:32 +11:00
parent b15b24b087
commit 2510fefebd
2 changed files with 7 additions and 9 deletions

View File

@@ -568,6 +568,8 @@ void RasterizerCanvasGLES3::canvas_render_items(RID p_to_render_target, Item *p_
// Clear out state used in 2D pass
reset_canvas();
state.current_batch_index = 0;
state.canvas_instance_batches.clear();
state.current_data_buffer_index = (state.current_data_buffer_index + 1) % state.canvas_instance_data_buffers.size();
state.current_instance_buffer_index = 0;
}
@@ -662,8 +664,6 @@ void RasterizerCanvasGLES3::_render_items(RID p_to_render_target, int p_item_cou
if (index == 0) {
// Nothing to render, just return.
state.current_batch_index = 0;
state.canvas_instance_batches.clear();
return;
}
@@ -807,8 +807,6 @@ void RasterizerCanvasGLES3::_render_items(RID p_to_render_target, int p_item_cou
}
glDisable(GL_SCISSOR_TEST);
state.current_batch_index = 0;
state.canvas_instance_batches.clear();
state.last_item_index += index;
}