ValveSoftware / Dota-2

Tracker for issues specific to Linux and Mac in the Reborn client. If you have a general issue or non-system-specific feature request please go to dev.dota2.com
469 stars 38 forks source link

[Mac OS] Cursor scaling on Retina display causes severe FPS drops and stutters #1460

Open gleyfer opened 6 years ago

gleyfer commented 6 years ago

Your system information

https://gist.github.com/gleyfer/907c5affccd4bcf6485e13bb2ff65221

Please describe your issue in as much detail as possible:

Describe what you expected should happen and what did happen. Please link any large pastes as a Github Gist.

On a Macbook with retina display, the default option in settings is to "Automatically select cursor size". What this does on a Retina display is it scales the cursor to fit a 4K resolution, even though I'm only running the game at the point resolution of 1440x900 (this is a bug for another day). However, more importantly, it absolutely tanks the performance of the game. It turns out that If I scale the cursor at all from 100% to anything higher, the performance tanks (FPS drops by 20-30, freezes, stutters, etc). If I uncheck the automatic scaling, and just set the scale to 100%, FPS is smooth, no more stutters, etc.

There definitely seems to be some bug or CPU related issue (perhaps cursor being scaled in software, etc) which is causing a pretty noticeable performance drop when cursor scaling is used.

Steps for reproducing this issue:

  1. Install Dota 2 on Mac with Retina Display
  2. Play the game in the default desktop friendly full screen at the point resolution (1440x900 or whatever)
  3. Experience stutters and bad FPS.

EDIT: Just want to add that the gist was taken with external monitors connected, but I was reproducing the issue with no external monitors connected and only the retina built-in display.

gdrewb-valve commented 6 years ago

Dota uses SDL for cursor handling so assigning to the SDL dev, although I think there's a decent chance this is a macOS issue that Apple would need to look at.

gleyfer commented 6 years ago

Agreed that this may be a MacOS issue, but for the time being, it may be worth to disable the cursor scaling by default or set the scale to 100% by default for MacOS unless the user is using a hiDPI resolution (4k).

I happened to find this completely by chance (the cursor was huge and I disabled the scaling/set it to 100% and then also noticed, hey the game runs really smooth now and was laggy/stuttery before). Someone else may not be so lucky.