1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-19 14:31:59 +00:00

Initialize particles instance buffer in case it is used before being updated

This commit is contained in:
clayjohn
2023-06-29 13:24:40 -07:00
parent 9d089fe6e5
commit 35ed7c770b
2 changed files with 12 additions and 12 deletions

View File

@@ -1288,7 +1288,10 @@ void ParticlesStorage::_particles_update_buffers(Particles *particles) {
particles->userdata_count = userdata_count;
particles->particle_instance_buffer = RD::get_singleton()->storage_buffer_create(sizeof(float) * 4 * (xform_size + 1 + 1) * total_amount);
PackedByteArray data;
data.resize_zeroed(sizeof(float) * 4 * (xform_size + 1 + 1) * total_amount);
particles->particle_instance_buffer = RD::get_singleton()->storage_buffer_create(sizeof(float) * 4 * (xform_size + 1 + 1) * total_amount, data);
//needs to clear it
{