From c904cd059983e074b44ef63d60e4d4edd805d3b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 30 Aug 2021 14:53:07 +0200 Subject: [PATCH] Trade: properly propagate array size from MeshData::attributeData(). The test now passes again. --- doc/changelog.dox | 3 +++ src/Magnum/Trade/MeshData.cpp | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/changelog.dox b/doc/changelog.dox index 7788ae517..e93873c5f 100644 --- a/doc/changelog.dox +++ b/doc/changelog.dox @@ -469,6 +469,9 @@ See also: propagate errors when delegating to @ref Text::AbstractFontConverter::exportFontToSingleData() / @ref Text::AbstractFontConverter::exportGlyphCacheToSingleData() +- @ref Trade::MeshData::attributeData(UnsignedInt) const was not correctly + propagating attribute array size, causing array attributes to appear as + non-array - Fixed @ref Platform::GlfwApplication, @ref Platform::Sdl2Application and @ref Platform::EmscriptenApplication to correctly print app-specified DPI scaling in its verbose output diff --git a/src/Magnum/Trade/MeshData.cpp b/src/Magnum/Trade/MeshData.cpp index bb6b5558d..87235a63c 100644 --- a/src/Magnum/Trade/MeshData.cpp +++ b/src/Magnum/Trade/MeshData.cpp @@ -268,7 +268,7 @@ MeshAttributeData MeshData::attributeData(const UnsignedInt id) const { CORRADE_ASSERT(id < _attributes.size(), "Trade::MeshData::attributeData(): index" << id << "out of range for" << _attributes.size() << "attributes", MeshAttributeData{}); const MeshAttributeData& attribute = _attributes[id]; - return MeshAttributeData{attribute._name, attribute._format, attributeDataViewInternal(attribute)}; + return MeshAttributeData{attribute._name, attribute._format, attributeDataViewInternal(attribute), attribute._arraySize}; } MeshAttribute MeshData::attributeName(const UnsignedInt id) const {