1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-07 12:30:27 +00:00

Use resize_zeroed instead of resize then fill(0) in several places.

This commit is contained in:
Lukas Tenbrink
2025-03-14 09:26:29 +01:00
parent 7e4f6bdb59
commit f4de2cd22a
6 changed files with 7 additions and 15 deletions

View File

@@ -437,8 +437,7 @@ void Fog::VolumetricFog::init(const Vector3i &fog_size, RID p_sky_shader) {
#if defined(MACOS_ENABLED) || defined(IOS_ENABLED)
Vector<uint8_t> dm;
dm.resize(fog_size.x * fog_size.y * fog_size.z * 4);
dm.fill(0);
dm.resize_zeroed(fog_size.x * fog_size.y * fog_size.z * 4);
density_map = RD::get_singleton()->storage_buffer_create(dm.size(), dm);
RD::get_singleton()->set_resource_name(density_map, "Fog density map");