[Marble-devel] Re: Review Request: Multi-threaded texture mapping in Marble

Bernhard Beschow bbeschow at cs.tu-berlin.de
Sat May 21 16:40:45 CEST 2011



> On May 21, 2011, 2:10 p.m., Torsten Rahn wrote:
> > Insanely Great :-)
> > 
> > I tested the Qt-Only version with various settings and ran through lots of use cases that I  could think of which might pose a problem on a Dual CPU machine:
> > 
> > trah at horst:~/marble-1.1/qt_marble_build> cat /proc/cpuinfo 
> > processor       : 0
> > vendor_id       : GenuineIntel
> > cpu family      : 6
> > model           : 23
> > model name      : Genuine Intel(R) CPU           U7300  @ 1.30GHz
> > stepping        : 10
> > cpu MHz         : 800.000
> > cache size      : 3072 KB
> > physical id     : 0
> > siblings        : 2
> > core id         : 0
> > cpu cores       : 2
> > apicid          : 0
> > initial apicid  : 0
> > fdiv_bug        : no
> > hlt_bug         : no
> > f00f_bug        : no
> > coma_bug        : no
> > fpu             : yes
> > fpu_exception   : yes
> > cpuid level     : 13
> > wp              : yes
> > flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc arch_perfmon pebs bts pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 xsave lahf_lm tpr_shadow vnmi flexpriority
> > bogomips        : 2593.45
> > clflush size    : 64
> > power management:
> > 
> > processor       : 1
> > vendor_id       : GenuineIntel
> > cpu family      : 6
> > model           : 23
> > model name      : Genuine Intel(R) CPU           U7300  @ 1.30GHz
> > stepping        : 10
> > cpu MHz         : 800.000
> > cache size      : 3072 KB
> > physical id     : 0
> > siblings        : 2
> > core id         : 1
> > cpu cores       : 2
> > apicid          : 1
> > initial apicid  : 1
> > fdiv_bug        : no
> > hlt_bug         : no
> > f00f_bug        : no
> > coma_bug        : no
> > fpu             : yes
> > fpu_exception   : yes
> > cpuid level     : 13
> > wp              : yes
> > flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc arch_perfmon pebs bts pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 xsave lahf_lm tpr_shadow vnmi flexpriority
> > bogomips        : 2593.38
> > clflush size    : 64
> > power management:
> > 
> > I didn't have a single crash. The only thing I long for now is threaded tile access. Then we can finally enable the checkmark for the "Animated Voyage" by default.

Thanks for your reviews!

I've tackled sluggish behavior in a separate branch, where I get nice animated voyages. Stay tuned!


- Bernhard


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/101378/#review3441
-----------------------------------------------------------


On May 17, 2011, 3:38 p.m., Bernhard Beschow wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/101378/
> -----------------------------------------------------------
> 
> (Updated May 17, 2011, 3:38 p.m.)
> 
> 
> Review request for Marble.
> 
> 
> Summary
> -------
> 
> This patch changes the scanline texture mappers to render textures with multiple threads.
> The number of threads is determined using QThread::idealThreadCount().
> The patch consists of two commits [1], where the first one refactors and cleans up the texture mappers, whereas the second one introduces the threading.
> 
> In the first commit, a class named ScanlineTextureMapperContext is introduced, which holds the state for performing scanline texture mapping. It was factored out of the AbstractScanlineTextureMapper class, which is now named "TextureMapperInterface". Fresh ScanlineTextureMapperContexts are created upon every rendering action, which is cleaner than the former approach of reinitializing all rendering attributes in AbstractScanlineTextureMapper::setRadius(). Finally, the patch constifies many variables in the texture mappers and removes some unneeded code.
> 
> In the second commit, threads are used for texture rendering. Almost all rendering logic has been moved into QRunnable implementations, which are recreated for every frame. Since each QRunnable instantiates its own ScanlineTextureMapperContext, the contexts are recreated for every frame as well.
> 
> Due to synchronization overhead for tile acces, the patch may cause a small performance regression. I couldn't measure any big difference on a single-core machine, though.
> 
> [1] https://github.com/shentok/marble/tree/threaded-rendering
> 
> 
> Diffs
> -----
> 
>   src/lib/AbstractScanlineTextureMapper.h 1998db0 
>   src/lib/AbstractScanlineTextureMapper.cpp 8acf57c 
>   src/lib/CMakeLists.txt f5d49c0 
>   src/lib/EquirectScanlineTextureMapper.h 05e6639 
>   src/lib/EquirectScanlineTextureMapper.cpp 8f697cc 
>   src/lib/MarbleMap.cpp 6f5f54f 
>   src/lib/MercatorScanlineTextureMapper.h a79d1c8 
>   src/lib/MercatorScanlineTextureMapper.cpp bdf9b0c 
>   src/lib/ScanlineTextureMapperContext.h PRE-CREATION 
>   src/lib/ScanlineTextureMapperContext.cpp PRE-CREATION 
>   src/lib/SphericalScanlineTextureMapper.h f336282 
>   src/lib/SphericalScanlineTextureMapper.cpp 583630a 
>   src/lib/StackedTileLoader.cpp b67cb98 
>   src/lib/TextureLayer.cpp d98f712 
>   src/lib/TextureMapperInterface.h PRE-CREATION 
>   src/lib/TextureMapperInterface.cpp PRE-CREATION 
>   src/lib/TileLoader.cpp 1b85dda 
>   src/lib/TileScalingTextureMapper.h 2c70dad 
>   src/lib/TileScalingTextureMapper.cpp 2ec719f 
>   src/lib/global.h a5c25fb 
> 
> Diff: http://git.reviewboard.kde.org/r/101378/diff
> 
> 
> Testing
> -------
> 
> Here are some numbers of a benchmark using OSM:
> 
> I get the following speedups on an Atom N270 (two Hyperthreads):
> o globe projection:
>   low quality:     ~29 -> ~32 fps
>   outline quality: ~20 -> ~25 fps
>   high quality:     ~5 ->  ~7 fps
> o flat projection:
>   low quality:     ~33 -> ~36 fps
>   outline quality: ~23 -> ~26 fps
>   high quality:     ~7 ->  ~9 fps
> o mercator projection:
>   low quality:     ~32 -> ~35 fps
>   outline quality: ~22 -> ~26 fps
>   high quality:     ~7 ->  ~9 fps
> 
> Earthwings gets the following speedups for globe projection on an Intel(R) Core(TM)2 Quad CPU Q8200 @ 2.33GHz (four "real" threads):
> low quality:     ~57 -> ~66 fps
> outline quality: ~37 -> ~48 fps
> high quality:    ~14 -> ~30 fps
> 
> I get about the same results before and after the patch is applied on a single-core machine.
> 
> 
> Thanks,
> 
> Bernhard
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/marble-devel/attachments/20110521/16ff9743/attachment.htm 


More information about the Marble-devel mailing list