So, I think I figured out the right invocation of parameters to make kwin_x11 run properly with nvidia. This manifests as the environment variables that need to be loaded early, or at least when replacing kwin.
$ cat ~/.config/plasma-workspace/env/kwin.sh
export KWIN_TRIPLE_BUFFER=1
export __GL_YIELD=USLEEP
export __GL_MaxFramesAllowed=1
KWIN_TRIPLE_BUFFER=1 is required to tell KDE that we’re using triple buffering
__GL_YIELD=USLEEP prevents kwin from spinning too fast and consuming too much CPU.
__GL_MaxFramesAllowed=1 prevents actual tearing in kwin and seems to fix a lot of micro stutter
It’s strange that kwin still can’t tell if nvidia is configured for triple buffering or not. Adding KWIN_TRIPLE_BUFFER=1 (or even 0 if triple buffering is disabled) is required since kwin almost always picks the wrong value with nvidia.
For the system as a whole, setting __GL_YIELD=USLEEP globally does help with responsiveness across the board, but I’m sure it reduces FPS in nearly all games. This is something you’ll definitely want to set per app or game to get the behavior/performance you’re looking for.
As for __GL_MaxFramesAllowed, I get the behavior I’m looking for by only applying it to kwin. Letting at default or setting to “3” for my entire desktop while kwin is set to “1” seems to fix micro stutter, tearing, and other weirdness that I don’t get with mesa based acceleration.
Hope this helps someone, this took a lot of experimentation to get right. And as usual, this may not apply to everyone but it does help with my configuration.