[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-kimageshop
Subject:    Optimizing OpenGL canvas with partial updates
From:       Dmitry Kazakov <dimula73 () gmail ! com>
Date:       2016-02-13 21:48:29
Message-ID: CAEkBSfXofFM3MpJKr3CuStNpTjvcfKUiO2nKeu6eWODjhOHfuA () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi, all!

Today I was talking to Maxim (Salabar) and we found quite an interesting
idea, which could optimize our openGL rendering pipeline a lot, and would
make our dependency on glSync less important (glSync is an extension, and
it is not present on some (older) GPUs).

The point is that starting with Qt 5, our paintGL() implementation does not
draw our canvas directly on screen. Instead it is drawn on an internal Qt's
framebuffer, which is (later) painted on screen buffers, which are swapped
double buffering. I'm not going to discuss whether such global decision in
Qt is good or bad, but for us it means that now we can use partial updates,
which (starting with Qt5.5) can be activated with a special call
QOpenGLWidget::setUpdateBehavior(). What does it mean? It means that we
shouldn't repaint the whole canvas every time and we need *not* spend quite
a lot of time in our High Quality scaling shader, which is really slow.
Instead, we can update only a portion of the screen, spend a little time on
shading this small portion and store in this internal Qt's buffer. Of
course in some special cases glSync will still be needed, but I bet that in
90% of the use cases such partial updates will execute really fast!

What do you think about this idea?


-- 
Dmitry Kazakov

[Attachment #5 (text/html)]

<div dir="ltr"><div><div><div>Hi, all!<br><br></div>Today I was talking to Maxim \
(Salabar) and we found quite an interesting idea, which could optimize our openGL \
rendering pipeline a lot, and would make our dependency on glSync less important \
(glSync is an extension, and it is not present on some (older) \
GPUs).<br><br></div>The point is that starting with Qt 5, our paintGL() \
implementation does not draw our canvas directly on screen. Instead it is drawn on an \
internal Qt&#39;s framebuffer, which is (later) painted on screen buffers, which are \
swapped double buffering. I&#39;m not going to discuss whether such global decision \
in Qt is good or bad, but for us it means that now we can use partial updates, which \
(starting with Qt5.5) can be activated with a special call \
QOpenGLWidget::setUpdateBehavior(). What does it mean? It means that we shouldn&#39;t \
repaint the whole canvas every time and we need *not* spend quite a lot of time in \
our High Quality scaling shader, which is really slow. Instead, we can update only a \
portion of the screen, spend a little time on shading this small portion and store in \
this internal Qt&#39;s buffer. Of course in some special cases glSync will still be \
needed, but I bet that in 90% of the use cases such partial updates will execute \
really fast!<br><br></div>What do you think about this idea?   <br><div><div><div><br \
clear="all"><div><div><br>-- <br><div class="gmail_signature">Dmitry Kazakov</div> \
</div></div></div></div></div></div>


[Attachment #6 (text/plain)]

_______________________________________________
Krita mailing list
kimageshop@kde.org
https://mail.kde.org/mailman/listinfo/kimageshop


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic