Add resize_initialized and resize_uninitialized to Vector. These functions serve as replacements for resize, to make sure the caller understands whether elements need to be initialized 'by hand' after the call.

This commit is contained in:
Lukas Tenbrink 2025-05-23 00:20:22 +02:00
parent 6c9765d87e
commit 4cb8a0c77e
24 changed files with 62 additions and 44 deletions

View file

@ -3183,7 +3183,7 @@ RID RenderingDevice::vertex_array_create(uint32_t p_vertex_count, VertexFormatID
VertexArray vertex_array;
if (p_offsets.is_empty()) {
vertex_array.offsets.resize_zeroed(p_src_buffers.size());
vertex_array.offsets.resize_initialized(p_src_buffers.size());
} else {
ERR_FAIL_COND_V(p_offsets.size() != p_src_buffers.size(), RID());
vertex_array.offsets = p_offsets;