gamescope icon indicating copy to clipboard operation
gamescope copied to clipboard

Uneven scaling at native resolution on Wayland backend

Open bandithedoge opened this issue 1 year ago • 7 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Are you using any gamescope patches or a forked version of gamescope?

  • [X] The issue occurs on upstream gamescope without any modifications

Current Behavior

When running an app at native resolution, a small gap around the middle of the screen resembling a scaling artifact can be noticed. This issue appears consistently with any combination of game, compositor, nested resolution and scaling settings on both the latest release available and latest commit. It does not appear with the SDL backend.

Steps To Reproduce

No response

Hardware information

- Distro: NixOS 24.11.20241029.30c9efe
- CPU: Intel Core i7-4790
- GPU: AMD Radeon Pro W5500
- Driver Version: Mesa 24.3.0-devel

Software information

- Desktop environment: Hyprland
- Session type: wayland
- Gamescope version: `gamescope version 3.15.13 (gcc 13.3.0)`
- Gamescope launch command(s): `gamescope -f -w 1920 -h 1080 -W 1920 -H 1080 --mangoapp`

Which gamescope backends have the issue you are reporting?

  • [x] Wayland (default for nested gamescope)
  • [ ] DRM (default for embedded gamescope, i.e. gamescope-session)
  • [ ] SDL
  • [ ] OpenVR

Logging, screenshots, or anything else

2024-11-11_19:03:19 This is what it looks like on a Wayland compositor that uses nearest neighbor scaling for windows (Sway). Take a close look at the cursor image and the letter "g" in "Load game".

2024-11-11_19:02:30 Things are blurry on compositors that use filtering for scaled windows such as Hyprland. This is best seen with things like Mangohud, notice how the text in the middle part looks smudged compared to the top.

2024-11-11_19:08:27 This is more obvious on certain 3D objects - FXAA is turned on in the game, yet there is noticeable aliasing along the roof of this building.

bandithedoge avatar Nov 11 '24 18:11 bandithedoge

Is your desktop scaled? Are you able to check whether https://github.com/ValveSoftware/gamescope/pull/1630 fixes your issue? (or makes it worse)

ColinKinloch avatar Nov 23 '24 16:11 ColinKinloch

None of my displays are scaled and the issue persists with #1630.

bandithedoge avatar Nov 23 '24 17:11 bandithedoge

Could this be related to the following issues/PRs? https://github.com/ValveSoftware/gamescope/pull/1494 and https://github.com/ValveSoftware/gamescope/issues/1493

I've noticed blurriness and smudging as well, although I'm running on native resolutions and although I'm building via Nix on GCC. Testing out a build without -ffast-math seems to resolve this.

kitten avatar Nov 29 '24 15:11 kitten

I just set up a simple package override in my NixOS configuration that adds -fno-fast-math and it appears to have fixed this issue.

If any other Nix users are looking for a quick workaround:

programs.gamescope = {
  enable = true;
  package = pkgs.gamescope.overrideAttrs (_: {
    NIX_CFLAGS_COMPILE = ["-fno-fast-math"];
  });
};

It's safe to say that #1494 will close this.

bandithedoge avatar Nov 29 '24 17:11 bandithedoge

Replying to https://github.com/ValveSoftware/gamescope/issues/1622#issuecomment-2508182530

thank you, your nixpkgs override also solved the problem for me. Games are crispy again!!

fxzzi avatar Jan 08 '25 12:01 fxzzi

reply to https://github.com/ValveSoftware/gamescope/issues/1622#issuecomment-2508182530

I can confirm that this solves the issue of the image being blurry when used in tandem with hyprland nested mode.

neon-grim avatar Oct 11 '25 02:10 neon-grim

Can also confirm that this nix expression fixes it! thank you so much!

skoove avatar Oct 17 '25 05:10 skoove