[Interest] OpenGL cpu benchmark QtQuick vs OSX Native
Bruno Di Giorgi
bruno at brunodigiorgi.it
Mon Sep 7 18:10:23 CEST 2015
Hi Gunnar,
Thank you for the reply,
> Is the Native OSX application also rendering via a framebuffer?
As far as I understand there might in fact be a difference of one FBO between the Native OS X and the QtQuick version.
Though this may depend on the implementation of the NSOpenGLView:
- if NSOpenGLView creates an FBO then no, there is no difference
- if NSOpenGLView give me access directly to the window buffer, then yes QtQuick drawing may go through one FBO (QQuickFramebufferObject) more.
Regarding your second question
> Is the same symptom present when you render directly to the QQuickWindow using for instance the beforeRendering() signal?
I’ll do some benchmark and answer you asap.
Best,
Bruno
> Il giorno 07/set/2015, alle ore 07:35, Gunnar Sletta <gunnar at sletta.org> ha scritto:
>
> Hi Bruno,
>
> Is the Native OSX application also rendering via a framebuffer? On an Intel GPU rendering via an FBO will add considerable cost. Is the same symptom present when you render directly to the QQuickWindow using for instance the beforeRendering() signal? (http://doc.qt.io/qt-5/qtquick-scenegraph-openglunderqml-example.html)
>
> cheers,
> Gunnar
>
>> On 04 Sep 2015, at 09:06, Bruno Di Giorgi <bruno at brunodigiorgi.it> wrote:
>>
>> Dear mailing list,
>>
>> First time I write here, I posted this yesterday on the QtQuick forum and a user recommended me to post on this mailing list.
>>
>> I noticed some heavy cpu usage in a QtQuick (using Qt5.5) osx app compared to an equivalent Native OSX app. Around 5% more cpu usage with a simple app, up to 15% more with more complex OpenGL tasks.
>>
>> Both are using Core profile
>> Version: 4.1 INTEL-10.6.33
>> GLSL: 4.10
>>
>> In QtQuick I do openGL inside a QQuickFramebufferObject as I've seen advised many times.
>> In OSX I draw inside a subclass of NSOpenGLView.
>>
>> Here are the OpenGL Profiler statistics: http://pastebin.com/uWyy8RMk
>> Where you can see that CGLFlushDrawable takes so much longer in QtQuick (avg 15418.39 microsec) than in Native OSX App (avg 1287.65 microsec).
>>
>> I know that what CGLFlushDrawable really does is to set the internal OpenGL state and then do the drawing, so I wonder if I am misusing QtQuick OpenGL somehow. Here is how I set up OpenGL in QtQuick app:
>>
>> QSurfaceFormat f;
>> f.setVersion(4, 1);
>> f.setProfile(QSurfaceFormat::CoreProfile);
>> QSurfaceFormat::setDefaultFormat(f);
>>
>> Then, when setting the framebuffer (inside QQuickFramebufferObject::Renderer method createFramebufferObject):
>>
>> QOpenGLFramebufferObjectFormat format;
>> format.setAttachment(QOpenGLFramebufferObject::Depth);
>> format.setInternalTextureFormat(GL_RGB);
>> format.setSamples(0);
>>
>> I really hope there is a solution that makes me achieve similar performance because I really enjoy QML and I'd like to continue using it.
>>
>> Hardware used:
>> MacBookPro 13'' with retina screen,
>> cpu: 3 GHz Intel Core i7
>> gpu: Intel Iris 1536 MB
>>
>> Best,
>> Bruno Di Giorgi
>>
>> _______________________________________________
>> Interest mailing list
>> Interest at qt-project.org
>> http://lists.qt-project.org/mailman/listinfo/interest
>
More information about the Interest
mailing list