From 6eb839737216564bcaf4645b7ebf6ea9efc2da09 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Thu, 4 Oct 2012 17:28:15 +0200 Subject: [PATCH] Replace LAST_INPUT with INPUT. --- blur_effect.frag | 4 ++-- colorspace_conversion_effect.frag | 2 +- effect_chain.cpp | 4 ++-- footer.frag | 2 +- footer.vert | 2 +- gamma_compression_effect.frag | 2 +- gamma_expansion_effect.frag | 2 +- header.frag | 2 +- header.vert | 2 +- identity.frag | 2 +- lift_gamma_gain_effect.frag | 2 +- mirror_effect.frag | 2 +- sandbox_effect.frag | 2 +- saturation_effect.frag | 2 +- vignette_effect.frag | 2 +- 15 files changed, 17 insertions(+), 17 deletions(-) diff --git a/blur_effect.frag b/blur_effect.frag index 7e5a424..c6e4cf5 100644 --- a/blur_effect.frag +++ b/blur_effect.frag @@ -5,10 +5,10 @@ uniform vec4 PREFIX(samples)[NUM_TAPS + 1]; vec4 FUNCNAME(vec2 tc) { - vec4 sum = vec4(PREFIX(samples)[0].z) * LAST_INPUT(tc); + vec4 sum = vec4(PREFIX(samples)[0].z) * INPUT(tc); for (int i = 1; i < NUM_TAPS + 1; ++i) { vec4 sample = PREFIX(samples)[i]; - sum += vec4(sample.z) * (LAST_INPUT(tc - sample.xy) + LAST_INPUT(tc + sample.xy)); + sum += vec4(sample.z) * (INPUT(tc - sample.xy) + INPUT(tc + sample.xy)); } return sum; } diff --git a/colorspace_conversion_effect.frag b/colorspace_conversion_effect.frag index ea858fb..6ec8e55 100644 --- a/colorspace_conversion_effect.frag +++ b/colorspace_conversion_effect.frag @@ -2,7 +2,7 @@ // The matrix is computed on the host and baked into the shader at compile time. vec4 FUNCNAME(vec2 tc) { - vec4 x = LAST_INPUT(tc); + vec4 x = INPUT(tc); x.rgb = PREFIX(conversion_matrix) * x.rgb; return x; } diff --git a/effect_chain.cpp b/effect_chain.cpp index fcf94f8..6362a09 100644 --- a/effect_chain.cpp +++ b/effect_chain.cpp @@ -153,8 +153,8 @@ EffectChain::Phase EffectChain::compile_glsl_program(unsigned start_index, unsig frag_shader += replace_prefix(effects[i]->output_fragment_shader(), effect_id); frag_shader += "#undef PREFIX\n"; frag_shader += "#undef FUNCNAME\n"; - frag_shader += "#undef LAST_INPUT\n"; - frag_shader += std::string("#define LAST_INPUT ") + effect_id + "\n"; + frag_shader += "#undef INPUT\n"; + frag_shader += std::string("#define INPUT ") + effect_id + "\n"; frag_shader += "\n"; input_needs_mipmaps |= effects[i]->needs_mipmaps(); diff --git a/footer.frag b/footer.frag index 0a742a3..e41e83c 100644 --- a/footer.frag +++ b/footer.frag @@ -1,4 +1,4 @@ void main() { - gl_FragColor = LAST_INPUT(tc); + gl_FragColor = INPUT(tc); } diff --git a/footer.vert b/footer.vert index e4629c6..671f52b 100644 --- a/footer.vert +++ b/footer.vert @@ -2,6 +2,6 @@ varying vec2 tc; void main() { - tc = LAST_INPUT(); + tc = INPUT(); gl_Position = ftransform(); } diff --git a/gamma_compression_effect.frag b/gamma_compression_effect.frag index 8944982..27e014e 100644 --- a/gamma_compression_effect.frag +++ b/gamma_compression_effect.frag @@ -1,7 +1,7 @@ // Compress to sRGB gamma curve. vec4 FUNCNAME(vec2 tc) { - vec4 x = LAST_INPUT(tc); + vec4 x = INPUT(tc); x.r = texture1D(PREFIX(compression_curve_tex), x.r).x; x.g = texture1D(PREFIX(compression_curve_tex), x.g).x; diff --git a/gamma_expansion_effect.frag b/gamma_expansion_effect.frag index 4a5db9e..1174a3e 100644 --- a/gamma_expansion_effect.frag +++ b/gamma_expansion_effect.frag @@ -1,7 +1,7 @@ // Expand sRGB gamma curve. vec4 FUNCNAME(vec2 tc) { - vec4 x = LAST_INPUT(tc); + vec4 x = INPUT(tc); x.r = texture1D(PREFIX(expansion_curve_tex), x.r).x; x.g = texture1D(PREFIX(expansion_curve_tex), x.g).x; diff --git a/header.frag b/header.frag index 68d966b..539eb8d 100644 --- a/header.frag +++ b/header.frag @@ -6,4 +6,4 @@ vec4 read_input(vec2 tc) return texture2D(input_tex, tc.st); } -#define LAST_INPUT read_input +#define INPUT read_input diff --git a/header.vert b/header.vert index 3ab870d..d37809a 100644 --- a/header.vert +++ b/header.vert @@ -3,4 +3,4 @@ vec2 read_input() return gl_MultiTexCoord0.st; } -#define LAST_INPUT read_input +#define INPUT read_input diff --git a/identity.frag b/identity.frag index ca41262..d9d7fc3 100644 --- a/identity.frag +++ b/identity.frag @@ -1,5 +1,5 @@ // Identity transformation (sometimes useful to do nothing). vec4 FUNCNAME(vec2 tc) { - return LAST_INPUT(tc); + return INPUT(tc); } diff --git a/lift_gamma_gain_effect.frag b/lift_gamma_gain_effect.frag index 43766a6..acd9d51 100644 --- a/lift_gamma_gain_effect.frag +++ b/lift_gamma_gain_effect.frag @@ -3,7 +3,7 @@ uniform vec3 PREFIX(gain_pow_inv_gamma); // gain^(1/gamma). uniform vec3 PREFIX(inv_gamma_22); // 2.2 / gamma. vec4 FUNCNAME(vec2 tc) { - vec4 x = LAST_INPUT(tc); + vec4 x = INPUT(tc); x.rgb = pow(x.rgb, vec3(1.0/2.2)); x.rgb += PREFIX(lift) * (vec3(1) - x.rgb); diff --git a/mirror_effect.frag b/mirror_effect.frag index 0d4206a..049194d 100644 --- a/mirror_effect.frag +++ b/mirror_effect.frag @@ -2,5 +2,5 @@ vec4 FUNCNAME(vec2 tc) { tc.x = 1.0 - tc.x; - return LAST_INPUT(tc); + return INPUT(tc); } diff --git a/sandbox_effect.frag b/sandbox_effect.frag index 30e03e4..c40b4cd 100644 --- a/sandbox_effect.frag +++ b/sandbox_effect.frag @@ -1,5 +1,5 @@ vec4 FUNCNAME(vec2 tc) { // Your code goes here, obviously. // You can use PREFIX(parm) to access the parameter you gave in. - return LAST_INPUT(tc); + return INPUT(tc); } diff --git a/saturation_effect.frag b/saturation_effect.frag index a68485a..31106d3 100644 --- a/saturation_effect.frag +++ b/saturation_effect.frag @@ -1,7 +1,7 @@ // Saturate/desaturate (in linear space). vec4 FUNCNAME(vec2 tc) { - vec4 x = LAST_INPUT(tc); + vec4 x = INPUT(tc); float luminance = dot(x.rgb, vec3(0.2126, 0.7152, 0.0722)); x.rgb = mix(vec3(luminance), x.rgb, PREFIX(saturation)); diff --git a/vignette_effect.frag b/vignette_effect.frag index bc84516..422b27f 100644 --- a/vignette_effect.frag +++ b/vignette_effect.frag @@ -4,7 +4,7 @@ uniform float PREFIX(inv_radius); uniform vec2 PREFIX(aspect_correction); vec4 FUNCNAME(vec2 tc) { - vec4 x = LAST_INPUT(tc); + vec4 x = INPUT(tc); const float pihalf = 0.5 * 3.14159265358979324; -- 2.39.2