From f50edaa18c072bd68636e79554055fda1d1f6412 Mon Sep 17 00:00:00 2001 From: halx99 Date: Fri, 23 Oct 2020 10:26:45 +0800 Subject: [PATCH] Simply skip batch for custom program, see #245 --- cocos/renderer/CCTrianglesCommand.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cocos/renderer/CCTrianglesCommand.cpp b/cocos/renderer/CCTrianglesCommand.cpp index 9737385808..95828a8130 100644 --- a/cocos/renderer/CCTrianglesCommand.cpp +++ b/cocos/renderer/CCTrianglesCommand.cpp @@ -55,6 +55,10 @@ void TrianglesCommand::init(float globalOrder, Texture2D* texture, const BlendFu _programType = _pipelineDescriptor.programState->getProgram()->getProgramType(); _texture = texture->getBackendTexture(); _blendType = blendType; + + //since it would be too expensive to check the uniforms, simplify enable batching for built-in program. + if (_programType == backend::ProgramType::CUSTOM_PROGRAM) + setSkipBatching(true); //TODO: minggo set it in Node? auto& blendDescriptor = _pipelineDescriptor.blendDescriptor;