mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-02 00:22:43 +08:00
fix bathed buffer generation bug (#5378)
* add transformAffine() * remove duplicate code * add a backup buffer function to gfx-buffer * complete dynamic batching * fix bathed buffer generation bug
This commit is contained in:
@@ -127,6 +127,17 @@ export class ModelComponent extends RenderableComponent {
|
||||
}
|
||||
if (this._model) {
|
||||
this._model.isDynamicBatching = enable;
|
||||
if (this._model.isDynamicBatching) {
|
||||
for (let i = 0; i < this._model.subModels.length; ++i) {
|
||||
const subModel = this._model.subModels[i];
|
||||
for (let p = 0; p < subModel.passes.length; ++p) {
|
||||
const pass = subModel.passes[p];
|
||||
if (!pass.batchedBuffer) {
|
||||
pass.createBatchedBuffer();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user