python-vrzero icon indicating copy to clipboard operation
python-vrzero copied to clipboard

setting display_rotate in config.txt impacts performance

Open WayneKeenan opened this issue 7 years ago • 4 comments

It was reported that the HDMI rotation in config.txt has a performance impact. Proposed solution is to instead specify the rotation at the OpenGL ES level. Either in the Pi3D StereoCamera setup, or, if that API doesn't quite work as expected then perform the rotation 'manually' in the barrel and a copy of uv_flat GL ES shaders.

WayneKeenan avatar Mar 01 '17 06:03 WayneKeenan

There is ~20% frame rate improvement on the Abbey demo when the display_rotate in config.txt isn't being used.

Still need to make the downstream OpenGL ES rendering changes thought.

WayneKeenan avatar Apr 02 '18 11:04 WayneKeenan

this isn't needed on a Pi4 and as Pi4 is now the minimum supported hardware I'm closing this.

WayneKeenan avatar Feb 01 '21 21:02 WayneKeenan

This isn't needed on a Pi4 for PSVR, but rotation is still needed for DK2 (see#14)

WayneKeenan avatar Feb 09 '21 07:02 WayneKeenan

Is it possible the rotation slowdown for 90 and 270 is because the frame buffer is stored vertically in RAM but then is read horizontally? Sorry if I didn’t explain clearly

Edit: from the Lodev raycasting page: Raycasting works with vertical stripes, but the screen buffer in memory is laid out with horizontal scanlines. So drawing vertical stripes is bad for memory locality for caching (it is in fact a worst case scenario), and the loss of good caching may hurt the speed more than some of the 3D computations on modern machines. It may be possible to program this with better caching behavior (e.g. processing multiple stripes at once, using a cache-oblivious transpose algorithm, or having a 90 degree rotated raycaster), but for simplicity the rest of this tutorial ignores this caching issue.

69K-ram avatar Feb 09 '21 17:02 69K-ram