diff options
author | chai <chaifix@163.com> | 2019-12-21 22:24:15 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2019-12-21 22:24:15 +0800 |
commit | ec111247c614663d8231245a17c314b9b8b4a28c (patch) | |
tree | a66058508161da488371c90316865ae850b8be15 /src/shaders | |
parent | c3f45735ecfab6e567be371758f21395e92dfef6 (diff) |
*misc
Diffstat (limited to 'src/shaders')
-rw-r--r-- | src/shaders/common.h | 13 |
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 |