|
GL4ES: another OpenGL over OpenGLES2 emulation - some tech. info and porting progress |
Posted on: 2018/2/16 13:50
#1 |
---|---|---|
Home away from home
![]() ![]() Joined:
2007/9/11 12:31 From Russia
Posts: 6690
|
@All
As some of you may know, there was another attempt we discuss before which make OpenGL apps to works on OpenGLES, which called called glshim. I follow that development on the Pyra's/Pandora's forum, where was pretty nice long discussion of 36 pages of how it all develops, what it can or don't , what games they port over it and so on Seeing from comments on github, you may see that since 2016 development mostly stop, and in 2017 there was only one commit. Butits all about glshim originally. Then, at some point (in 2015 or something), another author made a fork of it, and start to develop it futher (at begining in parallel with glshim, then probably author of glshim loose interest and only that fork is continue to develop). Name of fork: gl4es Its quite active even today. And to have 2 wrappers (Regal and GL4ES) is better than have only Regal, and i give it a go as well. Structure of project not that good as Regal's one, and it's depends not only on X11 in few parts , but also on EGL. It also use CMAKE , and not pure makefiles , that is kind of boring always for normal tests to be honest. So, i jsut check how it all builds on linux, and make pure makefile for os4 which will build necessary objects, only to realize that X11 can be disabled easy (it is already disabled for Android), while EGL is used much. I then write ticket for, in case to ask for some clarification , and aurhos says: Quote:
I then explain him that we at amiga and all that necessary stuff, and , he still in interest to deal with ! Today he made a commit where add inital NOEGL stuff, and what he wrote about: Quote:
So, all of this even better for checks: As i of course need and want to create GLES context myself, as well as i for myself want to do aglSwapBuffers(). Through, at moment not everything handled as need it with NOEGL, as well as there is other code-compile bugs (strange!), but he seems still to works on , and we can expect something soon ! For those ones who want to play a bit with and see how it all error's for now, there is os4's amigaos4_build.sh: http://kas1e.mikendezign.com/aos4/gl4es/amigaos4_build.sh Stay tuned ! |
|
|
Re: GL4ES: another OpenGL over OpenGLES2 emulation - some tech. info and porting progress |
Posted on: 2018/2/16 18:14
#2 |
---|---|---|
Home away from home
![]() ![]() Joined:
2007/9/11 12:31 From Russia
Posts: 6690
|
Some info: we are able to build all objects of main gl4es code, make a link library from it, and even try to link it against test code : have some bunch of undefs which need to be fixed, but proably soon.
Also, he add amigaos4 target as well, so it's all will be in repo. |
|
|
Re: GL4ES: another OpenGL over OpenGLES2 emulation - some tech. info and porting progress |
Posted on: 2018/2/16 19:59
#3 |
---|---|---|
Home away from home
![]() ![]() Joined:
2007/9/11 12:31 From Russia
Posts: 6690
|
@all
Do i understand right, that our os4's dlopen/dlsym() will works only for sobjes, and not for real amiga libs ? |
|
|
Re: GL4ES: another OpenGL over OpenGLES2 emulation - some tech. info and porting progress |
Posted on: 2018/2/16 20:01
#4 |
---|---|---|
Just can't stay away
![]() ![]() Joined:
2006/11/29 8:09 From Lyon, France
Posts: 1101
|
Great work Kas1e !
I can't be of any help with all this stuff but you have all my support, hoping that you'll be able to do something with the final result. |
|
_________________
-- AmigaONE X1000 (not used anymore) |
||
|
Re: GL4ES: another OpenGL over OpenGLES2 emulation - some tech. info and porting progress |
Posted on: 2018/2/16 20:04
#5 |
---|---|---|
Just can't stay away
![]() ![]() Joined:
2007/7/14 21:30 From Lothric
Posts: 1198
|
@kas1e
I can't answer your question regarding dlsym but if you need to find out the function addresses, "use the source": https://github.com/AmigaPorts/sdl2-ami ... SDL_os4opengles2wrapper.c |
|
|
Re: GL4ES: another OpenGL over OpenGLES2 emulation - some tech. info and porting progress |
Posted on: 2018/2/16 20:07
#6 |
---|---|---|
Home away from home
![]() ![]() Joined:
2007/9/11 12:31 From Russia
Posts: 6690
|
@Capehill
Yeah, that what exactly i need :) At moment we have that: https://github.com/ptitSeb/gl4es/blob/master/src/gl/loader.c Which of course, will not work probably as imho dlopen/dlsym its all about shared obejects only. Will try your solution now, thanks ! |
|
|
Re: GL4ES: another OpenGL over OpenGLES2 emulation - some tech. info and porting progress |
Posted on: 2018/2/16 20:14
#7 |
---|---|---|
Home away from home
![]() ![]() Joined:
2007/9/11 12:31 From Russia
Posts: 6690
|
@Capehill
Can you also point out plz how later it used. I.e. you open somewhere ogles2.library, and when you call AmiGetGLESProc ? Maybe you can have a look at that loader.c file, and have idea how we can integrate it all there. That what author answer me about how it works with dlsym() in gl4es: Quote:
|
|
|
Re: GL4ES: another OpenGL over OpenGLES2 emulation - some tech. info and porting progress |
Posted on: 2018/2/16 20:21
#8 |
---|---|---|
Just can't stay away
![]() ![]() Joined:
2007/7/14 21:30 From Lothric
Posts: 1198
|
@kas1e
The rest of the code should be pretty much here: https://github.com/AmigaPorts/sdl2-ami ... os4/SDL_os4opengles.c#L82 Mind you, it's blindly coded, tested by the few brave.. |
|
|
Re: GL4ES: another OpenGL over OpenGLES2 emulation - some tech. info and porting progress |
Posted on: 2018/2/16 20:33
#9 |
---|---|---|
Home away from home
![]() ![]() Joined:
2007/9/11 12:31 From Russia
Posts: 6690
|
@Capehill
Ok.. then it mean that ogles2.library should be opened from gl4es, then. Damn, was in hope to avoid it , just to make it same as regal (i.e. no opening of any libraries in, but doing all from users's code) Now i am abit out of ideas, that what author say: Quote:
|
|
|
Re: GL4ES: another OpenGL over OpenGLES2 emulation - some tech. info and porting progress |
Posted on: 2018/2/17 0:58
#10 |
---|---|---|
Home away from home
![]() ![]() Joined:
2006/12/4 23:15 Posts: 2212
|
@kas1e
Use the interface to the ogles2.library directly rather than any stub library, that you might use for compiling simplicity. eg MiniGL programs are usually linkied against libminigl.a or .so which contains stub functions that call the library calls. I'm assuming that ogles2.librray will work similarly. olgesSomeFunc() will not then clash with IOgles->olglesSomefunc() The library *could* be opened in a constructor, it need not be opend in the link lib ne it static or sobj. The Interface could be extern to the new library and provided in the users code. the new lib would just need to be compiked with #include proto/ogles2.h Adjust al the names to suit obviously ![]() |
|
|
Re: GL4ES: another OpenGL over OpenGLES2 emulation - some tech. info and porting progress |
Posted on: 2018/2/17 10:30
#11 |
---|---|---|
Home away from home
![]() ![]() Joined:
2007/9/11 12:31 From Russia
Posts: 6690
|
@broadblues
Thanks ! That was helpfull. @All Library done, author add amigaos4 bits, fixing for now some last issues. Some amigaos4 feteshism: ![]() First test code even was compiled against it!: Quote:
But that for pure:
#include "include/GL/gl.h"
So kind of expected, but that quite step. Probably very soon we will see something rendered ! Edited by kas1e on 2018/2/17 10:56:51
|
|
|
Re: GL4ES: another OpenGL over OpenGLES2 emulation - some tech. info and porting progress |
Posted on: 2018/2/17 12:43
#12 |
---|---|---|
Home away from home
![]() ![]() Joined:
2007/9/11 12:31 From Russia
Posts: 6690
|
@all
Who is your daddy?:) ![]() Source: http://kas1e.mikendezign.com/aos4/gl4es/test2.c As you can see, there in source i didn't open ogles2.library, and didn't worry about interfaces and stuff: that done inside of gl4es. Also as you can see, QUADS which should be drawns : didn't. That can make probably that gl4es shaders fail on NOVA's shaders. That to be checked. |
|
|
Re: GL4ES: another OpenGL over OpenGLES2 emulation - some tech. info and porting progress |
Posted on: 2018/2/17 20:48
#13 |
---|---|---|
Home away from home
![]() ![]() Joined:
2007/9/11 12:31 From Russia
Posts: 6690
|
@all
![]() That was pain ! It was _much_ harder than Regal. Main author spend 2 full days on adding os4 support, finding bugs, fixing stuff, etc. But good news : its all in repo. Even cmake updated to have amigaos4 target. Through, at moment i use pure sh script, which is easy for fast test. Few more bugs to fix, and then same speed test to see if it faster or slower than Regal in same test case |
|
|
Re: GL4ES: another OpenGL over OpenGLES2 emulation - some tech. info and porting progress |
Posted on: 2018/2/17 21:34
#14 |
---|---|---|
Home away from home
![]() ![]() Joined:
2007/9/11 12:31 From Russia
Posts: 6690
|
@all
Ok all initial bugs fixed, and so to the same speed tests we do with Regal, MiniGL and MiniGL-Reloaded. There is source: http://kas1e.mikendezign.com/aos4/gl4 ... _tests/gl4es_speed_test.c There is binary compiled over gl4es: http://kas1e.mikendezign.com/aos4/gl4 ... ests/gl4es_speed_test.zip Now, result is: GL4ES: Quote:
And as i post in Regal's topic: MiniGL: Quote:
Regal: Quote:
As you see, the result is much better than with Regal. Its on pair with MiniGL, which , do not be confused, very good result for such a simple test case because of reassons Daniel wrote in Regal's topic (slow first frame, too simple code, so not show potential of overload and so on). @Daniel Can you plz run that test on your Sam, so we will see how it in compare with MiniGL reloaded. Probably on the same level, or even better a little ? |
|
|
Re: GL4ES: another OpenGL over OpenGLES2 emulation - some tech. info and porting progress |
Posted on: 2018/2/17 22:29
#15 |
---|---|---|
Home away from home
![]() ![]() Joined:
2006/12/2 3:55 From Italy, Perugia
Posts: 3392
|
@kas1e
Wonderful !! followed a bit the discussion there and it was nice to see how much he was availible to help you ![]() |
|
|
Re: GL4ES: another OpenGL over OpenGLES2 emulation - some tech. info and porting progress |
Posted on: 2018/2/18 6:57
#16 |
---|---|---|
Home away from home
![]() ![]() Joined:
2007/9/11 12:31 From Russia
Posts: 6690
|
@All
Need some help. There is test case: http://kas1e.mikendezign.com/aos4/gl4es/test_crash.c ogles2.library and interface opened in the gl4es.a itself. So, once i try to run it as it, it freeze amigaos. But not all the time on the same place. Sometime, it go till initialising gl4es, and then crash (so, even didn't touch a part of code where we do amiga stuff at all), sometime go futher and then crash right after i open window. Of course for sake of tests tried to use bigger stack size too. Then, once i start remove parts of code (different ones), it works. But not the same parts of code. Its like the more code i have (does not matter what functions, etc, just more code), then it crashes. For example, i may comment some parts in the main() : don't crash. Or may comment some parts in draw(), while keep what was commented in main : don't crash. I.e. commenting out different parts of code, to make code of binary smaller (probably, i am not sure), make it not crash. Its like some overbound/overflow/dunno what somewhere. But something general. Have anyone any idea to where look at ? I mean that kind of symptoms can cause what ? It also seems, that putting Delay() all over place, can make difference for point when crash happens. And that remind me some racecondition issues .. Maybe still that we open library and interface in the libgl4es.a itself, and in programm use just as it OGLES2, make problems ? That the way we integrate it (taken from SDL2 as reference): https://github.com/ptitSeb/gl4es/blob/master/src/agl/amigaos.c https://github.com/ptitSeb/gl4es/blob/master/src/agl/amigaos.h But that can be not the case of course .. Edited by kas1e on 2018/2/18 7:16:48
Edited by kas1e on 2018/2/18 7:29:58 |
|
|
Re: GL4ES: another OpenGL over OpenGLES2 emulation - some tech. info and porting progress |
Posted on: 2018/2/18 7:37
#17 |
---|---|---|
Not too shy to talk
![]() ![]() Joined:
2015/6/11 9:51 From Cologne
Posts: 433
|
@kas1e
Now, this looks even more promising as Regal ![]() Checked your binary on my sam460: Quote:
So on my side all the msec results for this test are (smaller = better): Quote:
So with this test it's a bit faster than my current MGLReloaded and, no surprise, slower as original MGL. Didn't compare Regal vs gl4es, but if the feature-set is more or less identical I would concentrate on gl4es if I were you ![]() Quote: So, once i try to run it as it, it freeze amigaos. But not all the time on the same place. From a quick look, you only defined 6 normals for 8 vertices. Quote:
What is that supposed to do? It should just be: Quote:
|
|
|
Re: GL4ES: another OpenGL over OpenGLES2 emulation - some tech. info and porting progress |
Posted on: 2018/2/18 7:55
#18 |
---|---|---|
Home away from home
![]() ![]() Joined:
2007/9/11 12:31 From Russia
Posts: 6690
|
@Daytona675x
And the size of binary lots smaller than regal one. Through in terms of compatibility regal should be better, but that to be checked. Gl4ES mostly for opengl1.5 and 2.0 for moment , but author optimize and fine tune it very well (at least better than Regal). He even say that arrays in shaders always not so fast, and he get rid where it possible of them in the generated shaders. As for crash: sure, gl-code-wise it can be wrong, but it works copy of minigl example, and even if call some stuff which make no sense to call, it shouldn't crash so heavy in different places (most of time right after open of window). |
|
|
Re: GL4ES: another OpenGL over OpenGLES2 emulation - some tech. info and porting progress |
Posted on: 2018/2/18 8:12
#19 |
---|---|---|
Not too shy to talk
![]() ![]() Joined:
2015/6/11 9:51 From Cologne
Posts: 433
|
@kas1e
Quote: As for crash: sure, gl-code-wise it can be wrong, but it works copy of minigl example, The normal array has to be larger and filled with correct normals, otherwise you are at least doing illegal memory reads with potentially trashed data. And you know what trashed data for a normal likely is? Most likely not a normal anymore ![]() Please fix the normal-array and try again. |
|
|
Re: GL4ES: another OpenGL over OpenGLES2 emulation - some tech. info and porting progress |
Posted on: 2018/2/18 9:59
#20 |
---|---|---|
Home away from home
![]() ![]() Joined:
2007/9/11 12:31 From Russia
Posts: 6690
|
@Daytona675x
Quote:
![]() Quote:
Funny thing is that "random" crash wasn't random. Its just i run test case from shell, and window which opened put shell window behind the gles2 window, and while aglSwapBuffers() not done, there is copy of the screen in the window. So, i watch on that window thinking that there is just few printfs, while they go futher in the shell behind the window, which make me think nothing happens :) It still strangely crashes: if i put bunch of printfs in Drawbox() before and after every gl call, then, its make 3 loops, and then crashes. But will firstly try to fix normales. Probably it didn't crash in Regal before, because for that example Regal create shaders with arrays (and so nothing draws, but didn't crash), while, GL4ES create shaders without arrays -> code tryin to executes -> crash. Through that only suggestion until didn't fix normales, maybe it bug in gl4es's glMatrixMode (as it works in MiniGL after all..). Will see now @Daniel Btw, just to be sure its not in spam box : did you recieve reports on mail about glGetActiveUniform(...) and glGetActiveAttrib(...) ? Edited by kas1e on 2018/2/18 10:18:52
Edited by kas1e on 2018/2/18 10:20:09 |
|