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

Allow ruby to implement screen software rendering functions #1551

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jcm93
Copy link
Contributor

@jcm93 jcm93 commented Jul 2, 2024

Marking this as draft for now, because I was a bit uncertain about whether this was the ideal way to do this, and would also still like to double check everything.

Description

Adds calls into platform and ruby for each rendering-related function in screen, and adds the usesSoftwareRendering variable to allow for the future use of a fully ruby-implemented render path.

Motivation / Context

ares currently creates completed guest frames on the CPU, including rendering certain kinds of padding, scaling, and effects, before sending them to the video backend to be post-processed, composited and displayed.

It ought to be more efficient to perform as much of this work as possible directly in the video backend. Certain effects, particularly things like color bleed, could be more efficiently parallelized there (not to mention scaling and other compositing).

ares has expressed interest in moving further with this approach, with the emulation thread essentially just outputting a video signal, with the video backend entirely responsible for assembling this signal into frames. While I think this PR does not quite directly enable this approach1, it begins moving in that direction by allowing the GPU to perform tasks that were previously software-rendered.

The end goal of that work would be to make ares's rendering more efficient, as well as (potentially, maybe) lowering frame latency.

A side benefit of this PR is that the video backend can be informed about the state of screen to correct for things like line doubling, interlace mode changes, and other scaling effects while the software-rendering path is still used (#1508).

Footnotes

  1. I have not looked at this super closely yet. It seems like this may require changes to scanline()? It might also be that with ruby having a reference to the screen instance, it can already directly index into pixels to get granular scanline data timed with e.g. host display presents.

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.

1 participant