From efdec2c52eee0a0f8edae5d133e49fadabfbb3df Mon Sep 17 00:00:00 2001 From: h4570 Date: Mon, 18 Jul 2022 23:01:12 +0200 Subject: [PATCH] max vert count --- .../pipeline/dynamic/dynpip_vu1_program.cpp | 27 +++++++++---------- .../static/core/stapip_vu1_program.cpp | 2 +- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/engine/src/renderer/3d/pipeline/dynamic/dynpip_vu1_program.cpp b/engine/src/renderer/3d/pipeline/dynamic/dynpip_vu1_program.cpp index dee0843..958a012 100644 --- a/engine/src/renderer/3d/pipeline/dynamic/dynpip_vu1_program.cpp +++ b/engine/src/renderer/3d/pipeline/dynamic/dynpip_vu1_program.cpp @@ -63,24 +63,21 @@ void DynPipVU1Program::addStandardBufferDataToPacket(packet2_t* packet, u16 DynPipVU1Program::getMaxVertCount(const bool& singleColorEnabled, const u16& bufferSize) const { - return 0; // TODO + u16 res = bufferSize - 4; + u8 colorElementsPerVertex = + singleColorEnabled ? (elementsPerVertex - 1) : elementsPerVertex; + res /= (colorElementsPerVertex + reglistCount); - // u16 res = bufferSize - 4; - // u8 colorElementsPerVertex = - // singleColorEnabled ? (elementsPerVertex - 1) : elementsPerVertex; - // res /= (colorElementsPerVertex + reglistCount); + // Buffer size = VU1 double buffer size (xtop) + // QBufferSize = res (it is placed inside VU1) - // // Buffer size = VU1 double buffer size (xtop) - // // res = qbuffer size (directly inside VU1) + // Animation = 2 verts for final vert + res = res / 2; - // // Must be dividable by 3 and the result also dividable by 3. Why? - // // 1st dividable reason - triangle, and packaging system in 3d rendering - // // 2nd dividable reason - subpackaging system. We are splitting packages - // into - // // 3 subpackages in 3d renderer. - // res = res / 3 / 3; - // res = res * 3 * 3; - // return res; + // Triangle = 3 verts + res = res / 3; + res = res * 3; + return res; } } // namespace Tyra diff --git a/engine/src/renderer/3d/pipeline/static/core/stapip_vu1_program.cpp b/engine/src/renderer/3d/pipeline/static/core/stapip_vu1_program.cpp index cceea14..04305ef 100644 --- a/engine/src/renderer/3d/pipeline/static/core/stapip_vu1_program.cpp +++ b/engine/src/renderer/3d/pipeline/static/core/stapip_vu1_program.cpp @@ -69,7 +69,7 @@ u16 StaPipVU1Program::getMaxVertCount(const bool& singleColorEnabled, res /= (colorElementsPerVertex + reglistCount); // Buffer size = VU1 double buffer size (xtop) - // res = qbuffer size (directly inside VU1) + // QBufferSize = res (it is placed inside VU1) // Must be dividable by 3 and the result also dividable by 3. Why? // 1st dividable reason - triangle, and packaging system in 3d rendering