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

Prominent graphical corruption in macOS full screen mode #771

Closed
josephazrak opened this issue Apr 19, 2021 · 7 comments
Closed

Prominent graphical corruption in macOS full screen mode #771

josephazrak opened this issue Apr 19, 2021 · 7 comments
Labels
Broken implemented but broken

Comments

@josephazrak
Copy link

Prominent graphical artifacts were introduced around snapshot 207.

Prerequisites:
1. The window resize option is enabled;
2. Powder Toy is running in native full screen mode (through the green Fullscreen button);
3. The screen is not being recorded.

When these prerequisites are met and the user triggers some kind of change in the Powder Toy GUI (for example, opening the Save Browser, Element Search list, movement of a progress bar, login window), flickering occurs for around 100-500ms.

Here is a video of this occurring when opening the Element Search list is toggled (recorded w/ external device because of #3): https://user-images.githubusercontent.com/17184955/115196442-9362ee80-a0f8-11eb-8bc4-88af8944b32e.mp4

Here is a screenshot of the graphical artifacts:
Corruption screenshot

System info
Operating system: macOS Big Sur version 11.3 Beta (20E5231a)
Hardware: MacBook Pro 13' (2019), 2.4 GHz Quad-Core Intel Core i5, 8 GB 2133 MHz LPDDR3, Intel Iris Plus Graphics 655 1536 MB

@josephazrak
Copy link
Author

Here is my Powder Toy configuration:
Screenshot 2021-04-19 at 10 23 52

@LBPHacker
Copy link
Member

Very interesting problem, especially due to the restriction on recording. Will try to reproduce, somehow.

At a glance and based on experience, I can see no way for whatever texture we give SDL to get corrupted like that on our side, which just leaves SDL itself and whatever OS libraries come after. SDL being SDL points to the former, the screen recording thing points to the latter. It would be nice to cook up a minimal repro with SDL.

@LBPHacker LBPHacker added the Broken implemented but broken label Apr 19, 2021
@josephazrak
Copy link
Author

I should mention that I am running beta OS software (macOS Big Sur beta). However, I distinctly remember this issue starting to occur after downloading a snapshot.

Have the SDL libraries been updated around snapshot 207? Actually, I believe the snapshot which started this issue was the first one which changed the build system from Starcatcher to GH Actions. Which snapshot was that?

@LBPHacker
Copy link
Member

We migrated to ghactions between snapshots 205 and 207 (the tag snapshot-206 exists but no corresponding snapshot was ever released), and also changed build systems. More importantly, we also migrated static libraries to ghactions, so whatever triggers the problem was most likely brought on by that. SDL was not updated; it was and is version 2.0.10, but even if it was, that wouldn't necessarily mean that SDL is at fault. Assuming it isn't, Big Sur would explain why I've never seen this problem anywhere so far, as I only have access to Catalina.

@simtr
Copy link
Member

simtr commented Apr 19, 2021

This is particularly unusual because we handle the framebuffer and the drawing of in-game dialogues and overlays. At first glance, it doesn't seem possible that opening a dialogue could behave differently with screen recording or fullscreen.

Edit: After a second look, there could be an issue with ui::Engine::setSize (called by window resizing) not changing the lastBuffer buffer size, however, it's not clear if it could be triggered in this scenario

lastBuffer = (pixel*)malloc((width_ * height_) * PIXELSIZE);

memcpy(g->vid, lastBuffer, (width_ * height_) * PIXELSIZE);

void Engine::SetSize(int width, int height)
{
width_ = width;
height_ = height;
}

lastBuffer is a snapshot of the framebuffer as it was before a new window is being shown, and is drawn copied back onto the framebuffer as a backdrop for dialogues that display as an overlay.

@josephazrak Do you see the same graphical glitches when you open a fullscreen window (such as the save browser)?

@josephazrak
Copy link
Author

josephazrak commented Apr 19, 2021

@simtr It sounds like we're heading in the right direction. I've gone ahead and tested the bug for these windows:

name, on window open / on window close

  1. Fullscreen save browser, no glitch / no glitch
  2. Local save browser (not fullscreen), glitch appears / glitch appears
  3. Save simulation to hard drive, glitch appears / glitch appears
  4. Element search, glitch appears / glitch appears
  5. Upload new simulation, glitch appears / glitch appears

Up to now, it looks like fullscreen interface windows are immune to the glitch and all non-fullscreen windows display it. However, this is not true for some very specific non-fullscreen windows:

  1. Manage tags, no glitch / no glitch
  2. Profile view window, no glitch / no glitch
  3. Server login window (user/pass fields), glitch appears / glitch appears
  4. Simulation options, no glitch / no glitch

@LBPHacker
Copy link
Member

@josephazrak Can you still reproduce this with recent stable versions or snapshots?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Broken implemented but broken
Projects
None yet
Development

No branches or pull requests

3 participants