-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Description
ref #11
Improvements/current state
- Sphere initialization uses opencl with vectorisation, but does not pass ownership to opengl.
- Ring initialization uses openmp.
- Quad is two separate triangles.
- Creating a texture loads an image to host memory and then passes to device memory.
- libjpeg is compiled as libturbojpeg, which uses cpu simd extensions like avx/neon http://libjpeg-turbo.virtualgl.org: 2-6 times faster.
- Now loading png images directly to
data
buffer, no host-host image copying in the code.
Failures/restrictions
- Could not take advantage of opengl-opencl interop because nothing implements it.
- Could not parallelize image loaing with openmp: segfault, probably libpng does not allow it.
Possible improvements
- https://stackoverflow.com/questions/10827247/parallelization-of-png-file-creation-with-c-libpng-and-openmp#10827676 to parallelize png creation
- glsl compute shaders instead of opencl.
- Could try use asynchronous data transfer in opengl http://www.songho.ca/opengl/gl_pbo.html.
Current results
font init: 839
sphere init: 1866306
ring1 init: 4748
ring2 init: 6709
ring3 init: 9532
quad init: 680
load image 'textures/earth_clouds.png': 243207
create texture 'textures/earth_clouds.png': 298590
load image 'textures/venus_clouds.png': 149321
create texture 'textures/venus_clouds.png': 13418
load image 'textures/sun.png': 35519
create texture 'textures/sun.png': 13589
load image 'textures/mercury.png': 30094
create texture 'textures/mercury.png': 13144
load image 'textures/venus.png': 35647
create texture 'textures/venus.png': 9371
load image 'textures/earth.png': 26670
create texture 'textures/earth.png': 11389
load image 'textures/moon.png': 23432
create texture 'textures/moon.png': 7372
load image 'textures/mars.png': 28579
create texture 'textures/mars.png': 8545
load image 'textures/jupiter.png': 27976
create texture 'textures/jupiter.png': 10219
load image 'textures/saturn.png': 23572
create texture 'textures/saturn.png': 9289
load image 'textures/uranus.png': 21781
create texture 'textures/uranus.png': 8345
load image 'textures/neptune.png': 25675
create texture 'textures/neptune.png': 8756
load image 'textures/pluto.png': 28038
create texture 'textures/pluto.png': 9471
load image 'textures/saturn_ring.png': 10073
create texture 'textures/saturn_ring.png': 4466
load image 'textures/uranus_ring.png': 10627
create texture 'textures/uranus_ring.png': 4017
load image 'textures/tester_ring.png': 16400
create texture 'textures/tester_ring.png': 8141
load image 'textures/menubackground.jpg': 21929
cre
ate texture 'textures/menubackground.jpg': 24537
load image 'textures/button.png': 2451
create texture 'textures/button.png': 3424
load image 'textures/button_sel.png': 2210
create texture 'textures/button_sel.png': 2032