z test patch

This commit is contained in:
h4570
2022-08-14 18:05:57 +02:00
parent a9c91db594
commit 15391a81e0
51 changed files with 197 additions and 163 deletions
@@ -14,11 +14,12 @@
#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
#define VU1_Z_TESTS_ADDR 10
#define VU1_CLUT_ADDR 11
#define VU1_LIGHTS_DIRS_ADDR 12
#define VU1_LIGHTS_COLORS_ADDR 15
#define VU1_SET_GIFTAG_ADDR 19
#define VU1_DYNPIP_LAST_ITEM_ADDR 19
// Buffer data (xtop)
#define VU1_VERT_DATA_ADDR 2
#define VU1_DYNPIP_VERT_DATA_ADDR 2
@@ -16,6 +16,7 @@
#include "../pipeline_shading_type.hpp"
#include "../pipeline_texture_mapping_type.hpp"
#include "../pipeline_transformation_type.hpp"
#include "../pipeline_z_test.hpp"
#include "./pipeline_info_bag_frustum_culling.hpp"
namespace Tyra {
@@ -30,6 +31,7 @@ class PipelineInfoBag {
antiAliasingEnabled = false;
model = nullptr;
frustumCulling = PipelineInfoBagFrustumCulling_None;
zTestType = PipelineZTest_Standard;
}
~PipelineInfoBag() {}
@@ -51,6 +53,9 @@ class PipelineInfoBag {
/** Anti-aliasing */
bool antiAliasingEnabled;
/** Type of z buffer testing. */
PipelineZTest zTestType;
/** Type of frustum culling */
PipelineInfoBagFrustumCulling frustumCulling;
};
@@ -14,6 +14,7 @@
#include "../shared/pipeline_lighting_options.hpp"
#include "../shared/pipeline_texture_mapping_type.hpp"
#include "../shared/pipeline_transformation_type.hpp"
#include "../shared/pipeline_z_test.hpp"
#include "./pipeline_frustum_culling.hpp"
namespace Tyra {
@@ -27,6 +28,7 @@ class PipelineOptions {
shadingType = TyraShadingFlat;
textureMappingType = TyraLinear;
transformationType = TyraMVP;
zTestType = PipelineZTest_Standard;
}
~PipelineOptions() {}
@@ -45,6 +47,9 @@ class PipelineOptions {
/** Anti-aliasing */
bool antiAliasingEnabled;
/** Type of z-buffer testing. */
PipelineZTest zTestType;
/** Multiply by model matrix by view-projection or projection matrix */
PipelineTransformationType transformationType;
@@ -12,9 +12,9 @@
namespace Tyra {
enum StaPipZTest {
StaPipZTest_Standard = 0,
StaPipZTest_AllPass = 1,
enum PipelineZTest {
PipelineZTest_Standard = 0,
PipelineZTest_AllPass = 1,
};
} // namespace Tyra
@@ -11,16 +11,12 @@
#pragma once
#include "renderer/3d/pipeline/shared/bag/pipeline_info_bag.hpp"
#include "renderer/3d/pipeline/static/stapip_ztest.hpp"
namespace Tyra {
class StaPipInfoBag : public PipelineInfoBag {
public:
StaPipInfoBag() {
fullClipChecks = false;
zTestType = StaPipZTest_Standard;
}
StaPipInfoBag() { fullClipChecks = false; }
~StaPipInfoBag() {}
/**
@@ -33,9 +29,6 @@ class StaPipInfoBag : public PipelineInfoBag {
* Force enabled in dynamic pipe, because of efficiency.
*/
bool fullClipChecks;
/** @brief Type of z buffer testing. */
StaPipZTest zTestType;
};
} // namespace Tyra
@@ -14,11 +14,12 @@
#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
#define VU1_Z_TESTS_ADDR 10
#define VU1_CLUT_ADDR 11
#define VU1_LIGHTS_DIRS_ADDR 12
#define VU1_LIGHTS_COLORS_ADDR 15
#define VU1_SET_GIFTAG_ADDR 19
#define VU1_STAPIP_LAST_ITEM_ADDR 19
// Buffer data (xtop)
#define VU1_VERT_DATA_ADDR 2
#define VU1_STAPIP_VERT_DATA_ADDR 2
@@ -16,7 +16,6 @@
#include "./bag/packaging/stapip_bag_package.hpp"
#include "./bag/packaging/stapip_bag_packager.hpp"
#include "./stapip_qbuffer_renderer.hpp"
#include "../stapip_ztest.hpp"
#include "renderer/3d/pipeline/shared/pipeline_frustum_culling.hpp"
namespace Tyra {
@@ -11,21 +11,14 @@
#pragma once
#include "renderer/3d/pipeline/shared/pipeline_options.hpp"
#include "./stapip_ztest.hpp"
namespace Tyra {
class StaPipOptions : public PipelineOptions {
public:
StaPipOptions() {
fullClipChecks = false;
zTestType = StaPipZTest_Standard;
}
StaPipOptions() { fullClipChecks = false; }
~StaPipOptions() {}
/** @brief Type of z buffer testing. */
StaPipZTest zTestType;
/**
* @brief Experimental! True -> enables "clip against each plane" algorithm.
* Mandatory, default: False.
@@ -12,6 +12,7 @@
#include "renderer/renderer_settings.hpp"
#include "./renderer_core_gs_vram.hpp"
#include "../renderer_core_sync.hpp"
namespace Tyra {
@@ -27,10 +28,6 @@ class RendererCoreGS {
void flipBuffers();
void setStandardZTest();
void setAllPassZTest();
private:
constexpr static float gsCenter = 4096.0F;
constexpr static float screenCenter = gsCenter / 2.0F;
@@ -48,7 +45,6 @@ class RendererCoreGS {
void updateCurrentField();
qword_t* setXYOffset(qword_t* q, const int& drawContext, const float& x,
const float& y);
qword_t* addAllPassZTest(qword_t* q, int context, zbuffer_t* z);
};
} // namespace Tyra
+5
View File
@@ -11,6 +11,7 @@
#pragma once
#include <tamtypes.h>
#include <time.h>
namespace Tyra {
@@ -20,8 +21,12 @@ class Threading {
~Threading();
static void sleep(const u32& ms);
static void sleep(const timespec& tv);
static void switchThread();
private:
static timespec tv;
};
} // namespace Tyra