summaryrefslogtreecommitdiff
path: root/src/shaders
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2019-12-21 22:24:15 +0800
committerchai <chaifix@163.com>2019-12-21 22:24:15 +0800
commitec111247c614663d8231245a17c314b9b8b4a28c (patch)
treea66058508161da488371c90316865ae850b8be15 /src/shaders
parentc3f45735ecfab6e567be371758f21395e92dfef6 (diff)
*misc
Diffstat (limited to 'src/shaders')
-rw-r--r--src/shaders/common.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/shaders/common.h b/src/shaders/common.h
index 2779c7b..8b74bec 100644
--- a/src/shaders/common.h
+++ b/src/shaders/common.h
@@ -13,4 +13,17 @@ Vec3 normal_from_color(Color32 c32);
Mat4 mat4(Vec4* c1, Vec4* c2, Vec4* c3, Vec4* c4);
Mat3 mat3(Vec3* c1, Vec3* c2, Vec3* c3);
+Vec2 texsize(Texture* texture);
+
+#define discardif(cond) \
+do{ \
+if(cond) return 0; \
+}while(0)
+
+#define MVP_PROCESS \
+do{ \
+static Vec4 p; p.xyz = in->vertex->position; p.w = 1; \
+mat4_mulvec4(uniforms->mvp, &p, clipcoord); \
+}while(0)
+
#endif \ No newline at end of file