mirror of
https://github.com/italicsjenga/slang-shaders.git
synced 2024-11-23 08:11:29 +11:00
28 lines
754 B
C++
28 lines
754 B
C++
// compatibility macros for transparently converting HLSLisms into GLSLisms
|
|
#define mul(a,b) (b*a)
|
|
#define lerp(a,b,c) mix(a,b,c)
|
|
#define saturate(c) clamp(c, 0.0, 1.0)
|
|
#define frac(x) (fract(x))
|
|
#define float2 vec2
|
|
#define float3 vec3
|
|
#define float4 vec4
|
|
#define bool2 bvec2
|
|
#define bool3 bvec3
|
|
#define bool4 bvec4
|
|
#define float2x2 mat2x2
|
|
#define float3x3 mat3x3
|
|
#define float4x4 mat4x4
|
|
#define float4x3 mat4x3
|
|
#define float2x4 mat2x4
|
|
#define IN params
|
|
#define texture_size SourceSize.xy
|
|
#define video_size SourceSize.xy
|
|
#define output_size OutputSize.xy
|
|
#define frame_count FrameCount
|
|
#define static
|
|
#define inline
|
|
#define fmod(x,y) mod(x,y)
|
|
#define ddx(c) dFdx(c)
|
|
#define ddy(c) dFdy(c)
|
|
#define atan2(x,y) atan(y,x)
|
|
#define rsqrt(c) inversesqrt(c) |