From e8ce00dc0bf1a64e6d2ff191c91c2f17aee2a378 Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 17 Feb 2026 17:02:19 +0100 Subject: [PATCH] REVIEWED: `LoadGLTF()`, log warning about draco compression not supported #5567 --- src/rmodels.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/rmodels.c b/src/rmodels.c index eadc16f07..0ee103212 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -5373,6 +5373,7 @@ static Model LoadGLTF(const char *fileName) if (result != cgltf_result_success) TRACELOG(LOG_INFO, "MODEL: [%s] Failed to load mesh/material buffers", fileName); int primitivesCount = 0; + bool dracoCompression = false; // NOTE: We will load every primitive in the glTF as a separate raylib Mesh // Determine total number of meshes needed from the node hierarchy @@ -5384,9 +5385,22 @@ static Model LoadGLTF(const char *fileName) for (unsigned int p = 0; p < mesh->primitives_count; p++) { - if (mesh->primitives[p].type == cgltf_primitive_type_triangles) primitivesCount++; + if (mesh->primitives[p].has_draco_mesh_compression) + { + dracoCompression = true; + TRACELOG(LOG_WARNING, "MODEL: [%s] Failed to load mesh data, Draco compression not supported", fileName); + break; + } + else if (mesh->primitives[p].type == cgltf_primitive_type_triangles) primitivesCount++; } } + + if (dracoCompression) + { + return model; + TRACELOG(LOG_WARNING, "MODEL: [%s] Failed to load glTF data", fileName); + } + TRACELOG(LOG_DEBUG, " > Primitives (triangles only) count based on hierarchy : %i", primitivesCount); // Load our model data: meshes and materials