summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/device.c10
-rw-r--r--src/core/device.h2
-rw-r--r--src/core/shader.h8
-rw-r--r--src/core/vert.h4
4 files changed, 11 insertions, 13 deletions
diff --git a/src/core/device.c b/src/core/device.c
index 923a2fa..8284315 100644
--- a/src/core/device.c
+++ b/src/core/device.c
@@ -44,7 +44,7 @@ static struct {
StencilFunc stencil_func;
StencilOp stencil_failop, stencil_dpfailop, stencil_passop;
- Vert* verts; uint vert_count;
+ Vertex* verts; uint vert_count;
uint* indices; uint prim_count;
Program* program;
@@ -457,7 +457,7 @@ void ssrU_blend(
out->a = src->a + dst->a;
}
-void ssr_bindvertices(Vert* verts, int vert_count, uint* indices, int prim_count) {
+void ssr_bindvertices(Vertex* verts, int vert_count, uint* indices, int prim_count) {
ssr_assert(verts && indices);
state.verts = verts;
state.vert_count = vert_count;
@@ -474,7 +474,6 @@ void ssr_unuseprogram() {
state.program = NULL;
}
-VertexShaderIn ssr_vert_in;
FragmentShaderIn ssr_frag_in;
static struct {
@@ -659,13 +658,12 @@ void ssr_draw(ssr_PrimitiveType primitive) {
/*vertex operation*/
VertexShader vert_shader = state.program->vertexshader;
for (int i = 0; i < state.vert_count; ++i) {
- Vert* vert = &state.verts[i];
- ssr_vert_in.vertex = vert;
+ Vertex* vert = &state.verts[i];
/*set register pointers*/
if (use_extra_varyings) {
ssrS_setupregisterpointers(vert->index);
}
- vert_shader(&state.uniforms, &ssr_vert_in, &clip_coords.coords[i]);
+ vert_shader(&state.uniforms, vert, &clip_coords.coords[i]);
}
/*set register pointer to frag-in*/
diff --git a/src/core/device.h b/src/core/device.h
index 0b27b70..79ffd4b 100644
--- a/src/core/device.h
+++ b/src/core/device.h
@@ -118,7 +118,7 @@ void ssr_disable(uint mask);
bool ssr_isenable(uint mask);
/* °ó¶¨¶¥µãÊý¾Ý */
-void ssr_bindvertices(Vert* verts, int vert_count, uint* indices, int prim_count);
+void ssr_bindvertices(Vertex* verts, int vert_count, uint* indices, int prim_count);
void ssr_unbindvertices();
void ssr_useprogram(Program* program);
diff --git a/src/core/shader.h b/src/core/shader.h
index 71f26e4..043ba1e 100644
--- a/src/core/shader.h
+++ b/src/core/shader.h
@@ -38,11 +38,11 @@ typedef struct {
#define REG_V3_COUNT 12
#define REG_V4_COUNT 8
-typedef struct {
- Vert* vertex;
-} VertexShaderIn;
+//typedef struct {
+// Vertex* vertex;
+//} Vertex;
-typedef void(*VertexShader)(UniformCollection* uniforms, VertexShaderIn* in, Vec4* homocoord);
+typedef void(*VertexShader)(UniformCollection* uniforms, Vertex* in, Vec4* homocoord);
typedef struct {
float num[REG_NUM_COUNT];
diff --git a/src/core/vert.h b/src/core/vert.h
index 6c968b5..c733baa 100644
--- a/src/core/vert.h
+++ b/src/core/vert.h
@@ -22,7 +22,7 @@ Color color32_tocolor(Color32* c);
void color_tocolor32(Color c, Color32* out);
void color32_saturate(Color32* c);
-typedef struct Vert {
+typedef struct {
uint index;
Vec3 position;
Vec3 normal;
@@ -34,6 +34,6 @@ typedef struct Vert {
Vec4 joint;
Vec4 weight;
*/
-} Vert;
+} Vertex;
#endif \ No newline at end of file