Skip to content

render: support rotated playback

Niklas Haas requested to merge rotation-v2 into master

This was a nightmare to implement, but the current solution seems relatively robust. 180° rotations are trivial, only 90° rotations require special handling. The implementation is based on the new ability to transpose pl_shader outputs during dispatching.

To make all of the aspect ratio and scaling code do the right thing, the basic premise is that, very early during rendering, we "fix" the dst_rect by un-rotating it. This way, all of the scalers (and user shaders etc.) see the "correct" dst rect, as though the target texture were itself somehow magically rotated.

This normalization is only undone in the very last step during output to the target planes. This implementation is also transparent to interpolation, which always sees "un-rotated" planes.

Note that the current implementation just completely ignores overlays, which probably break horribly under rotation. I'll fix that in a future commit, when I can reason better about what the correct behavior is supposed to be.

Closes #144 (closed)

Merge request reports

Loading