Add an offset field that we'll need later

This commit is contained in:
Henrik Rydgård 2023-10-02 16:03:49 +02:00
parent 92ffef2626
commit 1c49d5718c
2 changed files with 3 additions and 1 deletions

View File

@ -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;

View File

@ -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.