Skip to content

Commit bde165c

Browse files
olawlorakien-mga
authored andcommitted
Fix GLES3 crash with Mesh surface with exactly 65536 vertices
Fixes godotengine#95837.
1 parent da5f398 commit bde165c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gles3/storage/mesh_storage.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ void MeshStorage::mesh_add_surface(RID p_mesh, const RS::SurfaceData &p_surface)
301301
Vector<uint8_t> ir = new_surface.index_data;
302302
wr = wf_indices.ptrw();
303303

304-
if (new_surface.vertex_count < (1 << 16)) {
304+
if (new_surface.vertex_count <= 65536) {
305305
// Read 16 bit indices.
306306
const uint16_t *src_idx = (const uint16_t *)ir.ptr();
307307
for (uint32_t i = 0; i + 5 < wf_index_count; i += 6) {

0 commit comments

Comments
 (0)