From 5b98603c16a823213de245e58f83b94164dedb80 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Wed, 18 Dec 2024 18:38:47 +0100 Subject: [PATCH] Fix incorrect vertex layout stride calculation --- Source/Engine/Graphics/Shaders/GPUVertexLayout.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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++)