Skip to content

rotate the compute compositor's distortion texture

Aidan Thornton requested to merge makomk/monado:compute-rotation-support into main

The normal graphics-based compositor can support devices with rotated displays by using a vertex shader to rotate its distortion mesh, but the compute shader based alternative currently doesn't support this (and obviously doesn't have a vertex shader). This mainly seems to affect Android smartphones which would end up with output that is 90 degrees off from the correct orientation.

Since the rotation isn't likely to change often I've tried adding support by incorporating it into the distortion textures used by the compute shader, meaning no extra computation is required after the initial setup. This seems to work but my code testing it out is a bit of a mess. Currently those textures are calculated too early on in the Monado startup process, before the necessary information exists, and are expected to remain the same whereas in theory they could now change if the display properties do. This patch has the bare minimum changes to simply delete and recreate them every time we set up a new set of output buffers. This definitely causes them to be recreated and recomputed a lot more than is necessary and probably breaks the intended separation between different parts of the compositor code. Not sure what the best way of doing this would be.

Edited by Aidan Thornton

Merge request reports