Skip to content

Commit

Permalink
Handle missing byteOffset in buffer view
Browse files Browse the repository at this point in the history
  • Loading branch information
javagl committed Nov 29, 2024
1 parent c39c012 commit a43766e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/base/binary/BinaryBufferDataResolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,10 @@ export class BinaryBufferDataResolver {
const meshoptCount = meshopt.count;
const meshoptByteStride = meshopt.byteStride;
const uncompressedByteLength = meshoptByteStride * meshoptCount;
const bufferViewByteOffset = bufferView.byteOffset ?? 0;
const uncompressedBufferViewData = uncompressedBufferData.subarray(
bufferView.byteOffset,
bufferView.byteOffset + uncompressedByteLength
bufferViewByteOffset,
bufferViewByteOffset + uncompressedByteLength
);

// Use the meshopt decoder to fill the uncompressed buffer view
Expand Down

0 comments on commit a43766e

Please sign in to comment.