From 9b08e9143d718497e9c07a44b1719312f09586bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 16 Jan 2022 18:47:02 +0100 Subject: [PATCH] sceneconverter: print also mesh index buffer bounds, if specified. Useful for discovering cases where vertex buffer is not used as a whole, or conversely, index buffer out of bounds. --- src/Magnum/SceneTools/sceneconverter.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Magnum/SceneTools/sceneconverter.cpp b/src/Magnum/SceneTools/sceneconverter.cpp index 49d207125..3e22e4873 100644 --- a/src/Magnum/SceneTools/sceneconverter.cpp +++ b/src/Magnum/SceneTools/sceneconverter.cpp @@ -380,6 +380,7 @@ used.)") UnsignedInt indexCount, vertexCount; std::size_t indexOffset; Int indexStride; + std::string indexBounds; MeshIndexType indexType; Containers::Array attributes; std::size_t indexDataSize, vertexDataSize; @@ -600,6 +601,8 @@ used.)") info.indexOffset = mesh->indexOffset(); info.indexStride = mesh->indexStride(); info.indexDataSize = mesh->indexData().size(); + if(args.isSet("bounds")) + info.indexBounds = calculateBounds(mesh->indicesAsArray()); } for(UnsignedInt k = 0; k != mesh->attributeCount(); ++k) { const Trade::MeshAttribute name = mesh->attributeName(k); @@ -909,6 +912,8 @@ used.)") << info.indexType << Debug::nospace << ", stride" << info.indexStride << "(" << Debug::nospace << Utility::formatString("{:.1f}", info.indexDataSize/1024.0f) << "kB)"; + if(!info.indexBounds.empty()) + d << Debug::newline << " bounds:" << info.indexBounds; } for(const MeshAttributeInfo& attribute: info.attributes) {