Skip to content

Commit 1a26b06

Browse files
authored
Merge pull request #13589 from Popov72/fix-psys-update
Particle systems: Fix crash when setting updateInAnimate to true
2 parents d3c6833 + c02441e commit 1a26b06

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/dev/core/src/Particles/gpuParticleSystem.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1540,7 +1540,7 @@ export class GPUParticleSystem extends BaseParticleSystem implements IDisposable
15401540

15411541
/** @internal */
15421542
public _update(emitterWM?: Matrix): void {
1543-
if (!this.emitter) {
1543+
if (!this.emitter || !this._targetBuffer) {
15441544
return;
15451545
}
15461546

packages/dev/core/src/ShadersWGSL/gpuUpdateParticles.compute.fx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ fn getRandomVec4(offset : f32, vertexID : f32) -> vec4<f32> {
169169
return textureLoad(randomTexture, vec2<i32>(i32(vertexID * offset / params.currentCount * f32(params.randomTextureSize)) % params.randomTextureSize, 0), 0);
170170
}
171171

172-
@stage(compute) @workgroup_size(64)
172+
@compute @workgroup_size(64)
173173
fn main(@builtin(global_invocation_id) GlobalInvocationID : vec3<u32>) {
174174
let index : u32 = GlobalInvocationID.x;
175175
let vertexID : f32 = f32(index);

0 commit comments

Comments
 (0)