Created by gzotti and last modified

It occurs to me that we have many redundant OpenGL state changes. I hope to reduce them a bit here.
The star zones are a big example: calling preDrawPointSource should have setup everything to call drawPointSource, but in there we have to repeat the blend ops. It would be helpful to find a way out here.
I use the AMD CodeXL and gDEbugger to find these issues, but am not the top expert on profiling. Let's see...

It is possible to track the should-be state of the most often switched states, and only forward it to the GPU when required. The biggest culprit is StelPainter::drawText(). This uses a QPainter, which garbles OpenGL state that has to be restored.

2016-02-03: On PC and Qt5.5.0 many OpenGL state switches have now been avoided. However, speed gain is negligible, the application is CPU limited (positional computations). On ARM boards (Mali GPU) there are still graphics issues. Those could at least slightly benefit from further work on this.

The independent speedup in the Meteor classes should be moved to trunk however.

Get this branch:
bzr branch lp:~stellarium/stellarium/gz_reduceOpenGLstateChanges
Members of Stellarium can upload to this branch. Log in for directions.

Branch merges

Related bugs

Related blueprints

Branch information


Recent revisions

8152. By gzotti

Stelpainter: restore OpenGL state after drawText(). Fixed all relevant calls in other classes. Result should be fine now. Massive savings in OpenGL state switching!

8151. By gzotti

a few fixes of inconsistent states, and addition of instrumentation to StelPainter to see how many state changes were avoided. drawText must definitely be fixed.

8150. By gzotti

update plugins to the new scheme. Unfortunately, StelPainter::drawText() breaks some of the expected benefit.

8149. By gzotti

Cached the most frequently switched OpenGL states for the main app (no plugins yet). It seems there is a speed boost :-)

8148. By gzotti

avoid needless OpenGL state changes for Comets

8147. By gzotti

Reduced OpenGL state switching for Meteors. (Sporadic and MeteorShower plugin). Instead of blend switches per meteor, use state switches per frame (sporadic) or at least per shower (plugin). Code is not cleaned up yet, but it works.

8146. By gzotti

A few first attempts to reduce redundant GL state changes

8145. By Alexander Wolf

Updating coding style for LocationDialog

8144. By treaves

Applying device pixel ratio to the pixmap, so that it displays correctly
on Mac's. I really do not think this should be needed, but, until we
get HiDPI images, it may be.

8143. By gzotti

Fixed (most) warning issues from Coverity Scan. (I cannot find warning reason for one, left note there.)

Branch metadata

Branch format:
Branch format 7
Repository format:
Bazaar repository format 2a (needs bzr 1.16 or later)
Stacked on:
This branch contains Public information 
Everyone can see this information.