Skip to content

Commit

Permalink
fix particle ia reuse (#7267)
Browse files Browse the repository at this point in the history
* fix particle ia reuse

* useless remove

* fix trail & line

Co-authored-by: ArthurWang <810612483@qq.com>
  • Loading branch information
LinYunMo and LinYunWang committed Sep 2, 2020
1 parent dcfeb16 commit 883a057
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions cocos/particle/models/line-model.ts
Expand Up @@ -212,8 +212,8 @@ export class LineModel extends Model {
public updateIA (count: number) {
const ia = this._subModels[0].inputAssembler;
ia.vertexBuffers[0].update(this._vdataF32!);
ia.indexCount = this._indexCount * count;
this._iaInfo.drawInfos[0] = ia;
this._iaInfo.drawInfos[0].firstIndex = 0;
this._iaInfo.drawInfos[0].indexCount = this._indexCount * count;
this._iaInfoBuffer.update(this._iaInfo);
}

Expand Down
4 changes: 2 additions & 2 deletions cocos/particle/models/particle-batch-model.ts
Expand Up @@ -326,8 +326,8 @@ export default class ParticleBatchModel extends Model {
public updateIA (count: number) {
const ia = this._subModels[0].inputAssembler;
ia.vertexBuffers[0].update(this._vdataF32!);
ia.indexCount = this._indexCount * count;
this._iaInfo.drawInfos[0] = ia;
this._iaInfo.drawInfos[0].firstIndex = 0;
this._iaInfo.drawInfos[0].indexCount = this._indexCount * count;
this._iaInfoBuffer.update(this._iaInfo);
}

Expand Down
4 changes: 2 additions & 2 deletions cocos/particle/renderer/trail.ts
Expand Up @@ -557,8 +557,8 @@ export default class TrailModule {
const subModel = subModels[0];
subModel.inputAssembler!.vertexBuffers[0].update(this._vbF32!);
subModel.inputAssembler!.indexBuffer!.update(this._iBuffer!);
subModel.inputAssembler!.indexCount = count;
this._iaInfo.drawInfos[0] = subModel.inputAssembler!;
this._iaInfo.drawInfos[0].firstIndex = 0;
this._iaInfo.drawInfos[0].indexCount = count;
this._iaInfoBuffer!.update(this._iaInfo);
}
}
Expand Down

0 comments on commit 883a057

Please sign in to comment.