+ else if(MaskMatch(mFlags, U8_INDICES))
+ {
+ DALI_ASSERT_ALWAYS(((mIndices.mBlob.mLength % sizeof(uint8_t) == 0) ||
+ mIndices.mBlob.mStride >= sizeof(uint8_t)) &&
+ "Index buffer length not a multiple of element size");
+ const auto indexCount = mIndices.mBlob.GetBufferSize() / sizeof(uint8_t);
+ raw.mIndices.resize(indexCount); // NOTE: we need space for uint32_ts initially.
+
+ std::string path;
+ auto u8s = reinterpret_cast<uint8_t*>(raw.mIndices.data()) + indexCount;
+ auto& stream = GetAvailableData(fileStream, meshPath, buffers[mIndices.mBufferIdx], path);
+ if(!ReadAccessor(mIndices, stream, u8s))
+ {
+ ExceptionFlinger(ASSERT_LOCATION) << "Failed to read indices from '" << path << "'.";
+ }
+
+ auto u16s = raw.mIndices.data();
+ auto end = u8s + indexCount;
+ while(u8s != end)
+ {
+ *u16s = static_cast<uint16_t>(*u8s);
+ ++u16s;
+ ++u8s;
+ }
+ }