From 1c49d5718c33acccd19933de454ef9a92962c9fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Mon, 2 Oct 2023 16:03:49 +0200 Subject: [PATCH] Add an offset field that we'll need later --- GPU/Common/DrawEngineCommon.cpp | 3 ++- GPU/Common/DrawEngineCommon.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/GPU/Common/DrawEngineCommon.cpp b/GPU/Common/DrawEngineCommon.cpp index d8220720bc..dfe127fa3e 100644 --- a/GPU/Common/DrawEngineCommon.cpp +++ b/GPU/Common/DrawEngineCommon.cpp @@ -718,6 +718,7 @@ void DrawEngineCommon::SubmitPrim(const void *verts, const void *inds, GEPrimiti di.cullMode = cullMode; di.vertexCount = vertexCount; di.vertDecodeIndex = numDrawVerts_; + di.offset = 0; _dbg_assert_(numDrawVerts_ <= MAX_DEFERRED_DRAW_VERTS); _dbg_assert_(numDrawInds_ <= MAX_DEFERRED_DRAW_INDS); @@ -782,7 +783,7 @@ void DrawEngineCommon::DecodeInds() { for (; i < numDrawInds_; i++) { const DeferredInds &di = drawInds_[i]; - int indexOffset = drawVertexOffsets_[di.vertDecodeIndex]; + int indexOffset = drawVertexOffsets_[di.vertDecodeIndex] + di.offset; bool clockwise = true; if (gstate.isCullEnabled() && gstate.getCullMode() != di.cullMode) { clockwise = false; diff --git a/GPU/Common/DrawEngineCommon.h b/GPU/Common/DrawEngineCommon.h index d299c3d7de..f53988700f 100644 --- a/GPU/Common/DrawEngineCommon.h +++ b/GPU/Common/DrawEngineCommon.h @@ -228,6 +228,7 @@ protected: u8 indexType; s8 prim; u8 cullMode; + u16 offset; }; enum { MAX_DEFERRED_DRAW_VERTS = 128 }; // If you change this to more than 256, change type of DeferredInds::vertDecodeIndex.