std pipeline rename
This commit is contained in:
+8
-8
@@ -10,17 +10,17 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "../stdpip_bag.hpp"
|
||||
#include "../stapip_bag.hpp"
|
||||
#include "renderer/core/3d/bbox/core_bbox_frustum.hpp"
|
||||
|
||||
namespace Tyra {
|
||||
|
||||
class StdpipBagPackage {
|
||||
class StapipBagPackage {
|
||||
public:
|
||||
StdpipBagPackage();
|
||||
~StdpipBagPackage();
|
||||
StapipBagPackage();
|
||||
~StapipBagPackage();
|
||||
|
||||
StdpipBag* bag;
|
||||
StapipBag* bag;
|
||||
|
||||
Vec4* vertices;
|
||||
Vec4* sts;
|
||||
@@ -32,12 +32,12 @@ class StdpipBagPackage {
|
||||
CoreBBoxFrustum isInFrustum;
|
||||
|
||||
/**
|
||||
* We are creating StdpipBagPackagesBBox which checks CoreBBoxBBox for every
|
||||
* We are creating StapipBagPackagesBBox which checks CoreBBoxBBox for every
|
||||
* maxVertCount / 3. So this variable is index of starting
|
||||
* StdpipBagPackagesBBox's CoreBBoxBBox. If package have <= maxVertCount / 3
|
||||
* StapipBagPackagesBBox's CoreBBoxBBox. If package have <= maxVertCount / 3
|
||||
* verts, we will need only single (starting) bbox. if package have
|
||||
* maxVertCount verts, we will calculate CoreBBoxBBox from 3
|
||||
* StdpipBagPackagesBBox's bboxes.
|
||||
* StapipBagPackagesBBox's bboxes.
|
||||
*/
|
||||
u32 indexOf1By3BBox;
|
||||
|
||||
+11
-11
@@ -13,19 +13,19 @@
|
||||
#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 "./stdpip_bag_packages_bbox.hpp"
|
||||
#include "./stdpip_bag_package.hpp"
|
||||
#include "../stdpip_bag.hpp"
|
||||
#include "./stapip_bag_packages_bbox.hpp"
|
||||
#include "./stapip_bag_package.hpp"
|
||||
#include "../stapip_bag.hpp"
|
||||
|
||||
namespace Tyra {
|
||||
|
||||
class StdpipBagPackager {
|
||||
class StapipBagPackager {
|
||||
public:
|
||||
StdpipBagPackager();
|
||||
~StdpipBagPackager();
|
||||
StapipBagPackager();
|
||||
~StapipBagPackager();
|
||||
|
||||
void init(Renderer3DFrustumPlanes* frustumPlanes);
|
||||
void setRenderBBox(StdpipBagPackagesBBox* bbox) { renderBBox = bbox; }
|
||||
void setRenderBBox(StapipBagPackagesBBox* bbox) { renderBBox = bbox; }
|
||||
void setMaxVertCount(const u32& count);
|
||||
|
||||
/**
|
||||
@@ -33,20 +33,20 @@ class StdpipBagPackager {
|
||||
*
|
||||
* @param size Max maxVertCount verts (VU1 buffer size)
|
||||
*/
|
||||
StdpipBagPackage* create(u16* o_size, StdpipBag* data, u16 size);
|
||||
StapipBagPackage* create(u16* o_size, StapipBag* data, u16 size);
|
||||
/**
|
||||
* @brief Split render package to smaller packages
|
||||
*
|
||||
* @param size Max maxVertCount verts (VU1 buffer size)
|
||||
*/
|
||||
StdpipBagPackage* create(u16* o_size, const StdpipBagPackage& pkg, u16 size);
|
||||
StapipBagPackage* create(u16* o_size, const StapipBagPackage& pkg, u16 size);
|
||||
|
||||
CoreBBoxFrustum checkFrustum(const StdpipBagPackage& pkg);
|
||||
CoreBBoxFrustum checkFrustum(const StapipBagPackage& pkg);
|
||||
|
||||
private:
|
||||
u32 maxVertCount;
|
||||
Renderer3DFrustumPlanes* frustumPlanes;
|
||||
StdpipBagPackagesBBox* renderBBox;
|
||||
StapipBagPackagesBBox* renderBBox;
|
||||
};
|
||||
|
||||
} // namespace Tyra
|
||||
+4
-4
@@ -18,13 +18,13 @@ namespace Tyra {
|
||||
* Splits all 3D input vertices into 16vert parts and creates child bboxes for
|
||||
* it
|
||||
*/
|
||||
class StdpipBagPackagesBBox {
|
||||
class StapipBagPackagesBBox {
|
||||
public:
|
||||
StdpipBagPackagesBBox(Vec4* t_vertices, u32* t_faces, const u32& t_facesCount,
|
||||
StapipBagPackagesBBox(Vec4* t_vertices, u32* t_faces, const u32& t_facesCount,
|
||||
const u32& t_maxVertCount);
|
||||
StdpipBagPackagesBBox(Vec4* t_vertices, const u32& t_counts,
|
||||
StapipBagPackagesBBox(Vec4* t_vertices, const u32& t_counts,
|
||||
const u32& t_maxVertCount);
|
||||
~StdpipBagPackagesBBox();
|
||||
~StapipBagPackagesBBox();
|
||||
|
||||
void setMaxVertCount(const u32& count);
|
||||
|
||||
+13
-13
@@ -11,12 +11,12 @@
|
||||
#pragma once
|
||||
|
||||
#include "math/vec4.hpp"
|
||||
#include "./stdpip_lighting_bag.hpp"
|
||||
#include "./stdpip_info_bag.hpp"
|
||||
#include "./stdpip_color_bag.hpp"
|
||||
#include "./stdpip_texture_bag.hpp"
|
||||
#include "./stapip_lighting_bag.hpp"
|
||||
#include "./stapip_info_bag.hpp"
|
||||
#include "./stapip_color_bag.hpp"
|
||||
#include "./stapip_texture_bag.hpp"
|
||||
#include "renderer/core/texture/models/texture.hpp"
|
||||
#include "./packaging/stdpip_bag_packages_bbox.hpp"
|
||||
#include "./packaging/stapip_bag_packages_bbox.hpp"
|
||||
|
||||
namespace Tyra {
|
||||
|
||||
@@ -25,16 +25,16 @@ namespace Tyra {
|
||||
* Supports frustum culling, clipping, lighting,
|
||||
* texture and single color / many colors.
|
||||
*/
|
||||
class StdpipBag {
|
||||
class StapipBag {
|
||||
public:
|
||||
StdpipBag();
|
||||
~StdpipBag();
|
||||
StapipBag();
|
||||
~StapipBag();
|
||||
|
||||
/** Mandatory. Object info. */
|
||||
StdpipInfoBag* info;
|
||||
StapipInfoBag* info;
|
||||
|
||||
/** Mandatory. Object color(s). */
|
||||
StdpipColorBag* color;
|
||||
StapipColorBag* color;
|
||||
|
||||
/** Mandatory. Vertex count. */
|
||||
u32 count;
|
||||
@@ -43,15 +43,15 @@ class StdpipBag {
|
||||
Vec4* vertices;
|
||||
|
||||
/** Optional. Texture coordinates and image. */
|
||||
StdpipTextureBag* texture;
|
||||
StapipTextureBag* texture;
|
||||
|
||||
/** Optional. Object lighting. */
|
||||
StdpipLightingBag* lighting;
|
||||
StapipLightingBag* lighting;
|
||||
|
||||
/**
|
||||
* @param maxVertCount This parameter is available in renderer API.
|
||||
*/
|
||||
StdpipBagPackagesBBox calculateBbox(const u32& maxVertCount);
|
||||
StapipBagPackagesBBox calculateBbox(const u32& maxVertCount);
|
||||
|
||||
void print() const;
|
||||
void print(const char* name) const;
|
||||
+3
-3
@@ -17,10 +17,10 @@ namespace Tyra {
|
||||
/**
|
||||
* @brief Color data. At least one color data is required (single/many).
|
||||
*/
|
||||
class StdpipColorBag {
|
||||
class StapipColorBag {
|
||||
public:
|
||||
StdpipColorBag();
|
||||
~StdpipColorBag();
|
||||
StapipColorBag();
|
||||
~StapipColorBag();
|
||||
|
||||
/** Optional. Single color for all vertices. */
|
||||
Color* single;
|
||||
+5
-5
@@ -13,19 +13,19 @@
|
||||
#include <draw.h>
|
||||
#include "math/m4x4.hpp"
|
||||
#include "math/vec4.hpp"
|
||||
#include "../../stdpip_shading_type.hpp"
|
||||
#include "../../stapip_shading_type.hpp"
|
||||
|
||||
namespace Tyra {
|
||||
|
||||
class StdpipInfoBag {
|
||||
class StapipInfoBag {
|
||||
public:
|
||||
StdpipInfoBag();
|
||||
~StdpipInfoBag();
|
||||
StapipInfoBag();
|
||||
~StapipInfoBag();
|
||||
|
||||
/** Mandatory. Model matrix */
|
||||
M4x4* model;
|
||||
|
||||
StdpipShadingType shadingType;
|
||||
StapipShadingType shadingType;
|
||||
bool blendingEnabled;
|
||||
bool antiAliasingEnabled;
|
||||
bool noClipChecks;
|
||||
+5
-5
@@ -16,12 +16,12 @@
|
||||
|
||||
namespace Tyra {
|
||||
|
||||
enum StdpipLightingBagMode { Auto, Manual };
|
||||
enum StapipLightingBagMode { Auto, Manual };
|
||||
|
||||
class StdpipLightingBag {
|
||||
class StapipLightingBag {
|
||||
public:
|
||||
explicit StdpipLightingBag(const bool& manual = false);
|
||||
~StdpipLightingBag();
|
||||
explicit StapipLightingBag(const bool& manual = false);
|
||||
~StapipLightingBag();
|
||||
|
||||
Vec4* normals;
|
||||
M4x4* lightMatrix;
|
||||
@@ -47,7 +47,7 @@ class StdpipLightingBag {
|
||||
void deallocate();
|
||||
void forceDeallocate();
|
||||
u8 isAllocated;
|
||||
StdpipLightingBagMode mode;
|
||||
StapipLightingBagMode mode;
|
||||
|
||||
Vec4* lightColors;
|
||||
Vec4* lightDirections;
|
||||
+3
-3
@@ -15,10 +15,10 @@
|
||||
|
||||
namespace Tyra {
|
||||
|
||||
class StdpipTextureBag {
|
||||
class StapipTextureBag {
|
||||
public:
|
||||
StdpipTextureBag();
|
||||
~StdpipTextureBag();
|
||||
StapipTextureBag();
|
||||
~StapipTextureBag();
|
||||
|
||||
/** Mandatory. Texture coordinates per vertex. */
|
||||
Vec4* coordinates;
|
||||
+5
-5
@@ -12,19 +12,19 @@
|
||||
|
||||
#include <packet2_utils.h>
|
||||
#include <string>
|
||||
#include "../../stdpip_vu1_program.hpp"
|
||||
#include "../../stapip_vu1_program.hpp"
|
||||
|
||||
namespace Tyra {
|
||||
|
||||
class StdpipAsIsCVU1Program : public StdpipVU1Program {
|
||||
class StapipAsIsCVU1Program : public StapipVU1Program {
|
||||
public:
|
||||
StdpipAsIsCVU1Program();
|
||||
~StdpipAsIsCVU1Program();
|
||||
StapipAsIsCVU1Program();
|
||||
~StapipAsIsCVU1Program();
|
||||
|
||||
std::string getStringName() const;
|
||||
|
||||
void addProgramQBufferDataToPacket(packet2_t* packet,
|
||||
StdpipQBuffer* qbuffer) const;
|
||||
StapipQBuffer* qbuffer) const;
|
||||
};
|
||||
|
||||
} // namespace Tyra
|
||||
+5
-5
@@ -12,18 +12,18 @@
|
||||
|
||||
#include <packet2_utils.h>
|
||||
#include <string>
|
||||
#include "../../stdpip_vu1_program.hpp"
|
||||
#include "../../stapip_vu1_program.hpp"
|
||||
|
||||
namespace Tyra {
|
||||
|
||||
class StdpipAsIsDVU1Program : public StdpipVU1Program {
|
||||
class StapipAsIsDVU1Program : public StapipVU1Program {
|
||||
public:
|
||||
StdpipAsIsDVU1Program();
|
||||
~StdpipAsIsDVU1Program();
|
||||
StapipAsIsDVU1Program();
|
||||
~StapipAsIsDVU1Program();
|
||||
|
||||
std::string getStringName() const;
|
||||
void addProgramQBufferDataToPacket(packet2_t* packet,
|
||||
StdpipQBuffer* qbuffer) const;
|
||||
StapipQBuffer* qbuffer) const;
|
||||
};
|
||||
|
||||
} // namespace Tyra
|
||||
+5
-5
@@ -12,18 +12,18 @@
|
||||
|
||||
#include <packet2_utils.h>
|
||||
#include <string>
|
||||
#include "../../stdpip_vu1_program.hpp"
|
||||
#include "../../stapip_vu1_program.hpp"
|
||||
|
||||
namespace Tyra {
|
||||
|
||||
class StdpipAsIsTCVU1Program : public StdpipVU1Program {
|
||||
class StapipAsIsTCVU1Program : public StapipVU1Program {
|
||||
public:
|
||||
StdpipAsIsTCVU1Program();
|
||||
~StdpipAsIsTCVU1Program();
|
||||
StapipAsIsTCVU1Program();
|
||||
~StapipAsIsTCVU1Program();
|
||||
|
||||
std::string getStringName() const;
|
||||
void addProgramQBufferDataToPacket(packet2_t* packet,
|
||||
StdpipQBuffer* qbuffer) const;
|
||||
StapipQBuffer* qbuffer) const;
|
||||
};
|
||||
|
||||
} // namespace Tyra
|
||||
+5
-5
@@ -12,18 +12,18 @@
|
||||
|
||||
#include <packet2_utils.h>
|
||||
#include <string>
|
||||
#include "../../stdpip_vu1_program.hpp"
|
||||
#include "../../stapip_vu1_program.hpp"
|
||||
|
||||
namespace Tyra {
|
||||
|
||||
class StdpipAsIsTDVU1Program : public StdpipVU1Program {
|
||||
class StapipAsIsTDVU1Program : public StapipVU1Program {
|
||||
public:
|
||||
StdpipAsIsTDVU1Program();
|
||||
~StdpipAsIsTDVU1Program();
|
||||
StapipAsIsTDVU1Program();
|
||||
~StapipAsIsTDVU1Program();
|
||||
|
||||
std::string getStringName() const;
|
||||
void addProgramQBufferDataToPacket(packet2_t* packet,
|
||||
StdpipQBuffer* qbuffer) const;
|
||||
StapipQBuffer* qbuffer) const;
|
||||
};
|
||||
|
||||
} // namespace Tyra
|
||||
+5
-5
@@ -12,18 +12,18 @@
|
||||
|
||||
#include <packet2_utils.h>
|
||||
#include <string>
|
||||
#include "../../stdpip_vu1_program.hpp"
|
||||
#include "../../stapip_vu1_program.hpp"
|
||||
|
||||
namespace Tyra {
|
||||
|
||||
class StdpipCullCVU1Program : public StdpipVU1Program {
|
||||
class StapipCullCVU1Program : public StapipVU1Program {
|
||||
public:
|
||||
StdpipCullCVU1Program();
|
||||
~StdpipCullCVU1Program();
|
||||
StapipCullCVU1Program();
|
||||
~StapipCullCVU1Program();
|
||||
|
||||
std::string getStringName() const;
|
||||
void addProgramQBufferDataToPacket(packet2_t* packet,
|
||||
StdpipQBuffer* qbuffer) const;
|
||||
StapipQBuffer* qbuffer) const;
|
||||
};
|
||||
|
||||
} // namespace Tyra
|
||||
+5
-5
@@ -12,18 +12,18 @@
|
||||
|
||||
#include <packet2_utils.h>
|
||||
#include <string>
|
||||
#include "../../stdpip_vu1_program.hpp"
|
||||
#include "../../stapip_vu1_program.hpp"
|
||||
|
||||
namespace Tyra {
|
||||
|
||||
class StdpipCullDVU1Program : public StdpipVU1Program {
|
||||
class StapipCullDVU1Program : public StapipVU1Program {
|
||||
public:
|
||||
StdpipCullDVU1Program();
|
||||
~StdpipCullDVU1Program();
|
||||
StapipCullDVU1Program();
|
||||
~StapipCullDVU1Program();
|
||||
|
||||
std::string getStringName() const;
|
||||
void addProgramQBufferDataToPacket(packet2_t* packet,
|
||||
StdpipQBuffer* qbuffer) const;
|
||||
StapipQBuffer* qbuffer) const;
|
||||
};
|
||||
|
||||
} // namespace Tyra
|
||||
+29
@@ -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 "../../stapip_vu1_program.hpp"
|
||||
|
||||
namespace Tyra {
|
||||
|
||||
class StapipCullTCVU1Program : public StapipVU1Program {
|
||||
public:
|
||||
StapipCullTCVU1Program();
|
||||
~StapipCullTCVU1Program();
|
||||
|
||||
std::string getStringName() const;
|
||||
void addProgramQBufferDataToPacket(packet2_t* packet,
|
||||
StapipQBuffer* qbuffer) const;
|
||||
};
|
||||
|
||||
} // namespace Tyra
|
||||
+29
@@ -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 "../../stapip_vu1_program.hpp"
|
||||
|
||||
namespace Tyra {
|
||||
|
||||
class StapipCullTDVU1Program : public StapipVU1Program {
|
||||
public:
|
||||
StapipCullTDVU1Program();
|
||||
~StapipCullTDVU1Program();
|
||||
|
||||
std::string getStringName() const;
|
||||
void addProgramQBufferDataToPacket(packet2_t* packet,
|
||||
StapipQBuffer* qbuffer) const;
|
||||
};
|
||||
|
||||
} // namespace Tyra
|
||||
+6
-6
@@ -12,7 +12,7 @@
|
||||
|
||||
#include <vector>
|
||||
#include "debug/debug.hpp"
|
||||
#include "./stdpip_qbuffer.hpp"
|
||||
#include "./stapip_qbuffer.hpp"
|
||||
#include "renderer/renderer_settings.hpp"
|
||||
#include "renderer/core/paths/path1/clipper/path1_ee_clip_algorithm.hpp"
|
||||
|
||||
@@ -25,11 +25,11 @@ namespace Tyra {
|
||||
* To be honest clipping algorithm should be moved to VU1 and "AsIs" VU1 program
|
||||
* should be renamed to "Clip" - I don't want to do it now, too much time.
|
||||
*/
|
||||
class StdpipClipper {
|
||||
class StapipClipper {
|
||||
public:
|
||||
StdpipClipper();
|
||||
~StdpipClipper();
|
||||
void clip(StdpipQBuffer* buffer);
|
||||
StapipClipper();
|
||||
~StapipClipper();
|
||||
void clip(StapipQBuffer* buffer);
|
||||
void init(const RendererSettings& settings);
|
||||
void setMaxVertCount(const u32& count);
|
||||
void setMVP(M4x4* mvp);
|
||||
@@ -41,7 +41,7 @@ class StdpipClipper {
|
||||
|
||||
void perspectiveDivide(std::vector<Path1ClipVertex>* vertices);
|
||||
void moveDataToBuffer(const std::vector<Path1ClipVertex>& vertices,
|
||||
StdpipQBuffer* buffer);
|
||||
StapipQBuffer* buffer);
|
||||
};
|
||||
|
||||
} // namespace Tyra
|
||||
+9
-9
@@ -12,20 +12,20 @@
|
||||
|
||||
namespace Tyra {
|
||||
|
||||
enum StdpipProgramName {
|
||||
enum StapipProgramName {
|
||||
StdipUndefinedProgram,
|
||||
|
||||
StdpipCullColor,
|
||||
StdpipAsIsColor,
|
||||
StapipCullColor,
|
||||
StapipAsIsColor,
|
||||
|
||||
StdpipCullDirLights,
|
||||
StdpipAsIsDirLights,
|
||||
StapipCullDirLights,
|
||||
StapipAsIsDirLights,
|
||||
|
||||
StdpipCullTextureDirLights,
|
||||
StdpipAsIsTextureDirLights,
|
||||
StapipCullTextureDirLights,
|
||||
StapipAsIsTextureDirLights,
|
||||
|
||||
StdpipCullTextureColor,
|
||||
StdpipAsIsTextureColor,
|
||||
StapipCullTextureColor,
|
||||
StapipAsIsTextureColor,
|
||||
};
|
||||
|
||||
} // namespace Tyra
|
||||
+5
-5
@@ -12,11 +12,11 @@
|
||||
|
||||
namespace Tyra {
|
||||
|
||||
enum StdpipProgramType {
|
||||
StdpipVU1Color,
|
||||
StdpipVU1DirLights,
|
||||
StdpipVU1TextureDirLights,
|
||||
StdpipVU1TextureColor,
|
||||
enum StapipProgramType {
|
||||
StapipVU1Color,
|
||||
StapipVU1DirLights,
|
||||
StapipVU1TextureDirLights,
|
||||
StapipVU1TextureColor,
|
||||
};
|
||||
|
||||
} // namespace Tyra
|
||||
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
# ______ ____ ___
|
||||
# | \/ ____| |___|
|
||||
# | | | \ | |
|
||||
#-----------------------------------------------------------------------
|
||||
# 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/as_is/stapip_as_is_c_vu1_program.hpp"
|
||||
#include "./programs/as_is/stapip_as_is_d_vu1_program.hpp"
|
||||
#include "./programs/as_is/stapip_as_is_td_vu1_program.hpp"
|
||||
#include "./programs/as_is/stapip_as_is_tc_vu1_program.hpp"
|
||||
|
||||
#include "./programs/cull/stapip_cull_c_vu1_program.hpp"
|
||||
#include "./programs/cull/stapip_cull_d_vu1_program.hpp"
|
||||
#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 {
|
||||
public:
|
||||
StapipProgramsRepository();
|
||||
~StapipProgramsRepository();
|
||||
|
||||
StapipVU1Program* getProgram(const StapipProgramName& name);
|
||||
|
||||
private:
|
||||
StapipAsIsCVU1Program asIsColor;
|
||||
StapipCullCVU1Program cullColor;
|
||||
StapipAsIsDVU1Program asIsLightingColor;
|
||||
StapipCullDVU1Program cullLightingColor;
|
||||
StapipAsIsTDVU1Program asIsLightingTextureColor;
|
||||
StapipCullTDVU1Program cullLightingTextureColor;
|
||||
StapipAsIsTCVU1Program asIsTextureColor;
|
||||
StapipCullTCVU1Program cullTextureColor;
|
||||
VU1DrawFinish drawFinish;
|
||||
};
|
||||
|
||||
} // namespace Tyra
|
||||
+13
-13
@@ -14,15 +14,15 @@
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
#include "debug/debug.hpp"
|
||||
#include "../bag/packaging/stdpip_bag_package.hpp"
|
||||
#include "../bag/stdpip_bag.hpp"
|
||||
#include "./bag/packaging/stapip_bag_package.hpp"
|
||||
#include "./bag/stapip_bag.hpp"
|
||||
|
||||
namespace Tyra {
|
||||
|
||||
class StdpipQBuffer {
|
||||
class StapipQBuffer {
|
||||
public:
|
||||
StdpipQBuffer();
|
||||
~StdpipQBuffer();
|
||||
StapipQBuffer();
|
||||
~StapipQBuffer();
|
||||
|
||||
void setMaxVertCount(const u32& count);
|
||||
|
||||
@@ -30,27 +30,27 @@ class StdpipQBuffer {
|
||||
* @brief Dont allocate any dynamic data in buffer.
|
||||
* Just copy pointers to input data.
|
||||
*/
|
||||
void fillByPointer(const StdpipBagPackage& pkg);
|
||||
void fillByPointer(const StapipBagPackage& pkg);
|
||||
|
||||
/**
|
||||
* @brief Allocate dynamic data in buffer
|
||||
* And copy input data to it.
|
||||
*/
|
||||
void fillByCopyMax(const StdpipBagPackage& pkg1, const StdpipBagPackage& pkg2,
|
||||
const StdpipBagPackage& pkg3);
|
||||
void fillByCopyMax(const StapipBagPackage& pkg1, const StapipBagPackage& pkg2,
|
||||
const StapipBagPackage& pkg3);
|
||||
|
||||
/**
|
||||
* @brief Allocate dynamic data in buffer
|
||||
* And copy input data to it.
|
||||
*/
|
||||
void fillByCopy1By2(const StdpipBagPackage& pkg1,
|
||||
const StdpipBagPackage& pkg2);
|
||||
void fillByCopy1By2(const StapipBagPackage& pkg1,
|
||||
const StapipBagPackage& pkg2);
|
||||
|
||||
/**
|
||||
* @brief Allocate dynamic data in buffer
|
||||
* And copy input data to it.
|
||||
*/
|
||||
void fillByCopy1By3(const StdpipBagPackage& pkg);
|
||||
void fillByCopy1By3(const StapipBagPackage& pkg);
|
||||
|
||||
/**
|
||||
* @brief Deallocate dynamic data if it was allocated and allocate new data
|
||||
@@ -61,7 +61,7 @@ class StdpipQBuffer {
|
||||
|
||||
bool any() const;
|
||||
|
||||
StdpipBag* bag;
|
||||
StapipBag* bag;
|
||||
|
||||
Vec4* vertices;
|
||||
Vec4* sts;
|
||||
@@ -77,7 +77,7 @@ class StdpipQBuffer {
|
||||
private:
|
||||
u32 maxVertCount;
|
||||
void deallocateDynamicData();
|
||||
void allocateDynamicData(u16 size, StdpipBag* bag);
|
||||
void allocateDynamicData(u16 size, StapipBag* bag);
|
||||
u8 _isDynamicallyAllocated, _stAllocated, _colorAllocated, _normalAllocated;
|
||||
};
|
||||
|
||||
+25
-25
@@ -17,21 +17,21 @@
|
||||
#include "math/m4x4.hpp"
|
||||
#include "renderer/renderer_settings.hpp"
|
||||
#include "renderer/models/color.hpp"
|
||||
#include "./stdpip_qbuffer.hpp"
|
||||
#include "./stdpip_program_type.hpp"
|
||||
#include "./stdpip_program_name.hpp"
|
||||
#include "./stdpip_programs_repository.hpp"
|
||||
#include "./stdpip_clipper.hpp"
|
||||
#include "./stapip_qbuffer.hpp"
|
||||
#include "./stapip_program_type.hpp"
|
||||
#include "./stapip_program_name.hpp"
|
||||
#include "./stapip_programs_repository.hpp"
|
||||
#include "./stapip_clipper.hpp"
|
||||
#include "renderer/core/paths/path1/path1.hpp"
|
||||
#include "renderer/core/renderer_core.hpp"
|
||||
#include "renderer/core/texture/renderer_core_texture_buffers.hpp"
|
||||
|
||||
namespace Tyra {
|
||||
|
||||
class StdpipQBufferRenderer {
|
||||
class StapipQBufferRenderer {
|
||||
public:
|
||||
StdpipQBufferRenderer();
|
||||
~StdpipQBufferRenderer();
|
||||
StapipQBufferRenderer();
|
||||
~StapipQBufferRenderer();
|
||||
|
||||
void init(RendererCore* t_core);
|
||||
|
||||
@@ -39,26 +39,26 @@ class StdpipQBufferRenderer {
|
||||
|
||||
void setClipperMVP(M4x4* mvp) { clipper.setMVP(mvp); }
|
||||
|
||||
StdpipQBuffer* getBuffer();
|
||||
StapipQBuffer* getBuffer();
|
||||
|
||||
void sendObjectData(StdpipBag* bag, M4x4* mvp,
|
||||
void sendObjectData(StapipBag* bag, M4x4* mvp,
|
||||
RendererCoreTextureBuffers* texBuffers) const;
|
||||
|
||||
void setMaxVertCount(const u32& count);
|
||||
|
||||
void setInfo(StdpipInfoBag* bag);
|
||||
void setInfo(StapipInfoBag* bag);
|
||||
|
||||
/** Fast render with culling */
|
||||
void cull(StdpipQBuffer* buffer);
|
||||
void cull(StapipQBuffer* buffer);
|
||||
|
||||
/** Slower render with clipping */
|
||||
void clip(StdpipQBuffer* buffer);
|
||||
void clip(StapipQBuffer* buffer);
|
||||
|
||||
void clearLastProgramName();
|
||||
|
||||
StdpipVU1Program* getCullProgramByBag(const StdpipBag* bag);
|
||||
StapipVU1Program* getCullProgramByBag(const StapipBag* bag);
|
||||
|
||||
StdpipVU1Program* getCullProgramByParams(const bool& isLightingEnabled,
|
||||
StapipVU1Program* getCullProgramByParams(const bool& isLightingEnabled,
|
||||
const bool& isTextureEnabled);
|
||||
|
||||
const u16& getBufferSize() { return bufferSize; }
|
||||
@@ -69,27 +69,27 @@ class StdpipQBufferRenderer {
|
||||
void uploadPrograms();
|
||||
void setDoubleBuffer();
|
||||
|
||||
StdpipVU1Program* getProgramByName(const StdpipProgramName& name);
|
||||
void addBufferDataToPacket(StdpipVU1Program* program, StdpipQBuffer* buffer);
|
||||
StapipVU1Program* getProgramByName(const StapipProgramName& name);
|
||||
void addBufferDataToPacket(StapipVU1Program* program, StapipQBuffer* buffer);
|
||||
void sendPacket();
|
||||
StdpipVU1Program* getAsIsProgramByBag(const StdpipBag* bag);
|
||||
StdpipVU1Program* getCullProgramByType(const StdpipProgramType& programType);
|
||||
StdpipProgramType getDrawProgramTypeByBag(const StdpipBag* bag) const;
|
||||
StdpipProgramType getDrawProgramTypeByParams(
|
||||
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;
|
||||
StdpipQBuffer buffers[2];
|
||||
StapipQBuffer buffers[2];
|
||||
packet2_t* currentPacket;
|
||||
packet2_t* staticDataPacket;
|
||||
packet2_t* objectDataPacket;
|
||||
|
||||
RendererCore* rendererCore;
|
||||
|
||||
StdpipProgramName lastProgramName;
|
||||
StapipProgramName lastProgramName;
|
||||
Path1* path1;
|
||||
StdpipClipper clipper;
|
||||
StdpipProgramsRepository repository;
|
||||
StapipClipper clipper;
|
||||
StapipProgramsRepository repository;
|
||||
|
||||
u16 bufferSize;
|
||||
u8 context;
|
||||
+11
-11
@@ -10,40 +10,40 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "./stdpip_program_name.hpp"
|
||||
#include "./stapip_program_name.hpp"
|
||||
#include "renderer/core/paths/path1/vu1_program.hpp"
|
||||
#include "./stdpip_qbuffer.hpp"
|
||||
#include "./programs/stdpip_vu1_shared_defines.h"
|
||||
#include "./stapip_qbuffer.hpp"
|
||||
#include "./programs/stapip_vu1_shared_defines.h"
|
||||
|
||||
namespace Tyra {
|
||||
|
||||
class StdpipVU1Program : public VU1Program {
|
||||
class StapipVU1Program : public VU1Program {
|
||||
public:
|
||||
StdpipVU1Program(const StdpipProgramName& name, u32* start, u32* end,
|
||||
StapipVU1Program(const StapipProgramName& name, u32* start, u32* end,
|
||||
const u32& t_reglist, const u8& t_reglistCount,
|
||||
const u8& t_elementsPerVertex);
|
||||
~StdpipVU1Program();
|
||||
~StapipVU1Program();
|
||||
|
||||
u32& getReglist();
|
||||
|
||||
const StdpipProgramName& getName() const;
|
||||
const StapipProgramName& getName() const;
|
||||
|
||||
u16 getMaxVertCount(const bool& singleColorEnabled,
|
||||
const u16& vu1DBufferSize) const;
|
||||
|
||||
void addBufferDataToPacket(packet2_t* packet, StdpipQBuffer* buffer,
|
||||
void addBufferDataToPacket(packet2_t* packet, StapipQBuffer* buffer,
|
||||
prim_t* prim);
|
||||
|
||||
protected:
|
||||
StdpipProgramName name;
|
||||
StapipProgramName name;
|
||||
u8 reglistCount, elementsPerVertex;
|
||||
u32 destinationAddress, reglist;
|
||||
|
||||
virtual void addProgramQBufferDataToPacket(packet2_t* packet,
|
||||
StdpipQBuffer* qbuffer) const = 0;
|
||||
StapipQBuffer* qbuffer) const = 0;
|
||||
|
||||
private:
|
||||
void addStandardBufferDataToPacket(packet2_t* packet, StdpipQBuffer* buffer,
|
||||
void addStandardBufferDataToPacket(packet2_t* packet, StapipQBuffer* buffer,
|
||||
prim_t* prim);
|
||||
};
|
||||
|
||||
+14
-14
@@ -11,23 +11,23 @@
|
||||
#pragma once
|
||||
|
||||
#include <tamtypes.h>
|
||||
#include "./bag/stdpip_bag.hpp"
|
||||
#include "./bag/packaging/stdpip_bag_packages_bbox.hpp"
|
||||
#include "./bag/packaging/stdpip_bag_package.hpp"
|
||||
#include "./bag/packaging/stdpip_bag_packager.hpp"
|
||||
#include "./path1/stdpip_qbuffer_renderer.hpp"
|
||||
#include "./bag/stapip_bag.hpp"
|
||||
#include "./bag/packaging/stapip_bag_packages_bbox.hpp"
|
||||
#include "./bag/packaging/stapip_bag_package.hpp"
|
||||
#include "./bag/packaging/stapip_bag_packager.hpp"
|
||||
#include "./stapip_qbuffer_renderer.hpp"
|
||||
|
||||
namespace Tyra {
|
||||
|
||||
class StdPipelineCore {
|
||||
class StapipelineCore {
|
||||
public:
|
||||
StdPipelineCore();
|
||||
~StdPipelineCore();
|
||||
StapipelineCore();
|
||||
~StapipelineCore();
|
||||
|
||||
void init(RendererCore* t_core);
|
||||
|
||||
/** Render 3D data via "bags" */
|
||||
void render(StdpipBag* data, StdpipBagPackagesBBox* bbox = nullptr);
|
||||
void render(StapipBag* data, StapipBagPackagesBBox* bbox = nullptr);
|
||||
|
||||
/** Get max vert count of VU1 qbuffer (for optimizations) */
|
||||
u32 getMaxVertCountByParams(const bool& isSingleColor,
|
||||
@@ -35,7 +35,7 @@ class StdPipelineCore {
|
||||
const bool& isTextureEnabled);
|
||||
|
||||
/** Get max vert count of VU1 qbuffer (for optimizations) */
|
||||
u32 getMaxVertCountByBag(const StdpipBag* bag);
|
||||
u32 getMaxVertCountByBag(const StapipBag* bag);
|
||||
|
||||
/**
|
||||
* - Uploads standard VU1 programs.
|
||||
@@ -50,10 +50,10 @@ class StdPipelineCore {
|
||||
RendererCore* rendererCore;
|
||||
|
||||
void setMaxVertCount(const u32& count);
|
||||
StdpipBagPackager packager;
|
||||
StdpipQBufferRenderer qbufferRenderer;
|
||||
void renderPkgs(StdpipBagPackage* packages, u16 count);
|
||||
void renderSubpkgs(StdpipBagPackage* packages, u16 count);
|
||||
StapipBagPackager packager;
|
||||
StapipQBufferRenderer qbufferRenderer;
|
||||
void renderPkgs(StapipBagPackage* packages, u16 count);
|
||||
void renderSubpkgs(StapipBagPackage* packages, u16 count);
|
||||
};
|
||||
|
||||
} // namespace Tyra
|
||||
+3
-3
@@ -15,10 +15,10 @@
|
||||
|
||||
namespace Tyra {
|
||||
|
||||
class StdpipLightingOptions {
|
||||
class StapipLightingOptions {
|
||||
public:
|
||||
StdpipLightingOptions() {}
|
||||
~StdpipLightingOptions() {}
|
||||
StapipLightingOptions() {}
|
||||
~StapipLightingOptions() {}
|
||||
|
||||
/**
|
||||
* Mandatory.
|
||||
+7
-7
@@ -10,23 +10,23 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "./stdpip_shading_type.hpp"
|
||||
#include "./stdpip_lighting_options.hpp"
|
||||
#include "./stapip_shading_type.hpp"
|
||||
#include "./stapip_lighting_options.hpp"
|
||||
|
||||
namespace Tyra {
|
||||
|
||||
class StdpipOptions {
|
||||
class StapipOptions {
|
||||
public:
|
||||
StdpipOptions() {}
|
||||
~StdpipOptions() {}
|
||||
StapipOptions() {}
|
||||
~StapipOptions() {}
|
||||
|
||||
StdpipShadingType shadingType;
|
||||
StapipShadingType shadingType;
|
||||
bool blendingEnabled;
|
||||
bool antiAliasingEnabled;
|
||||
bool noClipChecks;
|
||||
|
||||
/** Optional */
|
||||
StdpipLightingOptions* lighting;
|
||||
StapipLightingOptions* lighting;
|
||||
};
|
||||
|
||||
} // namespace Tyra
|
||||
+3
-3
@@ -12,9 +12,9 @@
|
||||
|
||||
namespace Tyra {
|
||||
|
||||
enum StdpipShadingType {
|
||||
StdpipShadingFlat,
|
||||
StdpipShadingGouraud,
|
||||
enum StapipShadingType {
|
||||
StapipShadingFlat,
|
||||
StapipShadingGouraud,
|
||||
};
|
||||
|
||||
} // namespace Tyra
|
||||
+15
-15
@@ -12,17 +12,17 @@
|
||||
|
||||
#include <tamtypes.h>
|
||||
#include "../renderer_3d_pipeline.hpp"
|
||||
#include "./stdpip_options.hpp"
|
||||
#include "./stapip_options.hpp"
|
||||
#include "renderer/core/renderer_core.hpp"
|
||||
#include "renderer/3d/mesh/mesh.hpp"
|
||||
#include "./core/std_pipeline_core.hpp"
|
||||
#include "./core/static_pipeline_core.hpp"
|
||||
|
||||
namespace Tyra {
|
||||
|
||||
class StdPipeline : public Renderer3DPipeline {
|
||||
class Stapipeline : public Renderer3DPipeline {
|
||||
public:
|
||||
StdPipeline();
|
||||
~StdPipeline();
|
||||
Stapipeline();
|
||||
~Stapipeline();
|
||||
|
||||
void init(RendererCore* core);
|
||||
|
||||
@@ -32,28 +32,28 @@ class StdPipeline : public Renderer3DPipeline {
|
||||
* Render 3D data via "meshes".
|
||||
* This render() method is a bridge to core.renderer3D.render() method.
|
||||
*/
|
||||
void render(Mesh* mesh, const StdpipOptions* options = nullptr);
|
||||
void render(Mesh* mesh, const StapipOptions* options = nullptr);
|
||||
|
||||
private:
|
||||
StdPipelineCore core;
|
||||
StapipelineCore core;
|
||||
RendererCore* rendererCore;
|
||||
Vec4* colorsCache;
|
||||
|
||||
void addVertices(Mesh* mesh, MeshMaterial* material, StdpipBag* bag,
|
||||
void addVertices(Mesh* mesh, MeshMaterial* material, StapipBag* bag,
|
||||
MeshFrame* frameFrom, MeshFrame* frameTo) const;
|
||||
StdpipInfoBag* getInfoBag(Mesh* mesh, const StdpipOptions* options,
|
||||
StapipInfoBag* getInfoBag(Mesh* mesh, const StapipOptions* options,
|
||||
M4x4* model) const;
|
||||
StdpipColorBag* getColorBag(Mesh* mesh, MeshMaterial* material,
|
||||
StapipColorBag* getColorBag(Mesh* mesh, MeshMaterial* material,
|
||||
MeshFrame* frameFrom, MeshFrame* frameTo) const;
|
||||
StdpipTextureBag* getTextureBag(Mesh* mesh, MeshMaterial* material,
|
||||
StapipTextureBag* getTextureBag(Mesh* mesh, MeshMaterial* material,
|
||||
MeshFrame* frameFrom, MeshFrame* frameTo);
|
||||
StdpipLightingBag* getLightingBag(Mesh* mesh, MeshMaterial* material,
|
||||
StapipLightingBag* getLightingBag(Mesh* mesh, MeshMaterial* material,
|
||||
M4x4* model, MeshFrame* frameFrom,
|
||||
MeshFrame* frameTo,
|
||||
const StdpipOptions* options) const;
|
||||
void deallocDrawBags(StdpipBag* bag, MeshMaterial* material) const;
|
||||
const StapipOptions* options) const;
|
||||
void deallocDrawBags(StapipBag* bag, MeshMaterial* material) const;
|
||||
|
||||
void setLightingColorsCache(StdpipLightingOptions* lightingOptions);
|
||||
void setLightingColorsCache(StapipLightingOptions* lightingOptions);
|
||||
};
|
||||
|
||||
} // namespace Tyra
|
||||
-29
@@ -1,29 +0,0 @@
|
||||
/*
|
||||
# ______ ____ ___
|
||||
# | \/ ____| |___|
|
||||
# | | | \ | |
|
||||
#-----------------------------------------------------------------------
|
||||
# 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 "../../stdpip_vu1_program.hpp"
|
||||
|
||||
namespace Tyra {
|
||||
|
||||
class StdpipCullTCVU1Program : public StdpipVU1Program {
|
||||
public:
|
||||
StdpipCullTCVU1Program();
|
||||
~StdpipCullTCVU1Program();
|
||||
|
||||
std::string getStringName() const;
|
||||
void addProgramQBufferDataToPacket(packet2_t* packet,
|
||||
StdpipQBuffer* qbuffer) const;
|
||||
};
|
||||
|
||||
} // namespace Tyra
|
||||
-29
@@ -1,29 +0,0 @@
|
||||
/*
|
||||
# ______ ____ ___
|
||||
# | \/ ____| |___|
|
||||
# | | | \ | |
|
||||
#-----------------------------------------------------------------------
|
||||
# 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 "../../stdpip_vu1_program.hpp"
|
||||
|
||||
namespace Tyra {
|
||||
|
||||
class StdpipCullTDVU1Program : public StdpipVU1Program {
|
||||
public:
|
||||
StdpipCullTDVU1Program();
|
||||
~StdpipCullTDVU1Program();
|
||||
|
||||
std::string getStringName() const;
|
||||
void addProgramQBufferDataToPacket(packet2_t* packet,
|
||||
StdpipQBuffer* qbuffer) const;
|
||||
};
|
||||
|
||||
} // namespace Tyra
|
||||
@@ -1,49 +0,0 @@
|
||||
/*
|
||||
# ______ ____ ___
|
||||
# | \/ ____| |___|
|
||||
# | | | \ | |
|
||||
#-----------------------------------------------------------------------
|
||||
# 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/as_is/stdpip_as_is_c_vu1_program.hpp"
|
||||
#include "./programs/as_is/stdpip_as_is_d_vu1_program.hpp"
|
||||
#include "./programs/as_is/stdpip_as_is_td_vu1_program.hpp"
|
||||
#include "./programs/as_is/stdpip_as_is_tc_vu1_program.hpp"
|
||||
|
||||
#include "./programs/cull/stdpip_cull_c_vu1_program.hpp"
|
||||
#include "./programs/cull/stdpip_cull_d_vu1_program.hpp"
|
||||
#include "./programs/cull/stdpip_cull_td_vu1_program.hpp"
|
||||
#include "./programs/cull/stdpip_cull_tc_vu1_program.hpp"
|
||||
|
||||
#include "renderer/core/paths/path1/programs/draw_finish/vu1_draw_finish.hpp"
|
||||
|
||||
namespace Tyra {
|
||||
|
||||
class StdpipProgramsRepository {
|
||||
public:
|
||||
StdpipProgramsRepository();
|
||||
~StdpipProgramsRepository();
|
||||
|
||||
StdpipVU1Program* getProgram(const StdpipProgramName& name);
|
||||
|
||||
private:
|
||||
StdpipAsIsCVU1Program asIsColor;
|
||||
StdpipCullCVU1Program cullColor;
|
||||
StdpipAsIsDVU1Program asIsLightingColor;
|
||||
StdpipCullDVU1Program cullLightingColor;
|
||||
StdpipAsIsTDVU1Program asIsLightingTextureColor;
|
||||
StdpipCullTDVU1Program cullLightingTextureColor;
|
||||
StdpipAsIsTCVU1Program asIsTextureColor;
|
||||
StdpipCullTCVU1Program cullTextureColor;
|
||||
VU1DrawFinish drawFinish;
|
||||
};
|
||||
|
||||
} // namespace Tyra
|
||||
Reference in New Issue
Block a user