X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;ds=sidebyside;f=effect.h;h=ebbb6726104051caaba9b4e58df21279682dc1f3;hb=3cb6aa45faa156fcb380aeacc13b03743bc471ec;hp=9d81a562e0aa8f53b18c8e0d6e8e5990076f0cfd;hpb=9c12e38b7cd88a77ef297d080b7c41e6bd6326fb;p=movit diff --git a/effect.h b/effect.h index 9d81a56..ebbb672 100644 --- a/effect.h +++ b/effect.h @@ -217,6 +217,20 @@ public: // and allow dependent effects to change that sampler state. virtual bool is_single_texture() const { return false; } + // If set, this effect should never be bounced to an output, even if a + // dependent effect demands texture bounce. + // + // Note that setting this can invoke undefined behavior, up to and including crashing, + // so you should only use it if you have deep understanding of your entire chain + // and Movit's processing of it. The most likely use case is if you have an input + // that's cheap to compute but not a single texture (e.g. YCbCrInput), and want + // to run a ResampleEffect directly from it. Normally, this would require a bounce, + // but it's faster not to. (However, also note that in this case, effective texel + // subpixel precision will be too optimistic, since chroma is already subsampled.) + // + // Has no effect if is_single_texture() is set. + virtual bool override_disable_bounce() const { return false; } + // If changes_output_size() is true, you must implement this to tell // the framework what output size you want. Also, you can set a // virtual width/height, which is the size the next effect (if any) @@ -332,9 +346,9 @@ protected: // // Calling register_* will automatically imply register_uniform_*, // except for register_int as noted above. + void register_uniform_sampler2d(const std::string &key, const int *value); void register_uniform_bool(const std::string &key, const bool *value); void register_uniform_int(const std::string &key, const int *value); // Note: Requires GLSL 1.30 or newer. - void register_uniform_sampler2d(const std::string &key, const int *value); void register_uniform_float(const std::string &key, const float *value); void register_uniform_vec2(const std::string &key, const float *values); void register_uniform_vec3(const std::string &key, const float *values); @@ -351,9 +365,9 @@ private: std::map params_vec4; // Picked out by EffectChain during finalization. + std::vector > uniforms_sampler2d; std::vector > uniforms_bool; std::vector > uniforms_int; - std::vector > uniforms_sampler2d; std::vector > uniforms_float; std::vector > uniforms_vec2; std::vector > uniforms_vec3;