Skip to content

Pass through draw_fb optimization metadata to Display class #103

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

Merged
merged 1 commit into from
Jul 27, 2024

Conversation

mihaip
Copy link
Contributor

@mihaip mihaip commented Jul 27, 2024

The JS implementation does content hashing to not blit unchanged framebuffer contents (see mihaip/dingusppc@171ff2d). However, that is not necessary for the ATI adapters that already track this and only set draw_fb if the framebuffer has actually changed.

Pass through a fb_known_to_be_changed for these cases, and also add an optional update_skipped method (since the JS still wants to know when the last logical screen update was).

The JS implementation does content hashing to not blit unchanged
framebuffer contents (see 171ff2d).
However, that is not necessary for the ATI adapters that already track
this and only set draw_fb if the framebuffer has actually changed.

Pass through a fb_known_to_be_changed for these cases, and also add an
optional update_skipped method (since the JS still wants to know when
the last logical screen update was).
@mihaip
Copy link
Contributor Author

mihaip commented Jul 27, 2024

mihaip@51a8f07 is how the JS side uses this

@dingusdev dingusdev merged commit ae08c08 into dingusdev:master Jul 27, 2024
5 checks passed
@roytam1
Copy link
Contributor

roytam1 commented Jul 29, 2024

this seems making SDL window not redrawing when window is overlapped in windows unless there is an update from emulated environment.

@mihaip
Copy link
Contributor Author

mihaip commented Jul 29, 2024

@roytam1 this change just passes through a flag, it should not affect what/when SDL draws. I believe the behavior you're seeing is due to the optimization from d134107 (before that we were drawing constantly).

Based on your #106 PR it looks like the actual issue is that we weren't doing the right thing for SDL_WINDOWEVENT_EXPOSED events. Out of curiosity, what platform are you on? I'm not seeing the behavior you describe on macOS, but I think that's because all windows are double-buffered, so SDL always paints the full contents.

@roytam1
Copy link
Contributor

roytam1 commented Jul 29, 2024

Out of curiosity, what platform are you on?

On Windows. without handling SDL_WINDOWEVENT_EXPOSED and other window overlapping SDL window then moving it out, the previously overlapped area will not be redrawn.

@mihaip mihaip deleted the upstream-fb_known_to_be_changed branch July 31, 2024 05:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants