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

SDL 2.28.0+ causes texture misalignment in Mesen2 #7954

Closed
TakuikaNinja opened this issue Jul 9, 2023 · 7 comments
Closed

SDL 2.28.0+ causes texture misalignment in Mesen2 #7954

TakuikaNinja opened this issue Jul 9, 2023 · 7 comments
Assignees
Milestone

Comments

@TakuikaNinja
Copy link

TakuikaNinja commented Jul 9, 2023

Since SDL 2.28.0, the texture(s) in Mesen2 become misaligned:
image

Sometimes the texture can be realigned by changing the video settings but it is very inconsistent.
Downgrading SDL to 2.26.5 restores the proper behaviour.
Note: Please use the development builds of Mesen2 for testing.

OS: EndeavourOS (basically Arch)
Display server: X11

@TakuikaNinja
Copy link
Author

TakuikaNinja commented Jul 9, 2023

After a few git bisect attempts, aa53621 was named as the first bad commit. I think the cherry-pick went horribly wrong there, since the original commit (49b5cfa) places the code in X11_HideWindow() but the cherry-picked commit places it in X11_ShowWindow().

@zeta0134
Copy link

zeta0134 commented Jul 9, 2023

I can confirm this bug on Arch proper, just updated to sdl2 2.28.1-1 and was greeted with mostly transparent game windows. Mesen2-specific workarounds include resizing the window, but it's temporary and quite glitchy.

@sezero sezero added this to the 2.28.2 milestone Jul 9, 2023
@sezero
Copy link
Contributor

sezero commented Jul 9, 2023

CC: @icculus

@icculus
Copy link
Collaborator

icculus commented Jul 9, 2023

Ugh, sorry about that! I'll look at that cherry-pick today.

@icculus icculus self-assigned this Jul 9, 2023
@icculus
Copy link
Collaborator

icculus commented Jul 10, 2023

Ok, what the heck, this shouldn't be in HideWindow in the original commit.

I wonder if I made a fix for #4216, then did a git pull --rebase before pushing, and it ended up moving elsewhere?

This is wild, I'm digging further.

@icculus
Copy link
Collaborator

icculus commented Jul 10, 2023

This is wild, I'm digging further.

My current thinking is the SDL2 patch is correct (discounting whatever interaction is causing Mesen2 trouble), and I probably did the work in that branch and tested i3 against it, and then either applied a patch to a separate working copy for SDL3, where it landed incorrectly, or just pasted it into the wrong place, which is at least as likely, if not more.

But since our policy is to commit to SDL3 and cherry-pick back to SDL2, that got committed first and then cherry-picked over (and maybe I even thought "weird, it missed the function" and manually fixed it up in SDL2).

Anyhow, the plan now is to run mesen2 under a debugger and reproduce this issue, see what should be done, and fix up the SDL3 commit in any case.

@icculus
Copy link
Collaborator

icculus commented Jul 26, 2023

Let's close this and track this over in #8029.

@icculus icculus closed this as completed Jul 26, 2023
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

No branches or pull requests

4 participants