glshim


If I'm going to have to rebuild torcs I might as well apply the fbo change in one go. So yeah, please post it too.
 
Here are a few interesting files. They all come from src/modules/graphics/ssggraph

Look for "SEB" and "USEFBO" to see the changes.

There are:

 * a few optim in grloadac, removing the "stripify" process (changing triangle to triangle_trip). while this porcess speedup things on desktop GL, you will prefer to minimise GLES call (at least on the Pandora).

 * grtrackmap use the trick on the minimap to force transparency, plus the map is drawn in a FBO to avoid the use of glReadPixel (not an optimisation here, but it's reuse of code from grcam...)

 * grcam as an FBO for mirror instead of glReadPixels (that's a huge optim on the Pandora, were the glReadPixel is very costy).

View attachment grloadac.cpp

View attachment grtrackmap.cpp

View attachment grcam.cpp

View attachment grcam.h
 
@ptitSeb, nice job and thanks! Now that the game is free of all glitches it's time to ask about the FPS. I'm getting between 5 and 10, a big jump from about 0.2 in software but still a little low for comfort. Is this your last word on the matter? ;)

Naturally the Mali driver quality (no pun intended) is sub-par or it would probably be close to playable already. Don't tell me it's better on your end?
 
Last edited by a moderator:
Sorry to say it's better on my end. On the Gigahertz model, I get between 13 and 30 fps, depending on the track and number of car on the screen.

Try to reduce the size of the Texture max size maybe, and the rendering screen size (Pandora use a 800x480 fixed size).

*EDIT* If you are not afraid of low res texture, here is another changed file (from src/libs/tgfclient) that max the texture to 256 pixel (instead of 2048).

View attachment 12572
 
Last edited by a moderator:
I already had the setting @ 512. Strangely, neither the screen nor the texture size seems to have much effect. Mali takes care of everything :D  

Maybe other odroids will fare better. Thanks again!
 
I already had the setting @ 512. Strangely, neither the screen nor the texture size seems to have much effect. Mali takes care of everything :D  

Maybe other odroids will fare better. Thanks again!

Well, do some profiling also (on the Pandora, I run a "sudo perf top" on a ssh session while the game is runing, this can be informative).

For torcs, I have found that "-flto -flto-odr-type-merging" from gcc 5.x are very effective... (along with traditionnal -ffast-math -mcpu=neon...)
 
With the full set of optimizations available in gcc 4.9.3 (short of a profile build) it's only slightly better so it's definitely the driver :)

EDIT: I think I'm gonna apply just the mini-map patch to see if the performance oriented patches made any difference.
 
Last edited by a moderator:
Well, the Mali driver probably has different strengths and weaknesses compared to Pandora's SGX driver.
 
@ptitSeb: nope, turns out the patches weren't doing anything for this system (completely moot now but the original `glutGet` modification is not enough to fix the map)
 
Last edited by a moderator:
Hi,


so i'm using glshim in different versions on an raspberry pi 2 with an fresh installed Jessie Image.


First i try the unstable Version from lunixbochs and have some issues you can see here:


https://github.com/lunixbochs/glshim/issues/146


Only the last few post interesting. I use an thermografic cam with the raspberry and want to render the image with the Text on it. The IR-CAM App is using freeglut and with software renderer ist extremly slow on fullscreen.


Text something like the temperature of some points etc. is not show correctly.


The only branch that works is the "actuallly working on it" lunixbochs unstable version i have cloned with git. In this i can use fullscreen with good performance.. but the text is not readable.


See the image here:


screen.jpg


BTW:


VC4 is not an option, because have no composite video out support, and i want to use both... HDMI and on other time Video Out.


So yesterday evening i had test the ptitSeb Version but fails in some missing calls like this:


undefined Symbol:
gl11_client_state_init


Have somebody some ideas?
 
