Skip to content

Commit

Permalink
GLES2 Batching - Builtins prevent baking in unshaded shaders
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
lawnjelly authored and h committed Nov 10, 2020
1 parent e8e16f5 commit 1bb3978
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gles2/rasterizer_canvas_gles2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 1bb3978

Please sign in to comment.