@All
Btw, if any of you don't use my prebuild SDK, but want to use the latest GL4ES from ptitSeb's GitHub, then be sure that you compile it like this:
Quote:
mkdir build
cd build
cmake \
-DCMAKE_SYSTEM_NAME=Generic \
-DAMIGAOS4=1 \
-DSTATICLIB=ON \
-DCMAKE_SYSTEM_VERSION=1 \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER="/usr/local/amiga/bin/ppc-amigaos-gcc" \
-DCMAKE_CXX_COMPILER="/usr/local/amiga/bin/ppc-amigaos-g++" \
-DCMAKE_LINKER="/usr/local/amiga/bin/ppc-amigaos-ld" \
-DCMAKE_AR="/usr/local/amiga/bin/ppc-amigaos-ar" \
-DCMAKE_RANLIB="/usr/local/amiga/bin/ppc-amigaos-ranlib" \
-DCMAKE_FIND_ROOT_PATH="/usr/local/amiga/ppc-amigaos/" \
..
make -j4
Also, there is a hint :
Quote:
for full normal debug version instead of -DCMAKE_BUILD_TYPE=Release do -DCMAKE_BUILD_TYPE=Debug
if we want only "-gstabs" without gl4es debug output, then -DCMAKE_BUILD_TYPE=RelWithDebInfo
And at the end of all, if you build the latest version from github, it has broken .psa support. Issue is:
http://www.amiga.org/developer/bugreports/view.php?id=869So in meantime, you will need to disable .psa generation from gl.init in the function void initialize_gl4es(), by adding:
Quote:
// temporary fix until Daniel add necessary things to ogles2.
#ifdef __amigaos4__
globals4es.nopsa = 1;
#endif
But that only, if you want the very latest version of gl4es until I did not make a new version of SDK.
Also, as 2 more speed hints, I want to bring 2 moments that may help to speed things up in your ported OpenGL over gl4es apps.
By default _in most_ cases what the gl4es default states have are enough, but, in some cases, some additional tricks can be done to speed things up (and radically).
One of them is environment LIBGL_BATCH:
Quote:
LIBGL_BATCH
BATCH simply tries to merge subsequent glDrawXXXXX (glDrawArrays, glDrawElements...). It only tries to merge if arrays are between MINBATCH and MAXBATCH (inclusive) The Batching stop when there is a change of GL State, but also if an Array of more than 100*N is encountered.
0 : Default: don't try to merge glDrawXXXXX
N: Any number: try to merge arrays, 1st must be between 0 and 100*N
MIN-MAX: 2 numbers separated by minus, to try merge arrays that are between MIN and MAX vertices
What it means in the reality, is that when you build any of your apps, and it didn't have FPS you are satisfied with, or, you simply want to have as much as possible, you then in the shell firstly play with this Env before running your port like: "setenv LIBGL_BATCH 0-40", and so on, or 0-20 or 20-50, i.e. you got an idea.
If, under some values, you have really better performance, then to avoid issues/worry for users, you do as I do for NeverBall/NeverPutt ports: you just build your special gl4es build, with settings necessary value again in the initializing function of gl4es, like you do for disabling .psa. if you build the latest version. That trick brings in NeverBall quite a lot FPS more, the same as in my local test of Cube port. So, that must check always.
A second speed-hint which you may try for your ports, is happening for me only in the FrickingShark game, and so far i do not know the reasons of it, just found it by some luck. It's the usage of MAX_Textures in gl4es.
For FrikingShark i found that if i use in config.h #define MAX_TEX 8, or 4, or 2 instead of 16, i have better and better FPS in-game. And by better, i mean almost 50% increase with MAX_TEX 2. But that _ONLY_ in fricking shark. In no other games that make any difference (but I tried all my ports). The reason for that is still unknown but we think it can be some weird stuff in FrickingShark itself (i.e. game's code) that enables a VA for every existing TMU (without actually using them then). At least that would explain the performance differences. But that's just a guess.
Through it is worth noting that this was the second hint helping me to increase the speed.
So that is all you need for the current maximum usage of gl4es if you build your own versions.
Also, be sure your checked always
https://github.com/ptitSeb/gl4es/blob/master/USAGE.md.
All the environment there works for AmigaOS4 as well, via "setenv LIBGL_xxxx blablaba". And there is a lot, and some of them surely can bring some performance too, just i didn't find with ptitSeb anything else more or less important as LIBGL_BATCH and that MAX_TMU switch in FrickingShark.