Better performance for custom-shader-animation option
#8818
Replies: 2 comments
-
|
This is a known area that could do with some improvements. Quoting from the docs on
When we first merged the cursor trail PR Mitchell mentioned that we should implement cursor trails as a first-class feature rather than an available input for custom shaders since we would be able to optimize and only draw the animation when the cursor moves, but I think your idea of only ticking the animation depending on certain events could be a possible way forwards as well. I'm just not sure what other events we could include there (maybe we could introduce some sort of damage tracking as well?) |
Beta Was this translation helpful? Give feedback.
-
On this specific point: On both macOS and Linux, we defer to the underlying system to tell us our vsync windows. macOS especially tends to use variable rates dictated by the power scheduler. In any case, we don't control this. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Custom shaders are an interesting feature, but prohibitively wasteful for constant usage, at least in my case.
Here's radeontop on idle with and without a no-op shader on a 5700xt with ghostty in full screen, 4k (note that it's also quite spiky, but these weren't cherry picked in favour or disfavour of my point). The laptop gets it worse.
With, always @ ~120Hz:
Without, @ ~45 Hz:
The shader used for testing:
A part of this is that ghostty will never drop below ~120Hz when the shader is enabled on my system, though it drops to the minimum ~44-48Hz with it disabled. I do get why, though I'm not sure why it doesn't just peg it at maximum when running the shader (144Hz in my case). Beside the point I suppose?
Not sure what the better approach would be to improve on this, but I was thinking of 2 things:
An option to set
custom-shader-animationsomewhere between true and false, as a cool down period. E.g.:custom-shader-animation = 0.5 # secondsPossibly a way to configure triggers could be interesting too. I.e. a
custom-shader-trigger = cursor. Other values could bepaneorwindowor<interval in seconds>, and so on I guess?I'm assuming this would also allow the fps to go down after the cool down.
An example is cursor trailing functionality, which has been suggested it could become a core feature precisely as a way to improve efficiency. But that's currently not implemented and, in any case, will always fall short of the customization aspect.
Beta Was this translation helpful? Give feedback.
All reactions