Skip to content

Commit

Permalink
Fixed the problem that particles using gpu keep reporting error.
Browse files Browse the repository at this point in the history
  • Loading branch information
knoxHuang committed Nov 8, 2024
1 parent c914c67 commit 7119bf1
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions cocos/particle/renderer/particle-system-renderer-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -330,12 +330,7 @@ export default class ParticleSystemRenderer {
this._particleSystem.processor = null!;
}
const useGPU = this._useGPU && isSupportGPUParticle();
if (!useGPU && this.cpuMaterial) {
this.particleMaterial = this.cpuMaterial;
}
if (useGPU && this.gpuMaterial) {
this.particleMaterial = this.gpuMaterial;
}
this.particleMaterial = useGPU ? this.gpuMaterial : this.cpuMaterial;
this._particleSystem.processor = useGPU ? new ParticleSystemRendererGPU(this) : new ParticleSystemRendererCPU(this);
this._particleSystem.processor.updateAlignSpace(this.alignSpace);
this._particleSystem.processor.onInit(this._particleSystem);
Expand Down

0 comments on commit 7119bf1

Please sign in to comment.