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

Linux - OpenGL content jitter on window vertical resize #11618

Open
andoryu opened this issue Dec 9, 2024 · 0 comments
Open

Linux - OpenGL content jitter on window vertical resize #11618

andoryu opened this issue Dec 9, 2024 · 0 comments

Comments

@andoryu
Copy link

andoryu commented Dec 9, 2024

I have identified an issue with window contents jittering on Linux with a vertical window resize, but not with horizontal resize.

Last commit I tested with was 123306b - xsync

I experimented with several things to resolve:

  • based on the behaviour I tried changing the bit_gravity setting for XWindowCreate as the default might have been the cause. No change.
  • tried re-drawing the window contents as quickly as possible with:
    GL_Swap_Interval(0);
    GL_SwapBuffers();
    GL_Swap_Interval(1);

in the Expose event handler. This improved the jitter significantly, but did not remove it entirely.

  • in the end I updated my test code to only:
    • update with window size in the Resize event
    • set a redraw flag in the Expose event
    • update the contents once in the SDL_AppIterate iterate once per Expose event.

This final experiment made the display completely jitter free.

When the if statement on line 176 is changed to

if(true)
{
  //update projection
  //draw, etc...
}

the jitter returns.

This has been verified on another, different Linux distro with a different video card.

It looks to me like there is some race condition or variation in the window size or origin parameters during resize - but only for vertical resizing.

Example code is available here:
https://github.com/andoryu/sdl3-test

Please note the test code is in work-around state and the if statement change noted above will need to be made to make it misbehave.

The single write update flag feels like a work around and not a great solution.

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

1 participant