From 7a99a9df2eb97a218a4a0cfb1b3b84ec2d1cc5d1 Mon Sep 17 00:00:00 2001 From: Weixie Cui Date: Sat, 28 Mar 2026 14:38:00 +0800 Subject: [PATCH] Fix DrawLayer::AllocateBatch minVtxCount clamp BF_MAX was incorrectly applied to minIdxCount when sizing the vertex batch; use minVtxCount so the minimum vertex requirement is respected. --- BeefySysLib/gfx/DrawLayer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BeefySysLib/gfx/DrawLayer.cpp b/BeefySysLib/gfx/DrawLayer.cpp index ea489ea0a..0881fb591 100644 --- a/BeefySysLib/gfx/DrawLayer.cpp +++ b/BeefySysLib/gfx/DrawLayer.cpp @@ -194,7 +194,7 @@ DrawBatch* DrawLayer::AllocateBatch(int minVtxCount, int minIdxCount) int vtxSize = mRenderDevice->mCurRenderState->mShader->mVertexSize; minIdxCount = BF_MAX(minIdxCount, 512); - minVtxCount = BF_MAX(minIdxCount, 512); + minVtxCount = BF_MAX(minVtxCount, 512); BF_ASSERT(minIdxCount * sizeof(uint16) <= DRAWBUFFER_IDXBUFFER_SIZE); BF_ASSERT(minVtxCount * vtxSize <= DRAWBUFFER_VTXBUFFER_SIZE);