Skip to content

Conversation

@flibitijibibo
Copy link
Contributor

In SDL3 it's possible for the platform to refuse returning a good refresh rate, so we have to try as many options as we can. Numerator/Denominator is best, but sometimes we just get a float, and sometimes we don't even get that (I managed to repro this via Xwayland).

This ensures that if the WsiRational is ever invalid, it's almost certainly SDL's fault rather than dxvk's.

Copy link
Owner

@doitsujin doitsujin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the refresh_rate float being non-zero while numerator is zero something that actually intended behaviour? I was assuming the float to be more of a convenience thing that would be there in addition to the rational, but this doesn't seem to be very well documented.

Either way, patch looks good.

@flibitijibibo
Copy link
Contributor Author

I believe so, and I think this is just inherited from SDL2 only having refresh_rate at first - taking a quick look it looks like macOS/iOS/tvOS, Android, and OpenVR use this behavior.

@doitsujin doitsujin merged commit bb2068e into doitsujin:master Apr 3, 2025
4 checks passed
@flibitijibibo flibitijibibo deleted the sdl3-x11 branch April 3, 2025 21:43
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.

2 participants