diff options
author | Per Melin <git@melin.net> | 2024-03-01 13:22:19 +0100 |
---|---|---|
committer | Per Melin <git@melin.net> | 2024-03-02 14:26:09 +0100 |
commit | 853935a5c96062f92c77f61685793b16fe0046e5 (patch) | |
tree | 6d23ca4f30f79553b6934537f4934c8e5f68c128 /drivers/gles3/storage/particles_storage.cpp | |
parent | 7d2ca2d8ac49cde9767e00b70f9eaf1920eb266d (diff) | |
download | redot-engine-853935a5c96062f92c77f61685793b16fe0046e5.tar.gz |
Fix error in AABB calculation for particles with USERDATA
Selecting "Generate AABB" on a 3D particle node in the editor would not work
and printed an error about incorrect buffer size if the particle shader used
one or more of the USERDATA build-ins.
Diffstat (limited to 'drivers/gles3/storage/particles_storage.cpp')
-rw-r--r-- | drivers/gles3/storage/particles_storage.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gles3/storage/particles_storage.cpp b/drivers/gles3/storage/particles_storage.cpp index c5a97bdbd5..4d563ab28b 100644 --- a/drivers/gles3/storage/particles_storage.cpp +++ b/drivers/gles3/storage/particles_storage.cpp @@ -395,7 +395,7 @@ AABB ParticlesStorage::particles_get_current_aabb(RID p_particles) { bool first = true; const uint8_t *data_ptr = (const uint8_t *)buffer.ptr(); - uint32_t particle_data_size = sizeof(ParticleInstanceData3D) + sizeof(float) * particles->userdata_count; + uint32_t particle_data_size = sizeof(ParticleInstanceData3D); for (int i = 0; i < total_amount; i++) { const ParticleInstanceData3D &particle_data = *(const ParticleInstanceData3D *)&data_ptr[particle_data_size * i]; |