vu1 packet spamming in static pipeline
This commit is contained in:
@@ -27,7 +27,7 @@ class StaPipCore {
|
||||
void init(RendererCore* t_core);
|
||||
|
||||
/** Render 3D via "bags" */
|
||||
void render(StaPipBag* data, StaPipBagPackagesBBox* bbox = nullptr);
|
||||
void render(StaPipBag* bag, StaPipBagPackagesBBox* bbox = nullptr);
|
||||
|
||||
/** Get max vert count of VU1 qbuffer (for optimizations) */
|
||||
u32 getMaxVertCountByParams(const bool& isSingleColor,
|
||||
|
||||
@@ -54,6 +54,8 @@ class StaPipQBufferRenderer {
|
||||
/** Slower render with clipping */
|
||||
void clip(StaPipQBuffer* buffer);
|
||||
|
||||
void flushBuffers();
|
||||
|
||||
void clearLastProgramName();
|
||||
|
||||
StaPipVU1Program* getCullProgramByBag(const StaPipBag* bag);
|
||||
@@ -64,22 +66,30 @@ class StaPipQBufferRenderer {
|
||||
const u16& getBufferSize() { return bufferSize; }
|
||||
|
||||
private:
|
||||
bool is1stDBufferFlushTime();
|
||||
bool is2ndDBufferFlushTime();
|
||||
|
||||
void sendStaticData() const;
|
||||
void setProgramsCache();
|
||||
void uploadPrograms();
|
||||
void setDoubleBuffer();
|
||||
u16 getQBufferIndex(StaPipQBuffer* buffer);
|
||||
|
||||
static const u16 buffersCount;
|
||||
|
||||
StaPipVU1Program* getProgramByName(const StaPipProgramName& name);
|
||||
void addBufferDataToPacket(StaPipVU1Program* program, StaPipQBuffer* buffer);
|
||||
void addBufferDataToPacket(StaPipQBuffer** buffers, const u32& count);
|
||||
void sendPacket();
|
||||
StaPipVU1Program* getAsIsProgramByBag(const StaPipBag* bag);
|
||||
StaPipVU1Program* getCullProgramByType(const StaPipProgramType& programType);
|
||||
StaPipProgramType getDrawProgramTypeByBag(const StaPipBag* bag) const;
|
||||
StaPipProgramType getDrawProgramTypeByParams(
|
||||
const bool& isLightingEnabled, const bool& isTextureEnabled) const;
|
||||
packet2_t* packets[2];
|
||||
packet2_t* programsPacket;
|
||||
StaPipQBuffer buffers[2];
|
||||
|
||||
packet2_t** packets;
|
||||
StaPipVU1Program** programs; // dbuffer
|
||||
StaPipQBuffer** buffers;
|
||||
packet2_t* currentPacket;
|
||||
packet2_t* staticDataPacket;
|
||||
packet2_t* objectDataPacket;
|
||||
@@ -91,7 +101,7 @@ class StaPipQBufferRenderer {
|
||||
StaPipClipper clipper;
|
||||
StaPipProgramsRepository repository;
|
||||
|
||||
u16 bufferSize;
|
||||
u16 bufferSize, nextBufferIndex, currentBufferIndex;
|
||||
u8 context;
|
||||
};
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
#include "../renderer_3d_pipeline.hpp"
|
||||
#include "../shared/pipeline_lighting_options.hpp"
|
||||
#include "renderer/core/renderer_core.hpp"
|
||||
#include "renderer/3d/mesh/dynamic/dynamic_mesh.hpp"
|
||||
#include "renderer/3d/mesh/static/static_mesh.hpp"
|
||||
#include "./core/stapip_core.hpp"
|
||||
#include "./stapip_options.hpp"
|
||||
|
||||
@@ -43,7 +43,7 @@ class StaticPipeline : public Renderer3DPipeline {
|
||||
* Render static model
|
||||
* This render() method is a bridge to core.render() method.
|
||||
*/
|
||||
void render(DynamicMesh* mesh, const StaPipOptions* options = nullptr);
|
||||
void render(StaticMesh* mesh, const StaPipOptions* options = nullptr);
|
||||
|
||||
private:
|
||||
RendererCore* rendererCore;
|
||||
@@ -51,7 +51,7 @@ class StaticPipeline : public Renderer3DPipeline {
|
||||
|
||||
void addVertices(MeshMaterialFrame* materialFrame, StaPipBag* bag) const;
|
||||
|
||||
PipelineInfoBag* getInfoBag(DynamicMesh* mesh, const StaPipOptions* options,
|
||||
PipelineInfoBag* getInfoBag(StaticMesh* mesh, const StaPipOptions* options,
|
||||
M4x4* model) const;
|
||||
|
||||
StaPipColorBag* getColorBag(MeshMaterial* material,
|
||||
|
||||
Reference in New Issue
Block a user