Browse Source

Batching - fix item_batch_flags stale state

Fixes bdata.joined_item_batch_flags not being kept up to date during the rendering pass.

(cherry picked from commit 17a51b3a9e3ea5b744578911d7f1c903ad56a6a9)
lawnjelly 4 years ago
parent
commit
2857840754
1 changed files with 7 additions and 0 deletions
  1. 7 0
      drivers/gles_common/rasterizer_canvas_batcher.h

+ 7 - 0
drivers/gles_common/rasterizer_canvas_batcher.h

@@ -2568,6 +2568,13 @@ PREAMBLE(void)::render_joined_item_commands(const BItemJoined &p_bij, Rasterizer
 		bdata.fvf = RasterizerStorageCommon::FVF_LARGE;
 		bdata.fvf = RasterizerStorageCommon::FVF_LARGE;
 	}
 	}
 
 
+	// make sure the jointed item flags state is up to date, as it is read indirectly in
+	// a couple of places from the state rather than from the joined item.
+	// we could alternatively make sure to only read directly from the joined item
+	// during the render, but it is probably more bug future proof to make sure both
+	// are up to date.
+	bdata.joined_item_batch_flags = p_bij.flags;
+
 	// in the special case of custom shaders that read from VERTEX (i.e. vertex position)
 	// in the special case of custom shaders that read from VERTEX (i.e. vertex position)
 	// we want to disable software transform of extra matrix
 	// we want to disable software transform of extra matrix
 	if (bdata.joined_item_batch_flags & RasterizerStorageCommon::PREVENT_VERTEX_BAKING) {
 	if (bdata.joined_item_batch_flags & RasterizerStorageCommon::PREVENT_VERTEX_BAKING) {