dynpip files

This commit is contained in:
h4570
2022-07-18 22:42:14 +02:00
parent 95c01afa01
commit a5e1a28164
38 changed files with 481 additions and 182 deletions
@@ -0,0 +1,24 @@
/*
# ______ ____ ___
# | \/ ____| |___|
# | | | \ | |
#-----------------------------------------------------------------------
# Copyright 2022, tyra - https://github.com/h4570/tyra
# Licenced under Apache License 2.0
# Sandro Sobczyński <sandro.sobczynski@gmail.com>
*/
#pragma once
namespace Tyra {
enum DynPipProgramName {
DynPipUndefinedProgram,
DynPipColor,
DynPipDirLights,
DynPipTextureDirLights,
DynPipTextureColor,
};
} // namespace Tyra
@@ -0,0 +1,37 @@
/*
# ______ ____ ___
# | \/ ____| |___|
# | | | \ | |
#-----------------------------------------------------------------------
# Copyright 2022, tyra - https://github.com/h4570/tyra
# Licenced under Apache License 2.0
# Sandro Sobczyński <sandro.sobczynski@gmail.com>
*/
#pragma once
#include "debug/debug.hpp"
#include "renderer/core/paths/path1/vu1_program.hpp"
#include "./programs/dynpip_c_vu1_program.hpp"
#include "./programs/dynpip_d_vu1_program.hpp"
#include "./programs/dynpip_td_vu1_program.hpp"
#include "./programs/dynpip_tc_vu1_program.hpp"
namespace Tyra {
class DynPipProgramsRepository {
public:
DynPipProgramsRepository();
~DynPipProgramsRepository();
DynPipVU1Program* getProgram(const DynPipProgramName& name);
private:
DynPipCVU1Program color;
DynPipDVU1Program dirLights;
DynPipTDVU1Program textureDirLights;
DynPipTCVU1Program textureColor;
};
} // namespace Tyra
@@ -0,0 +1,21 @@
/*
# ______ ____ ___
# | \/ ____| |___|
# | | | \ | |
#-----------------------------------------------------------------------
# Copyright 2022, tyra - https://github.com/h4570/tyra
# Licenced under Apache License 2.0
# Sandro Sobczyński <sandro.sobczynski@gmail.com>
*/
#pragma once
namespace Tyra {
class DynPipQBuffer {
public:
DynPipQBuffer();
~DynPipQBuffer();
};
} // namespace Tyra
@@ -0,0 +1,50 @@
/*
# ______ ____ ___
# | \/ ____| |___|
# | | | \ | |
#-----------------------------------------------------------------------
# Copyright 2022, tyra - https://github.com/h4570/tyra
# Licenced under Apache License 2.0
# Sandro Sobczyński <sandro.sobczynski@gmail.com>
*/
#pragma once
#include "./dynpip_program_name.hpp"
#include "renderer/core/paths/path1/vu1_program.hpp"
#include "./programs/dynpip_vu1_shared_defines.h"
#include "./dynpip_qbuffer.hpp"
namespace Tyra {
class DynPipVU1Program : public VU1Program {
public:
DynPipVU1Program(const DynPipProgramName& name, u32* start, u32* end,
const u32& t_reglist, const u8& t_reglistCount,
const u8& t_elementsPerVertex);
~DynPipVU1Program();
u32& getReglist();
const DynPipProgramName& getName() const;
u16 getMaxVertCount(const bool& singleColorEnabled,
const u16& vu1DBufferSize) const;
void addBufferDataToPacket(packet2_t* packet, DynPipQBuffer* buffer,
prim_t* prim);
protected:
DynPipProgramName name;
u8 reglistCount, elementsPerVertex;
u32 destinationAddress, reglist;
virtual void addProgramQBufferDataToPacket(packet2_t* packet,
DynPipQBuffer* qbuffer) const = 0;
private:
void addStandardBufferDataToPacket(packet2_t* packet, DynPipQBuffer* buffer,
prim_t* prim);
};
} // namespace Tyra
@@ -0,0 +1,29 @@
/*
# ______ ____ ___
# | \/ ____| |___|
# | | | \ | |
#-----------------------------------------------------------------------
# Copyright 2022, tyra - https://github.com/h4570/tyra
# Licenced under Apache License 2.0
# Sandro Sobczyński <sandro.sobczynski@gmail.com>
*/
#pragma once
#include <packet2_utils.h>
#include <string>
#include "../dynpip_vu1_program.hpp"
namespace Tyra {
class DynPipCVU1Program : public DynPipVU1Program {
public:
DynPipCVU1Program();
~DynPipCVU1Program();
std::string getStringName() const;
void addProgramQBufferDataToPacket(packet2_t* packet,
DynPipQBuffer* qbuffer) const;
};
} // namespace Tyra
@@ -0,0 +1,29 @@
/*
# ______ ____ ___
# | \/ ____| |___|
# | | | \ | |
#-----------------------------------------------------------------------
# Copyright 2022, tyra - https://github.com/h4570/tyra
# Licenced under Apache License 2.0
# Sandro Sobczyński <sandro.sobczynski@gmail.com>
*/
#pragma once
#include <packet2_utils.h>
#include <string>
#include "../dynpip_vu1_program.hpp"
namespace Tyra {
class DynPipDVU1Program : public DynPipVU1Program {
public:
DynPipDVU1Program();
~DynPipDVU1Program();
std::string getStringName() const;
void addProgramQBufferDataToPacket(packet2_t* packet,
DynPipQBuffer* qbuffer) const;
};
} // namespace Tyra
@@ -0,0 +1,29 @@
/*
# ______ ____ ___
# | \/ ____| |___|
# | | | \ | |
#-----------------------------------------------------------------------
# Copyright 2022, tyra - https://github.com/h4570/tyra
# Licenced under Apache License 2.0
# Sandro Sobczyński <sandro.sobczynski@gmail.com>
*/
#pragma once
#include <packet2_utils.h>
#include <string>
#include "../dynpip_vu1_program.hpp"
namespace Tyra {
class DynPipTCVU1Program : public DynPipVU1Program {
public:
DynPipTCVU1Program();
~DynPipTCVU1Program();
std::string getStringName() const;
void addProgramQBufferDataToPacket(packet2_t* packet,
DynPipQBuffer* qbuffer) const;
};
} // namespace Tyra
@@ -0,0 +1,29 @@
/*
# ______ ____ ___
# | \/ ____| |___|
# | | | \ | |
#-----------------------------------------------------------------------
# Copyright 2022, tyra - https://github.com/h4570/tyra
# Licenced under Apache License 2.0
# Sandro Sobczyński <sandro.sobczynski@gmail.com>
*/
#pragma once
#include <packet2_utils.h>
#include <string>
#include "../dynpip_vu1_program.hpp"
namespace Tyra {
class DynPipTDVU1Program : public DynPipVU1Program {
public:
DynPipTDVU1Program();
~DynPipTDVU1Program();
std::string getStringName() const;
void addProgramQBufferDataToPacket(packet2_t* packet,
DynPipQBuffer* qbuffer) const;
};
} // namespace Tyra
@@ -0,0 +1,24 @@
//
// ______ ____ ___
// | \/ ____| |___|
// | | | \ | |
//-----------------------------------------------------------------------
// Copyright 2022, tyra - https://github.com/h4570/tyra
// Licenced under Apache License 2.0
// Sandro Sobczyński <sandro.sobczynski@gmail.com>
//
// Updated once per mesh
// #define VU1_MVP_MATRIX_ADDR 0
// #define VU1_LIGHTS_MATRIX_ADDR 4
// #define VU1_SINGLE_COLOR_ADDR 7
// #define VU1_OPTIONS_ADDR 8
// #define VU1_LOD_ADDR 9
// #define VU1_CLUT_ADDR 10
// #define VU1_LIGHTS_DIRS_ADDR 11
// #define VU1_LIGHTS_COLORS_ADDR 14
// #define VU1_SET_GIFTAG_ADDR 18
// #define VU1_LAST_ITEM_ADDR 18
// Buffer data (xtop)
// #define VU1_VERT_DATA_ADDR 2
@@ -18,7 +18,7 @@
#include "../../mcpip_block.hpp"
#include "../../data/mcpip_block_data.hpp"
#include "./mcpip_vu1_as_is_shared_defines.h"
#include "renderer/core/paths/path1/clipper/path1_ee_clip_algorithm.hpp"
#include "renderer/core/3d/clipper/ee_clip_algorithm.hpp"
namespace Tyra {
@@ -27,8 +27,8 @@ class McpipClip {
McpipClip();
~McpipClip();
Path1EEClipAlgorithm algorithm;
Path1EEClipAlgorithmSettings algoSettings;
EEClipAlgorithm algorithm;
EEClipAlgorithmSettings algoSettings;
void init(RendererCore* core, McpipBlockData* t_singleBlockData,
McpipBlockData* t_multiBlockData);
@@ -48,16 +48,14 @@ class McpipClip {
packet2_t* staticPacket;
u16 vu1DBufferSize;
std::vector<Path1ClipVertex> clippedTriangle;
std::vector<Path1ClipVertex> inputTriangle;
std::vector<EEClipVertex> clippedTriangle;
std::vector<EEClipVertex> inputTriangle;
Vec4 vertexBuffers[2][108];
Vec4 texCoordBuffers[2][108];
void addCorrections(std::vector<Path1ClipVertex>* vertices,
McpipBlock* block);
void moveDataToBuffer(std::vector<Path1ClipVertex>* vertices,
const u8& context);
void addCorrections(std::vector<EEClipVertex>* vertices, McpipBlock* block);
void moveDataToBuffer(std::vector<EEClipVertex>* vertices, const u8& context);
void addDataToPacket(packet2_t* packet, const u8& context, McpipBlock* block,
const int& count,
RendererCoreTextureBuffers* texBuffers);
@@ -12,7 +12,7 @@
#include "renderer/core/3d/bbox/core_bbox.hpp"
#include "renderer/core/3d/renderer_3d_frustum_planes.hpp"
#include "renderer/core/paths/path1/clipper/path1_ee_clip_algorithm.hpp"
#include "renderer/core/3d/clipper/ee_clip_algorithm.hpp"
#include "./stapip_bag_packages_bbox.hpp"
#include "./stapip_bag_package.hpp"
#include "../stapip_bag.hpp"
@@ -14,7 +14,7 @@
#include "debug/debug.hpp"
#include "./stapip_qbuffer.hpp"
#include "renderer/renderer_settings.hpp"
#include "renderer/core/paths/path1/clipper/path1_ee_clip_algorithm.hpp"
#include "renderer/core/3d/clipper/ee_clip_algorithm.hpp"
namespace Tyra {
@@ -36,11 +36,11 @@ class StaPipClipper {
private:
u32 maxVertCount;
Path1EEClipAlgorithm algorithm;
EEClipAlgorithm algorithm;
M4x4* mvp;
void perspectiveDivide(std::vector<Path1ClipVertex>* vertices);
void moveDataToBuffer(const std::vector<Path1ClipVertex>& vertices,
void perspectiveDivide(std::vector<EEClipVertex>* vertices);
void moveDataToBuffer(const std::vector<EEClipVertex>& vertices,
StaPipQBuffer* buffer);
};
@@ -13,7 +13,7 @@
namespace Tyra {
enum StaPipProgramName {
StdipUndefinedProgram,
StaPipUndefinedProgram,
StaPipCullColor,
StaPipAsIsColor,
@@ -23,8 +23,6 @@
#include "./programs/cull/stapip_cull_td_vu1_program.hpp"
#include "./programs/cull/stapip_cull_tc_vu1_program.hpp"
#include "renderer/core/paths/path1/programs/draw_finish/vu1_draw_finish.hpp"
namespace Tyra {
class StaPipProgramsRepository {
@@ -37,13 +35,12 @@ class StaPipProgramsRepository {
private:
StaPipAsIsCVU1Program asIsColor;
StaPipCullCVU1Program cullColor;
StaPipAsIsDVU1Program asIsLightingColor;
StaPipCullDVU1Program cullLightingColor;
StaPipAsIsTDVU1Program asIsLightingTextureColor;
StaPipCullTDVU1Program cullLightingTextureColor;
StaPipAsIsDVU1Program asIsDirLights;
StaPipCullDVU1Program cullDirLights;
StaPipAsIsTDVU1Program asIsTextureDirLights;
StaPipCullTDVU1Program cullTextureDirLights;
StaPipAsIsTCVU1Program asIsTextureColor;
StaPipCullTCVU1Program cullTextureColor;
VU1DrawFinish drawFinish;
};
} // namespace Tyra