]> git.sesse.net Git - movit/blobdiff - slice_effect.h
Fix an issue where a (cached) shader program could be used from multiple
[movit] / slice_effect.h
index 1c363ea7b104c19ccd31a6e82a74b50f95ec16c1..ef96dddcb1e8474a07f037862fd37afe4a41951a 100644 (file)
@@ -7,8 +7,8 @@
 // discard roles, where one does convolutions by means of many small FFTs, but
 // could also work as a (relatively boring) video effect on its own.
 //
-// Note that vertical slices happen from the bottom, not the top, due to the
-// OpenGL coordinate system.
+// Note that vertical slices happen from the top, consistent with the rest of
+// Movit.
 
 #include <epoxy/gl.h>
 #include <string>
@@ -24,6 +24,7 @@ public:
        std::string output_fragment_shader();
        virtual bool needs_texture_bounce() const { return true; }
        virtual bool changes_output_size() const { return true; }
+       virtual bool sets_virtual_output_size() const { return false; }
        virtual void inform_input_size(unsigned input_num, unsigned width, unsigned height);
        virtual void get_output_size(unsigned *width, unsigned *height,
                                     unsigned *virtual_width, unsigned *virtual_height) const;
@@ -37,7 +38,11 @@ private:
        EffectChain *chain;
        int input_width, input_height;
        int input_slice_size, output_slice_size;
+       int offset;
        Direction direction;
+
+       float uniform_output_coord_to_slice_num, uniform_slice_num_to_input_coord;
+       float uniform_slice_offset_to_input_coord, uniform_offset;
 };
 
 }  // namespace movit