Last edited by a moderator:
I'll try to have a look at why my build doesn't work on rpi (with no rpi, it's a bit tricky).


@nighteagle:I have tried something, if you can try to compile.
 
Last edited by a moderator:
int vcos_thread_running(VCOS_THREAD_T *thread);
^
/opt/vc/include/interface/vcos/vcos_thread.h:251:15: warning: inline function ‘vcos_change_preemption’ declared but never defined
VCOS_UNSIGNED vcos_change_preemption(VCOS_UNSIGNED pe);
^
/opt/vc/include/interface/vcos/vcos_thread.h:234:6: warning: inline function ‘vcos_thread_relinquish’ declared but never defined
void vcos_thread_relinquish(void);
^
/opt/vc/include/interface/vcos/vcos_thread.h:186:15: warning: inline function ‘vcos_thread_get_affinity’ declared but never defined
VCOS_UNSIGNED vcos_thread_get_affinity(VCOS_THREAD_T *thread);
^
In file included from /opt/vc/include/interface/vcos/vcos.h:185:0,
from /opt/vc/include/interface/vmcs_host/vc_dispmanx.h:33,
from /opt/vc/include/bcm_host.h:50,
from /home/pi/glshim/src/glx/glx.h:2,
from /home/pi/glshim/src/glx/glx.c:15:
/opt/vc/include/interface/vcos/vcos_timer.h:112:6: warning: inline function ‘vcos_timer_delete’ declared but never defined
void vcos_timer_delete(VCOS_TIMER_T *timer);
^
/opt/vc/include/interface/vcos/vcos_timer.h:109:6: warning: inline function ‘vcos_timer_reset’ declared but never defined
void vcos_timer_reset(VCOS_TIMER_T *timer, VCOS_UNSIGNED delay);
^
/opt/vc/include/interface/vcos/vcos_timer.h:102:6: warning: inline function ‘vcos_timer_cancel’ declared but never defined
void vcos_timer_cancel(VCOS_TIMER_T *timer);
^
/opt/vc/include/interface/vcos/vcos_timer.h:95:6: warning: inline function ‘vcos_timer_set’ declared but never defined
void vcos_timer_set(VCOS_TIMER_T *timer, VCOS_UNSIGNED delay);
^
/opt/vc/include/interface/vcos/vcos_timer.h:80:15: warning: inline function ‘vcos_timer_create’ declared but never defined
VCOS_STATUS_T vcos_timer_create(VCOS_TIMER_T *timer,
^
In file included from /opt/vc/include/interface/vcos/vcos.h:127:0,
from /opt/vc/include/interface/vmcs_host/vc_dispmanx.h:33,
from /opt/vc/include/bcm_host.h:50,
from /home/pi/glshim/src/glx/glx.h:2,
from /home/pi/glshim/src/glx/glx.c:15:
/opt/vc/include/interface/vcos/vcos_thread.h:269:6: warning: inline function ‘vcos_thread_resume’ declared but never defined
void vcos_thread_resume(VCOS_THREAD_T *thread);
^
/opt/vc/include/interface/vcos/vcos_thread.h:262:5: warning: inline function ‘vcos_thread_running’ declared but never defined
int vcos_thread_running(VCOS_THREAD_T *thread);
^
/opt/vc/include/interface/vcos/vcos_thread.h:251:15: warning: inline function ‘vcos_change_preemption’ declared but never defined
VCOS_UNSIGNED vcos_change_preemption(VCOS_UNSIGNED pe);
^
/opt/vc/include/interface/vcos/vcos_thread.h:234:6: warning: inline function ‘vcos_thread_relinquish’ declared but never defined
void vcos_thread_relinquish(void);
^
/opt/vc/include/interface/vcos/vcos_thread.h:186:15: warning: inline function ‘vcos_thread_get_affinity’ declared but never defined
VCOS_UNSIGNED vcos_thread_get_affinity(VCOS_THREAD_T *thread);
^
src/CMakeFiles/GL.dir/build.make:583: recipe for target 'src/CMakeFiles/GL.dir/glx/glx.c.o' failed
make[3]: *** [src/CMakeFiles/GL.dir/glx/glx.c.o] Error 1
CMakeFiles/Makefile2:79: recipe for target 'src/CMakeFiles/GL.dir/all' failed
make[2]: *** [src/CMakeFiles/GL.dir/all] Error 2
CMakeFiles/Makefile2:91: recipe for target 'src/CMakeFiles/GL.dir/rule' failed
make[1]: *** [src/CMakeFiles/GL.dir/rule] Error 2
Makefile:110: recipe for target 'GL' failed
make: *** [GL] Error 2
pi@raspberrypi ~/glshim $



Only 88%.... compile Error.


Warnings all the time...
 
I don't think all thoses warning are harmfull...


But I don't see any error in the log you paste, only Warnings (you didn't copy/paste it?)
 
src/CMakeFiles/GL.dir/build.make:583: recipe for target 'src/CMakeFiles/GL.dir/glx/glx.c.o' failed
make[3]: *** [src/CMakeFiles/GL.dir/glx/glx.c.o] Error 1
CMakeFiles/Makefile2:79: recipe for target 'src/CMakeFiles/GL.dir/all' failed
make[2]: *** [src/CMakeFiles/GL.dir/all] Error 2
CMakeFiles/Makefile2:91: recipe for target 'src/CMakeFiles/GL.dir/rule' failed
make[1]: *** [src/CMakeFiles/GL.dir/rule] Error 2
Makefile:110: recipe for target 'GL' failed
make: *** [GL] Error 2
pi@raspberrypi ~/glshim $


Error 1 and Error 2 compiling failed
 
No, that just make saying that compile failled, and that is an error.


I need the error produced by gcc, maybe before all the warning you pasted.
 
Code:
[ 88%] Building C object src/CMakeFiles/GL.dir/glx/glx.c.o
/home/pi/glshim/src/glx/glx.c:176:8: error: ‘bcm_host_init’ redeclared as different kind of symbol
 void (*bcm_host_init)();
        ^
In file included from /home/pi/glshim/src/glx/glx.h:2:0,
                 from /home/pi/glshim/src/glx/glx.c:15:
/opt/vc/include/bcm_host.h:39:6: note: previous declaration of ‘bcm_host_init’ was here
 void bcm_host_init(void);
      ^
/home/pi/glshim/src/glx/glx.c:177:8: error: ‘bcm_host_deinit’ redeclared as different kind of symbol
 void (*bcm_host_deinit)();
        ^
In file included from /home/pi/glshim/src/glx/glx.h:2:0,
                 from /home/pi/glshim/src/glx/glx.c:15:
/opt/vc/include/bcm_host.h:40:6: note: previous declaration of ‘bcm_host_deinit’ was here
 void bcm_host_deinit(void);
      ^
/home/pi/glshim/src/glx/glx.c: In function ‘glXMakeCurrent’:
/home/pi/glshim/src/glx/glx.c:749:102: warning: passing argument 3 of ‘egl_eglCreateWindowSurface’ makes pointer from integer without a cast
    eglSurface = context->eglSurface = egl_eglCreateWindowSurface(eglDisplay, context->eglConfigs[0], drawable, NULL);
                                                                                                      ^
/home/pi/glshim/src/glx/glx.c:749:102: note: expected ‘EGLNativeWindowType’ but argument is of type ‘GLXDrawable’
/home/pi/glshim/src/glx/glx.c:753:80: warning: passing argument 3 of ‘egl_eglCreateWindowSurface’ makes pointer from integer without a cast
             eglSurface = egl_eglCreateWindowSurface(eglDisplay, eglConfigs[0], drawable, NULL); // create surface only if needed
                                                                                ^
/home/pi/glshim/src/glx/glx.c:753:80: note: expected ‘EGLNativeWindowType’ but argument is of type ‘GLXDrawable’
In file included from /opt/vc/include/interface/vcos/vcos.h:185:0,
                 from /opt/vc/include/interface/vmcs_host/vc_dispmanx.h:33,
                 from /opt/vc/include/bcm_host.h:50,
                 from /home/pi/glshim/src/glx/glx.h:2,
                 from /home/pi/glshim/src/glx/glx.c:15:
/home/pi/glshim/src/glx/glx.c: At top level:
/opt/vc/include/interface/vcos/vcos_timer.h:112:6: warning: inline function ‘vcos_timer_delete’ declared but never defined
 void vcos_timer_delete(VCOS_TIMER_T *timer);
      ^
/opt/vc/include/interface/vcos/vcos_timer.h:109:6: warning: inline function ‘vcos_timer_reset’ declared but never defined
 void vcos_timer_reset(VCOS_TIMER_T *timer, VCOS_UNSIGNED delay);
      ^
/opt/vc/include/interface/vcos/vcos_timer.h:102:6: warning: inline function ‘vcos_timer_cancel’ declared but never defined
 void vcos_timer_cancel(VCOS_TIMER_T *timer);
      ^
/opt/vc/include/interface/vcos/vcos_timer.h:95:6: warning: inline function ‘vcos_timer_set’ declared but never defined
 void vcos_timer_set(VCOS_TIMER_T *timer, VCOS_UNSIGNED delay);
      ^
/opt/vc/include/interface/vcos/vcos_timer.h:80:15: warning: inline function ‘vcos_timer_create’ declared but never defined
 VCOS_STATUS_T vcos_timer_create(VCOS_TIMER_T *timer,
               ^
In file included from /opt/vc/include/interface/vcos/vcos.h:127:0,
                 from /opt/vc/include/interface/vmcs_host/vc_dispmanx.h:33,
                 from /opt/vc/include/bcm_host.h:50,
                 from /home/pi/glshim/src/glx/glx.h:2,
                 from /home/pi/glshim/src/glx/glx.c:15:
/opt/vc/include/interface/vcos/vcos_thread.h:269:6: warning: inline function ‘vcos_thread_resume’ declared but never defined
 void vcos_thread_resume(VCOS_THREAD_T *thread);
      ^
/opt/vc/include/interface/vcos/vcos_thread.h:262:5: warning: inline function ‘vcos_thread_running’ declared but never defined
 int vcos_thread_running(VCOS_THREAD_T *thread);
     ^
/opt/vc/include/interface/vcos/vcos_thread.h:251:15: warning: inline function ‘vcos_change_preemption’ declared but never defined
 VCOS_UNSIGNED vcos_change_preemption(VCOS_UNSIGNED pe);
               ^
/opt/vc/include/interface/vcos/vcos_thread.h:234:6: warning: inline function ‘vcos_thread_relinquish’ declared but never defined
 void vcos_thread_relinquish(void);
      ^
/opt/vc/include/interface/vcos/vcos_thread.h:186:15: warning: inline function ‘vcos_thread_get_affinity’ declared but never defined
 VCOS_UNSIGNED vcos_thread_get_affinity(VCOS_THREAD_T *thread);
               ^
In file included from /opt/vc/include/interface/vcos/vcos.h:185:0,
                 from /opt/vc/include/interface/vmcs_host/vc_dispmanx.h:33,
                 from /opt/vc/include/bcm_host.h:50,
                 from /home/pi/glshim/src/glx/glx.h:2,
                 from /home/pi/glshim/src/glx/glx.c:15:
/opt/vc/include/interface/vcos/vcos_timer.h:112:6: warning: inline function ‘vcos_timer_delete’ declared but never defined
 void vcos_timer_delete(VCOS_TIMER_T *timer);
      ^
/opt/vc/include/interface/vcos/vcos_timer.h:109:6: warning: inline function ‘vcos_timer_reset’ declared but never defined
 void vcos_timer_reset(VCOS_TIMER_T *timer, VCOS_UNSIGNED delay);
      ^
/opt/vc/include/interface/vcos/vcos_timer.h:102:6: warning: inline function ‘vcos_timer_cancel’ declared but never defined
 void vcos_timer_cancel(VCOS_TIMER_T *timer);
      ^
/opt/vc/include/interface/vcos/vcos_timer.h:95:6: warning: inline function ‘vcos_timer_set’ declared but never defined
 void vcos_timer_set(VCOS_TIMER_T *timer, VCOS_UNSIGNED delay);
      ^
/opt/vc/include/interface/vcos/vcos_timer.h:80:15: warning: inline function ‘vcos_timer_create’ declared but never defined
 VCOS_STATUS_T vcos_timer_create(VCOS_TIMER_T *timer,
               ^
In file included from /opt/vc/include/interface/vcos/vcos.h:127:0,
                 from /opt/vc/include/interface/vmcs_host/vc_dispmanx.h:33,
                 from /opt/vc/include/bcm_host.h:50,
                 from /home/pi/glshim/src/glx/glx.h:2,
                 from /home/pi/glshim/src/glx/glx.c:15:
/opt/vc/include/interface/vcos/vcos_thread.h:269:6: warning: inline function ‘vcos_thread_resume’ declared but never defined
 void vcos_thread_resume(VCOS_THREAD_T *thread);
      ^
/opt/vc/include/interface/vcos/vcos_thread.h:262:5: warning: inline function ‘vcos_thread_running’ declared but never defined
 int vcos_thread_running(VCOS_THREAD_T *thread);
     ^
/opt/vc/include/interface/vcos/vcos_thread.h:251:15: warning: inline function ‘vcos_change_preemption’ declared but never defined
 VCOS_UNSIGNED vcos_change_preemption(VCOS_UNSIGNED pe);
               ^
/opt/vc/include/interface/vcos/vcos_thread.h:234:6: warning: inline function ‘vcos_thread_relinquish’ declared but never defined
 void vcos_thread_relinquish(void);
      ^
/opt/vc/include/interface/vcos/vcos_thread.h:186:15: warning: inline function ‘vcos_thread_get_affinity’ declared but never defined
 VCOS_UNSIGNED vcos_thread_get_affinity(VCOS_THREAD_T *thread);
               ^
src/CMakeFiles/GL.dir/build.make:583: recipe for target 'src/CMakeFiles/GL.dir/glx/glx.c.o' failed
make[3]: *** [src/CMakeFiles/GL.dir/glx/glx.c.o] Error 1
CMakeFiles/Makefile2:79: recipe for target 'src/CMakeFiles/GL.dir/all' failed
make[2]: *** [src/CMakeFiles/GL.dir/all] Error 2
CMakeFiles/Makefile2:91: recipe for target 'src/CMakeFiles/GL.dir/rule' failed
make[1]: *** [src/CMakeFiles/GL.dir/rule] Error 2
Makefile:110: recipe for target 'GL' failed
make: *** [GL] Error 2
 
Back
Top