mirror of
https://github.com/godotengine/godot.git
synced 2026-06-18 07:33:42 +00:00
Fix leftover particle data when updating particle buffers.
Co-authored-by: Skyth <19259897+blueskythlikesclouds@users.noreply.github.com>
This commit is contained in:
parent
ec67cbe926
commit
af2fea0ad3
2 changed files with 2 additions and 0 deletions
|
|
@ -868,6 +868,7 @@ void ParticlesStorage::_particles_update_buffers(Particles *particles) {
|
|||
if (userdata_count != particles->userdata_count) {
|
||||
// Mismatch userdata, re-create buffers.
|
||||
_particles_free_data(particles);
|
||||
particles->restart_request = true;
|
||||
}
|
||||
|
||||
if (particles->amount > 0 && particles->front_process_buffer == 0) {
|
||||
|
|
|
|||
|
|
@ -1394,6 +1394,7 @@ void ParticlesStorage::_particles_update_buffers(Particles *particles) {
|
|||
if (particles->particle_buffer.is_null()) {
|
||||
particles->particle_buffer = RD::get_singleton()->storage_buffer_create((sizeof(ParticleData) + userdata_count * sizeof(float) * 4) * total_amount);
|
||||
particles->userdata_count = userdata_count;
|
||||
particles->restart_request = true;
|
||||
}
|
||||
|
||||
PackedByteArray data;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue