diff --git a/Source/Engine/Graphics/Shaders/GPUVertexLayout.cpp b/Source/Engine/Graphics/Shaders/GPUVertexLayout.cpp index 996a177c2..880dc1f00 100644 --- a/Source/Engine/Graphics/Shaders/GPUVertexLayout.cpp +++ b/Source/Engine/Graphics/Shaders/GPUVertexLayout.cpp @@ -83,7 +83,8 @@ void GPUVertexLayout::SetElements(const Elements& elements, uint32 offsets[GPU_M for (int32 i = 0; i < elements.Count(); i++) { const VertexElement& e = elements[i]; - strides[e.Slot] = Math::Max(strides[e.Slot], offsets[i]); + ASSERT(e.Slot < GPU_MAX_VB_BINDED); + strides[e.Slot] = Math::Max(strides[e.Slot], offsets[e.Slot]); } _stride = 0; for (int32 i = 0; i < GPU_MAX_VB_BINDED; i++)