Skip to content

Commit

Permalink
GLTF Builder: fixed issue with requesting data from empty buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMostDiligent committed Oct 9, 2023
1 parent 1c1ea39 commit 82e85c9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion AssetLoader/interface/GLTFBuilder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -579,9 +579,11 @@ auto ModelBuilder::GetGltfDataInfo(const GltfModelType& GltfModel, int AccessorI
const auto GltfAccessor = GltfModel.GetAccessor(AccessorId);
const auto GltfView = GltfModel.GetBufferView(GltfAccessor.GetBufferViewId());
const auto GltfBuffer = GltfModel.GetBuffer(GltfView.GetBufferId());
const auto* pSrcData = GltfBuffer.GetData(GltfAccessor.GetByteOffset() + GltfView.GetByteOffset());
const auto SrcCount = GltfAccessor.GetCount();
const auto SrcByteStride = GltfAccessor.GetByteStride(GltfView);
const auto* pSrcData = SrcCount > 0 ?
GltfBuffer.GetData(GltfAccessor.GetByteOffset() + GltfView.GetByteOffset()) :
nullptr;

struct GltfDataInfo
{
Expand Down

0 comments on commit 82e85c9

Please sign in to comment.