Browse Source

Batching - prevent reordering items over a copybackbuffer

Reordering an item from after a copybackbuffer to before would result in the wrong thing being rendered into the backbuffer.

This PR puts in a check to prevent reordering over such a boundary.
lawnjelly 4 years ago
parent
commit
35ed654911
1 changed files with 5 additions and 0 deletions
  1. 5 0
      drivers/gles_common/rasterizer_canvas_batcher.h

+ 5 - 0
drivers/gles_common/rasterizer_canvas_batcher.h

@@ -2716,6 +2716,11 @@ PREAMBLE(bool)::sort_items_from(int p_start) {
 		return false;
 	}
 
+	// disallow sorting over copy back buffer
+	if (second.item->copy_back_buffer) {
+		return false;
+	}
+
 	// which neighbour to test
 	int test_last = 2 + bdata.settings_item_reordering_lookahead;
 	for (int test = 2; test < test_last; test++) {