aik6980's picture

is OpenTK compatible with PowerVR sdk?

Hi,

My target platform is using PowerVR SGX, and I would like to extend OpenTK to support their extensions. (Shaders binary, Texture compression) Is that possible that I could replace their VRsdk header (egl.h, etc.) into Generator project.

Do I need to modify the parser? or anything specific that I have to be concerned about?

Thanks,


Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
the Fiddler's picture

Are you certain that these extensions are not already exposed by OpenTK? A quick checks reveals functions both for texture compression and for shader binaries in the ES20 namespace.

The generation process works like this:

  1. "Converter" takes the gl.h & glext.h and converts them to signatures.xml
  2. "Bind" takes signatures.xml and overrides.xml (handwritten) and converts them to C# code.

However, Converter is not a generic project and will not work with random headers without modification. Right now, it can only parse the OpenCL and OpenGLES headers from Khronos. Note that there's no need to parse egl.h, these bindings are trivial to write by hand (check Egl.cs in the source tree).

I'd suggest verifying that PowerVR extensions are missing from both OpenTK and from the master OpenGLES headers. If they are only missing from OpenTK, then it's mainly a matter of updating our copy of gl2.h and rerunning the generator. If they are missing from both there are two solutions:

  • Modify Converter so it can parse VR SDK headers correctly (tedious).
  • Add the missing extensions directly to Source/Bind/Specifications/ES20/overrides.xml (much simpler).
aik6980's picture

thanks a lot! I will see which way that will suit me the best :)

btw, I'm tried replaced "libegl.dll" and "libglesv2.dll" from AMD Emulator (which is working fine now) to PowerVR PC Emulator and the application is clashed again :(.
I debugged it roughly and found it raised the "Platform exception", but haven't got any chance to investigate further.

any idea?

the Fiddler's picture

Can't tell what's wrong without at least a stacktrace.

Is the PowerVR emulator available for free? If so, do you know where I can find it? (google seems to be failing me).

aik6980's picture

thank you very much for helping me investigate this
here is the PowerVR website where PC Emulation can be downloaded

http://www.imgtec.com/powervr/insider/powervr-utilities.asp

you can download either PC Emulator, or the whole SDK (including PC Emulator)

the Fiddler's picture

Thanks for the link.

aik6980's picture

any good news?

the Fiddler's picture

I am getting an AccessViolationException on Egl.Initialize when running with the PowerVR SDK. I haven't been able to find the cause yet.

In the meantime, AMD's ES emulator is working fine so you might wish to take a look into that.

aik6980's picture

thanks! I'm about to come update that I found the error at the same place as well.

Again, thanks for mentioning AMD Emulator, I'm using that at the moment. Anyway, I also aimming to test the application on Linux that why PowerVR emulator is come in my concern.

Hopefully we will find the fix soon

aik6980's picture

I have forwarded this issue to the ImgTec support, and I got their responses as following

Hi,

Thanks for the clarification, however, I found the application is crashed even before the point you have mentioned (GraphicsContext.cs : 263) as far as I debug, it never reach the point that the program try to get the EGL context from available_contexts either

I'm not sure how to make this as a question, but I still a bit curious why the similar routine working fine with AMD emulator but not PVR? I thought both emulators do mostly the same stuff to emulate EGL, but I could be wrong
Well, it will be great if you could guide me a bit about the idea to debug this error.

I also post this further investigation on OpenTK forum.

Many thanks,
Wittawat K.

--------------------------------------------------------------------------------
Subject: RE: From aik6980 : PVRFrame ES20 PC Emulator, C# interop crash
Date: Tue, 19 Jan 2010 12:11:00 +0000
From: Jacek.Czaja@imgtec.com
To: aik_canhelp@hotmail.com
CC: IMGKL-DevTech@imgtec.com

Hi,

I'm sorry I haven't written exactly how it works. What I have written on the forum means that previously there were a problems with obtaining the functions from
libEGL libraries (part of pvrvframe). And With the version I have sent you this part works fine. However there is some problem somewhere later related to context.
We tried to investigate it a little bit and it seems that in the same code first you use our EGL interface to create a context , surface etc.. and later on try trying to adress
the same context using WGL interface. eg. You seem to create graphich context with EGL and store it in :available_contexts (GraphicsContext.cs) and then
later on refer to it using handle returned by wgl method (GraphicsContext.cs : 263). Current context you are getting comes from WGL which is something else than
current egl context and they handle is diffrent so accessing available_contexts (storage of egl contexts) with egl context handles will cause access violation.

Hope this will help

Regards
Jacek

--------------------------------------------------------------------------------
From: Wittawat Keawcharoen [mailto:aik_canhelp@hotmail.com]
Sent: 18 January 2010 21:53
To: Jacek Czaja
Cc: IMGKL - DevTech
Subject: RE: From aik6980 : PVRFrame ES20 PC Emulator, C# interop crash

Hi,

Unfortunately, it still didnt work.
I tested them with my project, both on Debug and Release build, and still give me the
"AccessViolationException"
However, the function that throw out the error is different this time,

Here is where the exception has been occured
.\OpenTK\Source\OpenTK\Platform\Egl\EglContext.cs - line 108

Egl.MakeCurrent(WindowInfo.Display, WindowInfo.Surface, WindowInfo.Surface, HandleAsEGLContext);

It is interesting you said that you can run the program on your system,
Have you modified any project properties?

Best Regards,
Wittawat K.

"
Hi,
Please find attach beta version of our pvrvframe. Send us some feedback as soon as you test them. I don’t know what is the reason that libraries you have tried did not work properly in your case.

What I can say is that in those attached , mechanism of exporting the functions was reimplemented to make it more friendly for dynamic loading by other applications , which is also your case .

But this case should also working with previous edition. Try it and let us now.

Regards,
Jacek
"

"
Hi,
I was able to reproduce the issue that you had reported. However this problem seems not to appear with our PVRVFrame candidate for our next release (2.6, around end of febuary). So If you want I can send you these libraries (still in prebeta stage) so you can give it a try.
Regards
Jacek
"

I'm still try to find the workaround on this problem, and I'm happy to send the PVRFrame 2.6 Beta to OpenTK if you want to investigate this further.
What ImgTec tried to say is that We are using the wrong context after the EGL context is created,

Appriciate any helps,
Wittawat K.