Hi all,
After doing some benchmarks, I found out that the OpenGL performance
is not too bad compared to Windows : about 25 % slower on the
Tirtanium benchmark when removing the X11 critical section protection,
50 % slower with it.
Now, I think most of the remaining FPS are lost in the CDECL ->
STDCALL conversion of all the OpenGL routines. I looked at the code
GCC generated for the OpenGL code and it's not really efficient : it
'pops' all the arguments in registers and then pushes them again for
the calling of the CDECL function...
So I had two ideas to optimize this, based on what Marcus did for
elf.c (as I am not an x86 ASM guru, I wouls have some difficulties
doing any of my proposals, but well :-) ) :
1) instead of generating C code for the conversion (as in
opengl_norm.c), generate some ASM in-line to do it as fast as
possible. The problem with this is how to get the address of the
'destination' function to put in the ASM...
2) the other possibility would have been to modify 'build' to have a
new keyword for function that are 'synonyms' between Windows and
Linux with only the calling convertion that changes. OpenGL's spec
file would look like this :
@ stdcall wglUseFontOutlines(long long long long long long long) wglUseFontOutlines
@ synonym glClearIndex(long )
For these functions, when GetProcAddress is called (or the
equivalent for 'static' linking) a code equivalent to the one in
'elf.c' would be generated.
This would greatly simplify the OpenGL code (no more
auto-generated opengl_norm.c and opengl_ext.c files).
I think the only real problem remaining would be how to generate
this ASM code to be at the same time efficient and thread-safe (I
thought a bit about it, and it seems non-trivial).
So what do you think about this ?
--
Lionel Ulmer - [EMAIL PROTECTED]