-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ruby: Use cleaner OpenGL render pattern, misc. CGL fixes (#1543)
### OpenGL rendering (all platforms) - 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. (The above is also unrelated to the scaling issues addressed by #1508) ### CGL fix-ups (macOS) - Backports the native fullscreen and monitor selection options to OpenGL, and removes unnecessary custom window code from the OpenGL driver. - Removes a seemingly unnecessary output call from `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. Co-authored-by: jcm <[email protected]>
- Loading branch information
Showing
4 changed files
with
49 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters