From ec111247c614663d8231245a17c314b9b8b4a28c Mon Sep 17 00:00:00 2001 From: chai Date: Sat, 21 Dec 2019 22:24:15 +0800 Subject: *misc --- src/shaders/common.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/shaders/common.h') 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 -- cgit v1.1-26-g67d0