From b95add2bfd85c722e667cd0e06f37fcc56674950 Mon Sep 17 00:00:00 2001 From: lawnjelly Date: Sat, 23 May 2020 11:35:33 +0100 Subject: [PATCH] GLES2 Batching - Builtins prevent baking in unshaded shaders Builtins that should prevent baking colors and vertex positions were incorrectly only active in shaders that were not unshaded. This was a terminology misunderstanding - unshaded materials can still use shaders so should have the same test to prevent baking. --- drivers/gles2/rasterizer_canvas_gles2.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gles2/rasterizer_canvas_gles2.cpp b/drivers/gles2/rasterizer_canvas_gles2.cpp index 02c32d91ff0..5735ba3af00 100644 --- a/drivers/gles2/rasterizer_canvas_gles2.cpp +++ b/drivers/gles2/rasterizer_canvas_gles2.cpp @@ -2285,7 +2285,7 @@ bool RasterizerCanvasGLES2::try_join_item(Item *p_ci, RenderItemState &r_ris, bo // does the shader contain BUILTINs which should break the batching? bdata.joined_item_batch_flags = 0; - if (r_ris.shader_cache && !unshaded) { + if (r_ris.shader_cache) { unsigned int and_flags = r_ris.shader_cache->canvas_item.batch_flags & (RasterizerStorageGLES2::Shader::CanvasItem::PREVENT_COLOR_BAKING | RasterizerStorageGLES2::Shader::CanvasItem::PREVENT_VERTEX_BAKING); if (and_flags) {