Jump to content


Photo

OpenGL ES 3D drivers, v1 compatibility layer

* * * * * 3 votes

  • Please log in to reply
684 replies to this topic

#21
GinKage

GinKage

    Enthusiast

  • Members
  • PipPipPip
  • 217 posts
  • Devices:Samsung i8000 (Omnia II)
Well, as I said, I'll try some more investigating once my device arrives. :)

By the way, I was wrong about Cube after all, it is really a GLES2 sample, and it requires shaders as a must.

I tried to compile this sample, and it seems that it uses its own libGLESv2.dll, with both gl* and egl* functions exported (and without libEGL dependency!). The corresponding .lib is also there. So, if we want to compile something with .dll's that we have in Omnia, we should remove includes and libs found in that sample and replace them with the ones from M8 SDK (in such a configuration, it compiles quite well). Or so I think. Again, othing to test on. :)

And, about weird dll initialization, I have a suspicion that maybe it could be resolved with correct .lib's... Or, then again, not.

Anyway, sooner or later I think we'll get our SDK. :)

  • 0

#22
mattb777

mattb777

    Newbie

  • Members
  • Pip
  • 45 posts
  • Location:Sydney
  • Devices:Samsung Omnia II (i8000)
just got my omnia ii yesterday :) if you need anything tested on an actual device..

  • 0

#23
Omikr0n

Omikr0n

    Newbie

  • Members
  • Pip
  • 6 posts
  • Location:Slovakia, Kosice or Czech Republic, Prague
  • Devices:HTC S740
Oh, not Kaiser 3D again. Couldn't PDA makers just sort graphics problems once and for all?
I was looking forward to OmniaPRO B7610, but if it has the same problems as described here, I won't pay a penny for it!

  • 0
]|[

#24
GinKage

GinKage

    Enthusiast

  • Members
  • PipPipPip
  • 217 posts
  • Devices:Samsung i8000 (Omnia II)
"Kaiser 3D" won't repeat, at least for one reason: the 3D driver IS there, on the device already, and IS working, because Samsung's apps are using it already.
What we miss is SDK, and there is, in fact, no doubt that we'll get it, either from Samsung or with our own combined skills. Just you wait. :)

  • 0

#25
inmatrixout

inmatrixout

    Enthusiast

  • Members
  • PipPipPip
  • 166 posts
  • Devices:HTC HD2 & Omnia II

"Kaiser 3D" won't repeat, at least for one reason: the 3D driver IS there, on the device already, and IS working, because Samsung's apps are using it already.
What we miss is SDK, and there is, in fact, no doubt that we'll get it, either from Samsung or with our own combined skills. Just you wait. :)


Isn't it available @ samsung mobile innovator? :)
http://innovator.sam...do?platformId=2

  • 0

#26
GinKage

GinKage

    Enthusiast

  • Members
  • PipPipPip
  • 217 posts
  • Devices:Samsung i8000 (Omnia II)
Nope. It contains:

Common API (which only allows to request SDK version)
Accelerometer API
Haptics API (i.e. vibration feedback)
LED API
Wheel Key API (not on Omnia 2, though)
Optical Mouse API (again, onl for Omnia 1)
TV Out API
Orientation API
Light Sensor API
Camera Flash API
Slider API (Only for Omnia Pro)
R2VS API (audio enchancements)
Advanced Camera API
FM Radio API

So, no OpenGL API at the moment...

  • 0

#27
Chainfire

Chainfire

    Enthusiast

  • Members
  • PipPipPip
  • 190 posts
Indeed not Kaiser3D again :) It's just that the device has no working OpenGL ES 1.x support. It does have OpenGL ES 2.0 support (which is obviously more advanced than v1). Unfortunately, 2 is not backwards compatible with 1 (the ES variants, anyway), though one can emulate 1.x in 2.0. This is however a tricky subject (unless you are a GL expert) so one would rather not do this from scratch - especially as the v1 lib included on these devices does exactly this, but have bug so it doesn't actually work.

Either way, I have seen Samsung folks state at various times that only 2.0 is officially supported. This is too bad, because even though on paper 2.0 is better, I would not expect many currently 1.x apps to be ported to 2.0 (it's not trivial), and expect that for the next year or so new apps will also still be 1.x, as HTC only supports 1.x and it has a much larger userbase.

So, to recap, we have 3D on the new Omnia line, but few apps will be able to use it, which is a damn shame (unless we can get 1.x support working). I somehow doubt using the right lib will fix it up neatly, but it is not impossible. Even so, having a proxy DLL which fixes the issue would be a much better solution than having app authors recompile their apps with different libs - that is even assuming their apps are built in C++.

Perhaps a solution may be to port the initialization routines from the v2 driver to the v1 driver, but that is more easily said than done!

BTW long time no see omikr0n :)

  • 0
Author of many things ;)

My development blog: http://www.chainfire.eu/

#28
Omikr0n

