]> git.sesse.net Git - movit/blobdiff - dither_effect.h
We've run with many more GPUs than just those three now.
[movit] / dither_effect.h
index 9818603c2a46f4a659628b68c03be5fed3f868ac..b1bbbff4168cec94708557c32c2f2f1d93dcef9a 100644 (file)
@@ -59,15 +59,16 @@ private:
 
 public:
        ~DitherEffect();
-       virtual std::string effect_type_id() const { return "DitherEffect"; }
-       std::string output_fragment_shader();
+       std::string effect_type_id() const override { return "DitherEffect"; }
+       std::string output_fragment_shader() override;
 
        // Note that if we did error diffusion, we'd actually want to diffuse the
        // premultiplied error. However, we need to do dithering in the same
        // space as quantization, whether that be pre- or postmultiply.
-       virtual AlphaHandling alpha_handling() const { return DONT_CARE_ALPHA_TYPE; }
+       AlphaHandling alpha_handling() const override { return DONT_CARE_ALPHA_TYPE; }
+       bool strong_one_to_one_sampling() const override { return true; }
 
-       void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num);
+       void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num) override;
 
 private:
        void update_texture(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num);
@@ -77,6 +78,9 @@ private:
        int texture_width, texture_height;
 
        GLuint texnum;
+       float uniform_round_fac, uniform_inv_round_fac;
+       float uniform_tc_scale[2];
+       GLint uniform_dither_tex;
 };
 
 }  // namespace movit