Selaa lähdekoodia

Merge pull request #85778 from HolySkyMin/weird_box_killer_try2

GLES3: Skip batches with zero instance count while rendering canvas
Yuri Sizov 1 vuosi sitten
vanhempi
commit
36f260babe
1 muutettua tiedostoa jossa 5 lisäystä ja 0 poistoa
  1. 5 0
      drivers/gles3/rasterizer_canvas_gles3.cpp

+ 5 - 0
drivers/gles3/rasterizer_canvas_gles3.cpp

@@ -661,6 +661,11 @@ void RasterizerCanvasGLES3::_render_items(RID p_to_render_target, int p_item_cou
 	state.current_tex = RID();
 
 	for (uint32_t i = 0; i <= state.current_batch_index; i++) {
+		// Skipping when there is no instances.
+		if (state.canvas_instance_batches[i].instance_count == 0) {
+			continue;
+		}
+
 		//setup clip
 		if (current_clip != state.canvas_instance_batches[i].clip) {
 			current_clip = state.canvas_instance_batches[i].clip;