Omikr0n

    Newbie

  • Members
  • Pip
  • 6 posts
  • Location:Slovakia, Kosice or Czech Republic, Prague
  • Devices:HTC S740

Indeed not Kaiser3D again :) It's just that the device has no working OpenGL ES 1.x support. It does have OpenGL ES 2.0 support (which is obviously more advanced than v1). Unfortunately, 2 is not backwards compatible with 1 (the ES variants, anyway), though one can emulate 1.x in 2.0. This is however a tricky subject (unless you are a GL expert) so one would rather not do this from scratch - especially as the v1 lib included on these devices does exactly this, but have bug so it doesn't actually work.

And does OpenGL ES 2.0 have full hardware support with some decent performance? If so, it might not be a lost case afterall. What about drivers Direct3D Mobile? Are they present? An if they are, is D3DM just emulated in OpenGL ES?

BTW long time no see omikr0n :)

Indeed. I've got 3 jobs and a school at the moment, so I don't have much time for anything else. Besides I sold my TyTN II a year ago (I had been too angry at it to use it anymore) and bought HTC S740. Unfortunately, S740 subforum on XDA-devs is almost dead, so there is not much I could participate in there. :)

  • 0
]|[

#29
zetagnosis

zetagnosis

    Newbie

  • Members
  • Pip
  • 18 posts

Creating a forwarder libgles_cm is not the issue at all. I made one long before I even started this thread.

The problem is the original DLL's themselves. Try compiling a simple v1 sample (like triangle), using the original OmniaII/Pro drivers - so without the forwarder, just libGLESv1_CM.dll and libEGL.dll. It simply does not work. eglMakeCurrent will fail if libGLESv1_CM.dll is loaded (bad alloc).

You can get around by loading libEGL, libGLESv1_CM and libGLESv2 in a certain order, but actual GL calls will still fail with AV's.

You can get around that by setting up the context by using one of the GLES2 exports in the v1 lib. This will get rid of the AV's, and actually start the compiling of the shaders used to fake v1 functions in v2 (libGLESv1_CM is a v1 emulation driver that translates to v2 call).

You can then actually use v1 functions, and an FPS counter will return FPS in the expected range for the video card to be doing actual work. However, the screen will remain blank, and debug output will return strings along the lines of that the state has not been flushed by the hardware.

Some mixing and matching with M900 drivers has once given me garbled output (like the internal buffers' line length differ between the seperate driver builds).

I've traced various of these problems with IDA, both live as well as doing a lot of reading of the code. It seems that some initialization routines in the v1 lib are creating havoc, but I am as of yet unsure. A friend of mine who was also a part of bringing hardware 3D accel to the HTC Kaiser, Polaris and Nike is also looking at it a bit, but I'm not sure how far he's looked and attempted things ATM.



If you need a beta tester I´m ready !!! TouchWiz suck !! :)

  • 0

#30
GinKage

GinKage

    Enthusiast

  • Members
  • PipPipPip
  • 217 posts
  • Devices:Samsung i8000 (Omnia II)
Got my own Omnia 2 today.
Compiled Cute20 sample in GLES2 mode using libs from M8 SDK.
It works.

Update: recompiled my own GLES 1.x test application (simply by replacing libGLES_CM.lib with libGLESv1_CM.lib + libEGL.lib), and it also works! Draws a textured quad, no problem!
Though, it works kinda slow...

Edited by GinKage, 08 September 2009 - 06:16 PM.

  • 0

#31
Chainfire

Chainfire

    Enthusiast

  • Members
  • PipPipPip
  • 190 posts

Got my own Omnia 2 today.
Compiled Cute20 sample in GLES2 mode using libs from M8 SDK.
It works.

Update: recompiled my own GLES 1.x test application (simply by replacing libGLES_CM.lib with libGLESv1_CM.lib + libEGL.lib), and it also works! Draws a textured quad, no problem!
Though, it works kinda slow...


Funky, I haven't been able to do this at all. Mind sending over the project (including source, libs, and EXEs?)

Also, did you use the M8 drivers for this? My problem with the M8 SDK was that it imports egl functions from the wrong DLL. How did you work around this?

Edited by Chainfire, 09 September 2009 - 01:02 PM.

  • 0
Author of many things ;)

My development blog: http://www.chainfire.eu/

#32
GinKage

GinKage

    Enthusiast

  • Members
  • PipPipPip
  • 217 posts
  • Devices:Samsung i8000 (Omnia II)
Here you go: http://rapidshare.co...0_Demo.rar.html

I used libs from M8 SDK, and excluded headers, lib and dll that came with Cute20 (again, by replacing .h's and .lib with the ones from M8 SDK), and deleted additional include directories in project settings, then added libegl.lib (it originaly compiled using libglesv2.lib that has all the functions within it).

So, I actually use drivers that came with the device, and I only made sure I use headers and libs from M8 SDK, not from the sample itself. And the magic is done. :)
BTW, I also got garbled output at some point, but it was only because of 24bit depth buffer, 16bit worked OK.

  • 0

