Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ruby: Use cleaner OpenGL render pattern, misc. CGL fixes #1543

Merged
merged 1 commit into from
Jun 21, 2024

Conversation

jcm93
Copy link
Contributor

@jcm93 jcm93 commented Jun 21, 2024

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.

@LukeUsher LukeUsher merged commit 21f7309 into ares-emulator:master Jun 21, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants