Bug 300339 - Painting is very laggy using opengl since the "trilinear filtering" patch
Summary: Painting is very laggy using opengl since the "trilinear filtering" patch
Status: RESOLVED DUPLICATE of bug 300668
Alias: None
Product: krita
Classification: Applications
Component: General (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR major
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
: 313492 (view as bug list)
Depends on: 300668
Blocks:
  Show dependency treegraph
 
Reported: 2012-05-20 00:19 UTC by animtim
Modified: 2013-09-26 19:15 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description animtim 2012-05-20 00:19:35 UTC
Since my last update, I can't paint anymore in Krita, it's really too laggy :(

It seems to be due to the trilinear filtering on the canvas change, and to appear only on NVIDIA graphics card (ahiemstra told me it's the only kind of hardware he doesn't have, so I guess he tested on ati and intel based cards).

So since this change, using nvidia proprietary driver, painting is very slow/broken, and using nouveau driver it is completly broken: it doesn't display strokes on canvas at all, and opening a .kra file shows weird random/broken tiles. I want to precise here that opengl in Krita worked perfectly with both nvidia driver and nouveau on my laptop before this change (and actually even better with nouveau than the nvidia blob in latest ubuntu) .

And the worst thing is I can't go back to no-opengl canvas, as then painting is fine but it has issues to display canvas rotation and panning (very slow, and ghost canvas parts on the borders outside when rotating), the brush outline cursor is kinda blinking/more distractive, and probably a few others things that don't work as good as with opengl. But then this is for another bug report.

So please either roll-back this change, or find a way to fix this huge regression issue.
Comment 1 Halla Rempt 2012-05-20 06:25:58 UTC
Hm, is the qpainter canvas slowness also recent? The panning slowness might have been caused by my enabling smoothing -- maybe the pan tool should disable smoothing and enable it when done.

Arjen is working on a new version of the opengl canvas, not sure how far along he is! Maybe we should make the current code path an option until he's done, since it apparently works fine for other people, who had problems with the old code path...
Comment 2 animtim 2012-05-20 10:49:41 UTC
About the Qpainter canvas slowness, as far as I can remember it has always had the issues I describe above. But I've almost always worked with opengl, desactivated it mostly to make some test to compare, so I can't say for sure if it's slower now.
Comment 3 Ico_dY 2012-05-20 19:48:24 UTC
No problem for me: Krita, latest git from main branch, is FAST working with a Nvidia 9500 GT on a canvas of 6000x4800 pixels/15 levels , particularly with the Nouveau driver. I'm on Xubuntu Precise... ^^ 
The only strange thing is the no centered canvas when zooming, but the performance are very good...
Comment 4 Halla Rempt 2012-05-20 19:49:45 UTC
I hate hardware... Animtim, what's the exact type of your card, and how much memory do you have?

Ah, the canvas centering on zooming is a known bug; dmitry is working on that.
Comment 5 animtim 2012-05-20 21:25:38 UTC
On my desktop:
-Nvidia 9800GT 512MB; 4Go RAM.
Only tested with nvidia blob here. Display is good but painting is slow. I tried do do a clean build here, no change.

On my laptop:
-Nvidia GT 320M 1024MB; 4Go RAM.
Tested Nouveau here. Display is broken/unusable here (as explained on original post). Maybe I should do a clean build, as Ico-dy have it working, I wonder why it bugs here.
Comment 6 animtim 2012-05-20 22:42:48 UTC
:(
A clean rebuild on the laptop didn't change anything, still this strange bug
(drawing on the canvas, nothing is displayed/canvas stays white, only the layer thumbnail show the strokes; same thing when opening an existing file, it's not properly displayed, weird tiles bug).
Comment 7 LukasT 2012-05-21 07:13:00 UTC
I can confirm slow painting with trilinear filtering in OpenGL canvas.

Maybe we should add option to configuration to select scaling canvas quality (similarly to what KWin has in System Settings in Advanced tab)

Card: NVidia 9200M
driver: proprietary binary blob
Comment 8 Ico_dY 2012-05-21 07:40:58 UTC
Animtim, Lukas, have you tried the latest Nvidia driver? http://www.nvidia.com/object/unix.html
Do you have the compositing enabled?
Comment 9 LukasT 2012-05-21 15:20:33 UTC
I'm using Fedora package from rpmfusion repositary. It's not advised to Fedora users to install the driver directly from the website as NVidia package some stuff that causes problems in Fedora, some libX*** library.

I have compositing enabled.
Comment 10 animtim 2012-05-21 15:32:33 UTC
I only tried the ones in repository.
I had "current version" installed, I've switched to "post release update version", but the latest released is not there yet (the one I've installed now is 295.49 )
Comment 11 Halla Rempt 2012-05-21 15:41:26 UTC
Could yo utry with compositing disabled?
Comment 12 Ico_dY 2012-05-21 17:25:48 UTC
Ok, I've tried too with Nvidia proprietary driver, version 295.40...
Result: Under Xfce with/without compositing enabled and under Xfce+Openbox without compositing enabled Krita is fast and smooth. ^^
Comment 13 Arjen Hiemstra 2012-05-21 17:33:57 UTC
Actually, after some more investigation by animtim and me, we found out the actual issue, which is that input is limited to the refresh of the canvas. It is very noticable when making fast circles on the canvas, with the OpenGL canvas strokes become jagged and distorded, with the QPainter canvas everything is smooth.
Comment 14 Halla Rempt 2013-01-19 11:20:00 UTC
*** Bug 313492 has been marked as a duplicate of this bug. ***
Comment 15 Dmitry Kazakov 2013-01-20 07:16:06 UTC
Git commit f1c7e5d5fae79773cbdb96bcc4ac403bf247c967 by Dmitry Kazakov.
Committed on 20/01/2013 at 07:59.
Pushed by dkazakov into branch 'master'.

Added a workaround for OpenGL bended lines

There are two reasons why the lines might become bended:
1) swapBuffers() call waits for the display VSync for about 6 ms, all the
   events seem to be dropped during this time.
2) When painting very *huge* circles with very small brush
   (circles ~ 3000px in diameter, brush ~5px) some another factor
   appears. I cannot tell for sure, but this is, probably, texture loading.

This patch fixes only the first (!) reason of line bending.
First, it asks Qt to use single buffered contexts. Then, if a single
buffered context is not available, it asks openGL to disable VSync.

M  +10   -2    krita/ui/opengl/kis_opengl_canvas2.cpp
A  +206  -0    krita/ui/opengl/kis_opengl_canvas2_p.h     [License: GPL (v2+)]

http://commits.kde.org/calligra/f1c7e5d5fae79773cbdb96bcc4ac403bf247c967
Comment 16 Dmitry Kazakov 2013-01-20 10:48:21 UTC
Git commit 5d00100936c1c7b2420bc27238a6fa7eacb82e8d by Dmitry Kazakov.
Committed on 20/01/2013 at 07:59.
Pushed by dkazakov into branch 'krita-fixed-transform-kazakov'.

Added a workaround for OpenGL bended lines

There are two reasons why the lines might become bended:
1) swapBuffers() call waits for the display VSync for about 6 ms, all the
   events seem to be dropped during this time.
2) When painting very *huge* circles with very small brush
   (circles ~ 3000px in diameter, brush ~5px) some another factor
   appears. I cannot tell for sure, but this is, probably, texture loading.

This patch fixes only the first (!) reason of line bending.
First, it asks Qt to use single buffered contexts. Then, if a single
buffered context is not available, it asks openGL to disable VSync.

M  +10   -2    krita/ui/opengl/kis_opengl_canvas2.cpp
A  +206  -0    krita/ui/opengl/kis_opengl_canvas2_p.h     [License: GPL (v2+)]

http://commits.kde.org/calligra/5d00100936c1c7b2420bc27238a6fa7eacb82e8d
Comment 17 Dmitry Kazakov 2013-01-24 11:38:09 UTC
Git commit abe5d845ec59f2373d288d8e09b61dba9c84adc9 by Dmitry Kazakov.
Committed on 20/01/2013 at 07:59.
Pushed by dkazakov into branch 'calligra/2.6'.

Added a workaround for OpenGL bended lines

There are two reasons why the lines might become bended:
1) swapBuffers() call waits for the display VSync for about 6 ms, all the
   events seem to be dropped during this time.
2) When painting very *huge* circles with very small brush
   (circles ~ 3000px in diameter, brush ~5px) some another factor
   appears. I cannot tell for sure, but this is, probably, texture loading.

This patch fixes only the first (!) reason of line bending.
First, it asks Qt to use single buffered contexts. Then, if a single
buffered context is not available, it asks openGL to disable VSync.

M  +10   -2    krita/ui/opengl/kis_opengl_canvas2.cpp
A  +206  -0    krita/ui/opengl/kis_opengl_canvas2_p.h     [License: GPL (v2+)]

http://commits.kde.org/calligra/abe5d845ec59f2373d288d8e09b61dba9c84adc9
Comment 18 Halla Rempt 2013-09-26 19:15:21 UTC

*** This bug has been marked as a duplicate of bug 300668 ***