summaryrefslogtreecommitdiff
path: root/src/core/clip.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/clip.h')
-rw-r--r--src/core/clip.h19
1 files changed, 5 insertions, 14 deletions
diff --git a/src/core/clip.h b/src/core/clip.h
index c22bb8d..2ac733d 100644
--- a/src/core/clip.h
+++ b/src/core/clip.h
@@ -3,6 +3,7 @@
#include "../util/type.h"
#include "vert.h"
+#include "shader.h"
#define LERP(t,a,b) ((1-(t))*(a)+(t)*(b))
@@ -11,13 +12,6 @@ typedef struct {
Vec4 clip_coord;
/*vertex data*/
Vert vertex;
- /*register values*/
-/*
- float num[4];
- Vec2 v2[6];
- Vec3 v3[8];
- Vec4 v4[6];
-*/
} ClippedVert;
#define CLIP_BUFFER_SIZE 6
@@ -26,17 +20,14 @@ typedef struct {
ClippedVert vertices[CLIP_BUFFER_SIZE];
uint count;
/*temp register*/
- float temp_reg_num[4][CLIP_BUFFER_SIZE];
- Vec2 temp_reg_v2[6][CLIP_BUFFER_SIZE];
- Vec3 temp_reg_v3[8][CLIP_BUFFER_SIZE];
- Vec4 temp_reg_v4[6][CLIP_BUFFER_SIZE];
+ float temp_reg_num[REG_NUM_COUNT][CLIP_BUFFER_SIZE];
+ Vec2 temp_reg_v2[REG_V2_COUNT][CLIP_BUFFER_SIZE];
+ Vec3 temp_reg_v3[REG_V3_COUNT][CLIP_BUFFER_SIZE];
+ Vec4 temp_reg_v4[REG_V4_COUNT][CLIP_BUFFER_SIZE];
} ClippedBuffer;
ClippedBuffer clip_buffer;
-typedef void* (*BcpInterpolator)(Vec3* bc, void* a, void* b, void* c, void* out);
-typedef void* (*LinearInterpolator)(float t, void* a, void* b, void* c, void* out);
-
bool clip_triangle(Vec4* c0, Vec4* c1, Vec4* c2, Vert* v0, Vert* v1, Vert* v2, uint varying_flag, ClippedBuffer* clipped);
uint clip_line();