librashader specifies that the output viewport should be the same size as the output framebuffer texture. This was not the case for the OpenGL render code.
Previously, librashader under OpenGL would render onto an intermediate framebuffer sized to the "output" size (the entire window view size), rather than the "target" size (the final composited size of the game area within the output area). The libra_viewport_t would be sized to the target size, but the underlying buffer would be larger.
Now, we size the intermediate framebuffer to the "target" size, let librashader render onto it with a libra_viewport_t that matches that size. In the final pass we sample this buffer within an area of the "output"-sized buffer as appropriate.
This prior behavior would lead to scaling issues with shaders in the Metal backend. The same issues did not seem to be obviously present in OpenGL in my testing, but we should nevertheless probably fix this in case it is causing any of the subtle issues with shaders that have been reported, and also in case something breaks in the future as a result of not following this recommendation.
OpenGL rendering (all platforms)
libra_viewport_t
would be sized to the target size, but the underlying buffer would be larger.libra_viewport_t
that matches that size. In the final pass we sample this buffer within an area of the "output"-sized buffer as appropriate.This prior behavior would lead to scaling issues with shaders in the Metal backend. The same issues did not seem to be obviously present in OpenGL in my testing, but we should nevertheless probably fix this in case it is causing any of the subtle issues with shaders that have been reported, and also in case something breaks in the future as a result of not following this recommendation.
(The above is also unrelated to the scaling issues addressed by https://github.com/ares-emulator/ares/pull/1508)
CGL fix-ups (macOS)
reshape
that would cause flickering during resizes.This has been tested on macOS but should probably be tested on other platforms as well to make sure nothing breaks.