spamming with multiple buffers to vu1
This commit is contained in:
@@ -23,18 +23,9 @@ class MeshFrame {
|
||||
~MeshFrame();
|
||||
|
||||
const u32& getId() const { return id; }
|
||||
const u32& getVertexCount() const { return vertexCount; }
|
||||
const u32& getTextureCoordsCount() const { return textureCoordsCount; }
|
||||
const u32& getNormalsCount() const { return normalsCount; }
|
||||
const u32& getColorsCount() const { return colorsCount; }
|
||||
const u8& isMother() const { return _isMother; }
|
||||
const BBox& getBBox() const { return *bbox; }
|
||||
|
||||
Vec4* getVertices() const { return vertices; }
|
||||
Vec4* getNormals() const { return normals; }
|
||||
Vec4* getTextureCoords() const { return textureCoords; }
|
||||
Color* getColors() const { return colors; }
|
||||
|
||||
void print() const;
|
||||
void print(const char* name) const;
|
||||
void print(const std::string& name) const { print(name.c_str()); }
|
||||
@@ -43,9 +34,7 @@ class MeshFrame {
|
||||
private:
|
||||
u8 _isMother;
|
||||
BBox* bbox;
|
||||
u32 id, vertexCount, textureCoordsCount, normalsCount, colorsCount;
|
||||
Vec4 *vertices, *textureCoords, *normals;
|
||||
Color* colors;
|
||||
u32 id;
|
||||
};
|
||||
|
||||
} // namespace Tyra
|
||||
|
||||
@@ -22,18 +22,18 @@ class MeshMaterial {
|
||||
explicit MeshMaterial(const MeshMaterial& material);
|
||||
~MeshMaterial();
|
||||
|
||||
Color singleColor;
|
||||
Color color;
|
||||
|
||||
const u32& getId() const { return id; }
|
||||
const std::string& getName() const { return _name; }
|
||||
const u32& getFacesCount() const { return facesCount; }
|
||||
const u8& isMother() const { return _isMother; }
|
||||
const u8& isSingleColorActivated() const { return singleColorFlag; }
|
||||
u32* getVertexFaces() const { return vertexFaces; }
|
||||
u32* getTextureCoordFaces() const { return textureCoordFaces; }
|
||||
u32* getNormalFaces() const { return normalFaces; }
|
||||
u32* getColorFaces() const { return normalFaces; }
|
||||
MeshMaterialFrame* getFrames() const { return *frames; }
|
||||
const u32& getFramesCount() const { return framesCount; }
|
||||
const u8& isSingleColorActivated() const {
|
||||
return singleColorFlag;
|
||||
} // TODO: colormode -> color / lightmap
|
||||
|
||||
MeshMaterialFrame** getFrames() const { return frames; }
|
||||
MeshMaterialFrame* getFrame(const u32& i) const { return frames[i]; }
|
||||
|
||||
const BBox& getBBox(const u32& frame) const;
|
||||
void setSingleColorFlag(const u8& flag);
|
||||
@@ -48,8 +48,7 @@ class MeshMaterial {
|
||||
|
||||
std::string _name;
|
||||
u8 _isMother, singleColorFlag;
|
||||
u32 id, facesCount, framesCount;
|
||||
u32 *vertexFaces, *textureCoordFaces, *normalFaces, *colorFaces;
|
||||
u32 id, framesCount;
|
||||
};
|
||||
|
||||
} // namespace Tyra
|
||||
|
||||
@@ -26,11 +26,33 @@ class MeshMaterialFrame {
|
||||
const u8& isMother() const { return _isMother; }
|
||||
const BBox& getBBox() const { return *bbox; }
|
||||
|
||||
const u32& getVertexCount() const { return vertexCount; }
|
||||
Vec4* getVertices() const { return vertices; }
|
||||
Vec4* getNormals() const { return normals; }
|
||||
Vec4* getTextureCoords() const { return textureCoords; }
|
||||
Color* getColors() const { return colors; }
|
||||
|
||||
void print() const;
|
||||
void print(const char* name) const;
|
||||
void print(const std::string& name) const { print(name.c_str()); }
|
||||
std::string getPrint(const char* name = nullptr) const;
|
||||
|
||||
private:
|
||||
void allocateVertices(const MeshBuilderData& data, const u32& frameIndex,
|
||||
const u32& materialIndex);
|
||||
void allocateTextureCoords(const MeshBuilderData& data, const u32& frameIndex,
|
||||
const u32& materialIndex);
|
||||
void allocateNormals(const MeshBuilderData& data, const u32& frameIndex,
|
||||
const u32& materialIndex);
|
||||
void allocateColors(const MeshBuilderData& data, const u32& frameIndex,
|
||||
const u32& materialIndex);
|
||||
|
||||
BBox* bbox;
|
||||
|
||||
u8 _isMother;
|
||||
u32 id;
|
||||
u32 id, vertexCount;
|
||||
Vec4 *vertices, *textureCoords, *normals;
|
||||
Color* colors;
|
||||
};
|
||||
|
||||
} // namespace Tyra
|
||||
|
||||
@@ -36,6 +36,9 @@ class DynPipCore {
|
||||
*/
|
||||
void initParts(DynPipBag* data);
|
||||
|
||||
// TODO: TEST!
|
||||
void renderTEST(DynPipBag** bags, const u32& count);
|
||||
|
||||
/** Render 3D via "bags" */
|
||||
void renderPart(DynPipBag* data, const bool& frustumCull = true);
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@ class DynPipRenderer {
|
||||
RendererCoreTextureBuffers* texBuffers) const;
|
||||
|
||||
void render(DynPipBag* bag);
|
||||
void renderTEST(DynPipBag** bags, const u32& count);
|
||||
|
||||
void clearLastProgramName();
|
||||
|
||||
@@ -40,6 +41,8 @@ class DynPipRenderer {
|
||||
void uploadPrograms();
|
||||
void setDoubleBuffer();
|
||||
|
||||
void addBufferDataToPacketTEST(DynPipVU1Program* program, DynPipBag** bags,
|
||||
const u32& count);
|
||||
void addBufferDataToPacket(DynPipVU1Program* program, DynPipBag* bag);
|
||||
void sendPacket();
|
||||
|
||||
|
||||
@@ -40,21 +40,24 @@ class DynamicPipeline : public Renderer3DPipeline {
|
||||
RendererCore* rendererCore;
|
||||
Vec4* colorsCache;
|
||||
|
||||
void addVertices(DynamicMesh* mesh, MeshMaterial* material, DynPipBag* bag,
|
||||
MeshFrame* frameFrom, MeshFrame* frameTo,
|
||||
void addVertices(MeshMaterialFrame* materialFrameFrom,
|
||||
MeshMaterialFrame* materialFrameTo, DynPipBag* bag,
|
||||
const u32& startIndex) const;
|
||||
|
||||
PipelineInfoBag* getInfoBag(DynamicMesh* mesh, const DynPipOptions* options,
|
||||
M4x4* model) const;
|
||||
|
||||
DynPipColorBag* getColorBag(MeshMaterial* material) const;
|
||||
DynPipTextureBag* getTextureBag(DynamicMesh* mesh, MeshMaterial* material,
|
||||
MeshFrame* frameFrom, MeshFrame* frameTo,
|
||||
const u32& count, const u32& startIndex);
|
||||
DynPipLightingBag* getLightingBag(DynamicMesh* mesh, MeshMaterial* material,
|
||||
M4x4* model, MeshFrame* frameFrom,
|
||||
MeshFrame* frameTo,
|
||||
const DynPipOptions* options,
|
||||
|
||||
DynPipTextureBag* getTextureBag(MeshMaterial* material,
|
||||
MeshMaterialFrame* materialFrameFrom,
|
||||
MeshMaterialFrame* materialFrameTo,
|
||||
const u32& startIndex);
|
||||
|
||||
DynPipLightingBag* getLightingBag(MeshMaterialFrame* materialFrameFrom,
|
||||
MeshMaterialFrame* materialFrameTo,
|
||||
M4x4* model, const DynPipOptions* options,
|
||||
PipelineDirLightsBag* dirLightsBag,
|
||||
const u32& count,
|
||||
const u32& startIndex) const;
|
||||
|
||||
void setLightingColorsCache(PipelineLightingOptions* lightingOptions);
|
||||
|
||||
@@ -41,18 +41,21 @@ class StaticPipeline : public Renderer3DPipeline {
|
||||
RendererCore* rendererCore;
|
||||
Vec4* colorsCache;
|
||||
|
||||
void addVertices(DynamicMesh* mesh, MeshMaterial* material, StaPipBag* bag,
|
||||
MeshFrame* frameFrom, MeshFrame* frameTo) const;
|
||||
void addVertices(MeshMaterialFrame* materialFrame, StaPipBag* bag) const;
|
||||
|
||||
PipelineInfoBag* getInfoBag(DynamicMesh* mesh, const StaPipOptions* options,
|
||||
M4x4* model) const;
|
||||
StaPipColorBag* getColorBag(DynamicMesh* mesh, MeshMaterial* material,
|
||||
MeshFrame* frameFrom, MeshFrame* frameTo) const;
|
||||
StaPipTextureBag* getTextureBag(DynamicMesh* mesh, MeshMaterial* material,
|
||||
MeshFrame* frameFrom, MeshFrame* frameTo);
|
||||
StaPipLightingBag* getLightingBag(DynamicMesh* mesh, MeshMaterial* material,
|
||||
M4x4* model, MeshFrame* frameFrom,
|
||||
MeshFrame* frameTo,
|
||||
|
||||
StaPipColorBag* getColorBag(MeshMaterial* material,
|
||||
MeshMaterialFrame* materialFrame) const;
|
||||
|
||||
StaPipTextureBag* getTextureBag(MeshMaterial* material,
|
||||
MeshMaterialFrame* materialFrame);
|
||||
|
||||
StaPipLightingBag* getLightingBag(MeshMaterialFrame* materialFrame,
|
||||
M4x4* model,
|
||||
const StaPipOptions* options) const;
|
||||
|
||||
void deallocDrawBags(StaPipBag* bag, MeshMaterial* material) const;
|
||||
|
||||
void setLightingColorsCache(PipelineLightingOptions* lightingOptions);
|
||||
|
||||
Reference in New Issue
Block a user