From 157526d70cf7bc61b9ef2bbeb758a6b3d57f59ec Mon Sep 17 00:00:00 2001 From: zach Date: Mon, 31 Jul 2023 11:03:19 +0800 Subject: [PATCH] fix shader block memory overwrite issue. --- native/cocos/scene/Pass.cpp | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/native/cocos/scene/Pass.cpp b/native/cocos/scene/Pass.cpp index 16ad740e353..13518a78464 100644 --- a/native/cocos/scene/Pass.cpp +++ b/native/cocos/scene/Pass.cpp @@ -416,17 +416,8 @@ void Pass::resetUBOs() { ofs += size; } }; - auto *programLib = render::getProgramLibrary(); - if (programLib) { - const auto &set = _shaderInfo->descriptors.at( - static_cast(pipeline::SetIndex::MATERIAL)); - for (const auto &block : set.blocks) { - updateBuffer(block); - } - } else { - for (const auto &u : _shaderInfo->blocks) { - updateBuffer(u); - } + for (const auto &u : _shaderInfo->blocks) { + updateBuffer(u); } _rootBufferDirty = true; }