Merge pull request #83100 from kleonc/immediate-mesh-vertex-buffer-size-fiz

Fix incorrect vertex data size calculation in `ImmediateMesh`
This commit is contained in:
Rémi Verschelde 2023-10-10 22:50:53 +02:00
commit d0301fcadd
No known key found for this signature in database
GPG Key ID: C3336907360768E1

View File

@ -175,7 +175,7 @@ void ImmediateMesh::surface_end() {
AABB aabb;
{
surface_vertex_create_cache.resize(vertex_stride * vertices.size());
surface_vertex_create_cache.resize((vertex_stride + normal_tangent_stride) * vertices.size());
uint8_t *surface_vertex_ptr = surface_vertex_create_cache.ptrw();
for (uint32_t i = 0; i < vertices.size(); i++) {
{