@@ -913,6 +913,9 @@ void RendererCanvasRenderRD::canvas_render_items(RID p_to_render_target, Item *p
913
913
RenderingServerDefault::redraw_request ();
914
914
}
915
915
916
+ texture_info_map.clear ();
917
+ state.current_batch_index = 0 ;
918
+ state.canvas_instance_batches .clear ();
916
919
state.current_data_buffer_index = (state.current_data_buffer_index + 1 ) % BATCH_DATA_BUFFER_COUNT;
917
920
state.current_instance_buffer_index = 0 ;
918
921
}
@@ -2286,9 +2289,6 @@ void RendererCanvasRenderRD::_render_batch_items(RenderTarget p_to_render_target
2286
2289
2287
2290
RD::get_singleton ()->draw_list_end ();
2288
2291
2289
- texture_info_map.clear ();
2290
- state.current_batch_index = 0 ;
2291
- state.canvas_instance_batches .clear ();
2292
2292
state.last_instance_index += instance_index;
2293
2293
}
2294
2294
@@ -2975,7 +2975,7 @@ void RendererCanvasRenderRD::_canvas_texture_invalidation_callback(bool p_delete
2975
2975
KeyValue<RID, TightLocalVector<RID>> *kv = static_cast <KeyValue<RID, TightLocalVector<RID>> *>(p_userdata);
2976
2976
RD *rd = RD::get_singleton ();
2977
2977
for (RID rid : kv->value ) {
2978
- // the invalidation callback will take care of clearing rid_set_to_uniform_set cache also
2978
+ // The invalidation callback will also take care of clearing rid_set_to_uniform_set cache.
2979
2979
rd->free (rid);
2980
2980
}
2981
2981
kv->value .clear ();
@@ -3008,7 +3008,7 @@ void RendererCanvasRenderRD::_render_batch(RD::DrawListID p_draw_list, CanvasSha
3008
3008
uniform_set = &iter->data ;
3009
3009
RD::get_singleton ()->uniform_set_set_invalidation_callback (rid, RendererCanvasRenderRD::_uniform_set_invalidation_callback, (void *)&iter->key );
3010
3010
3011
- // If this is a CanvasTexture, it must be tracked so that any changes to the diffuse, normal
3011
+ // If this is a CanvasTexture, it must be tracked so that any changes to the diffuse, normal,
3012
3012
// or specular channels invalidate all associated uniform sets.
3013
3013
if (ts->owns_canvas_texture (p_batch->tex_info ->state .texture )) {
3014
3014
KeyValue<RID, TightLocalVector<RID>> *kv = nullptr ;
0 commit comments