diff options
Diffstat (limited to 'src/shaders/common.h')
-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 |