#33
Chainfire

Chainfire

    Enthusiast

  • Members
  • PipPipPip
  • 190 posts

Here you go: http://rapidshare.co...0_Demo.rar.html

I used libs from M8 SDK, and excluded headers, lib and dll that came with Cute20 (again, by replacing .h's and .lib with the ones from M8 SDK), and deleted additional include directories in project settings, then added libegl.lib (it originaly compiled using libglesv2.lib that has all the functions within it).

So, I actually use drivers that came with the device, and I only made sure I use headers and libs from M8 SDK, not from the sample itself. And the magic is done. :)
BTW, I also got garbled output at some point, but it was only because of 24bit depth buffer, 16bit worked OK.


Thanks, and the 1.x thing? (having trouble getting that to work... your Cute20 works on my B7620 as well)

EDIT: With 1.x have the same eglMakeCurrent issue as before

Edited by Chainfire, 09 September 2009 - 01:42 PM.

  • 0
Author of many things ;)

My development blog: http://www.chainfire.eu/

#34
GinKage

GinKage

    Enthusiast

  • Members
  • PipPipPip
  • 217 posts
  • Devices:Samsung i8000 (Omnia II)
Here's the 1.x project: http://rapidshare.co...eentex.rar.html
As it says in the window title, it uses screenshot as a texture, though it seems Omnia has a limit of 512x512 texture size. To exit the app, just double-tap.

Edited by GinKage, 09 September 2009 - 05:35 PM.

  • 0

#35
Chainfire

Chainfire

    Enthusiast

  • Members
  • PipPipPip
  • 190 posts

Here's the 1.x project: http://rapidshare.co...eentex.rar.html
As it says in the window title, it uses screenshot as a texture, though it seems Omnia has a limit of 512x512 texture size. To exit the app, just double-tap.


The EXE you compiled crashes on both my I8000 and B7620 ... but both devices are samples. Can any of the other readers here try the screentex.exe you can find the archive linked above on their production Omnia II's and report back if it works for them?

Really strange. Haven't debugged your source code (yet), but I suspect it has the same error as I have been having all along. Strange it works for you (and possibly others) as well!

EDIT/NOTE: The 512x512 limit is 'usual' for mobile devices. Whenever possible I wouldn't use textures larger than 128x128 in any case. I'm not sure about these Samsung devices, but at least HTC devices' rendering slow downs significantly when using textures above 128x128.

Edited by Chainfire, 09 September 2009 - 05:38 PM.

  • 0
Author of many things ;)

My development blog: http://www.chainfire.eu/

#36
GinKage

GinKage

    Enthusiast

  • Members
  • PipPipPip
  • 217 posts
  • Devices:Samsung i8000 (Omnia II)
I updated the archive a bit, for the whole app to look a bit better. :)
Well, it basically could mean that the 1.x emulation driver on your test i8000 is a bit... wrong?
Have you tried to run the app with dll's from the previous page?

Anyway, at least we now have 2.0 stable working, with SDK.

  • 0

#37
Chainfire

Chainfire

    Enthusiast

  • Members
  • PipPipPip
  • 190 posts

I updated the archive a bit, for the whole app to look a bit better. :)
Well, it basically could mean that the 1.x emulation driver on your test i8000 is a bit... wrong?
Have you tried to run the app with dll's from the previous page?

Anyway, at least we now have 2.0 stable working, with SDK.


Well obviously that is indeed a possibility. But yes, I have tried with the drivers posted earlier in the thread - that is why I asked for them in the first place :)

The rabbit hole can go deep in this case though, as drivers like these are ultimately dependent on a ****load of other things. I may need to flash a completely different ROM to test this myself. That's why I'm asking other Omnia II owners to see if your EXE runs for them. If it does... well, then I got some tinkering ahead of me :)

  • 0
Author of many things ;)

My development blog: http://www.chainfire.eu/

#38
nicodega

nicodega

    Newbie

  • Members
  • Pip
  • 26 posts
Hi, I'm willing to try the exe but I cand't download from rapidshare where I am now.. could you upload it to 4shared or megaupload?

  • 0

#39
GinKage

GinKage

    Enthusiast

  • Members
  • PipPipPip
  • 217 posts
  • Devices:Samsung i8000 (Omnia II)
Here: http://www.4shared.c.../Screentex.html - it only contains .exe file.

  • 0

#40
nicodega

nicodega

    Newbie

  • Members
  • Pip
  • 26 posts

Here: http://www.4shared.c.../Screentex.html - it only contains .exe file.


It's working perfectly :)

I know nothing about open GL (though some years ago I learned a bit but for desktops) but I've realized we don't have libGLES_CM.dll and instead we have libGLESv1_CM on our devices.. is there a way to run programs compiled against libGLES_CM? I'm asking because I realized most demos for HTC devices use that dll, which I read somewhere on the internet is also a part of OpenGL ES 1.1..

  • 0




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users