Migrate builtin macros to '__' prefix

This commit is contained in:
Jarcode
2019-03-14 21:51:58 -07:00
parent aa56b89ddf
commit 0acf7d4188
6 changed files with 18 additions and 20 deletions

View File

@@ -1,5 +1,5 @@
#if PREMULTIPLY_ALPHA == 0
#if __PREMULTIPLY_ALPHA == 0
#error __disablestage
#endif
@@ -11,7 +11,5 @@ in vec4 gl_FragCoord;
void main() {
fragment = texelFetch(tex, ivec2(gl_FragCoord.x, gl_FragCoord.y), 0);
#if PREMULTIPLY_ALPHA > 0
fragment.rgb *= fragment.a;
#endif
}

View File

@@ -34,14 +34,14 @@ float iscale_audio(float idx) {
return -log((SAMPLE_RANGE) * idx) / (SAMPLE_SCALE);
}
/* Note: the SMOOTH_FACTOR macro is defined by GLava itself, from `#request setsmoothfactor`*/
/* Note: the __SMOOTH_FACTOR macro is defined by GLava itself, from `#request setsmoothfactor`*/
float smooth_audio(in sampler1D tex, int tex_sz, highp float idx) {
#if PRE_SMOOTHED_AUDIO < 1
#if __PRE_SMOOTHED_AUDIO < 1
float
smin = scale_audio(clamp(idx - SMOOTH_FACTOR, 0, 1)) * tex_sz,
smax = scale_audio(clamp(idx + SMOOTH_FACTOR, 0, 1)) * tex_sz;
smin = scale_audio(clamp(idx - __SMOOTH_FACTOR, 0, 1)) * tex_sz,
smax = scale_audio(clamp(idx + __SMOOTH_FACTOR, 0, 1)) * tex_sz;
float m = ((smax - smin) / 2.0F), s, w;
float rm = smin + m; /* middle */

View File

@@ -6,8 +6,8 @@ uniform int w;
out vec4 fragment;
in vec4 gl_FragCoord;
#undef PRE_SMOOTHED_AUDIO
#define PRE_SMOOTHED_AUDIO 0
#undef __PRE_SMOOTHED_AUDIO
#define __PRE_SMOOTHED_AUDIO 0
#include ":util/smooth.glsl"