PVRFrame ES20 PC Emulator, C# interop crash

hello everyone,

I’m a PC Game developer, and I’m trying to use PVRFrame to simulate my  ES20 application using DotNet2.0/Mono.

I managed to use AMD Emulator on my app, but I prefer to use PowerVRFrame better because my target platform using SGX530.

However, when I changed DLLs to PVRFrame “libegl.dll”, the application found crashed at
"eglInitialize()" entry point, and give out

AccessViolationException

here is my interop declaration
<code>
[DllImportAttribute(“libEGL.dll”, EntryPoint = “eglInitialize”)]
        [return: MarshalAsAttribute(UnmanagedType.I1)]
        public static extern bool Initialize(EGLDisplay dpy, out int major, out int minor); 
</code>

any ideas
thanks for the helps

Hi,

What is the exact name of SDK package that you are using? You said that you had changed the DLLs to PVRVFrame "libegl.dll"  , have you changed also GLES2 library to  PVRVFrame libGLESv2.dll ? Calling convetion used in libraries is __stdcall. If everything looks correct , but still does not work than small narrowed code would be beneficial if you could send us.

Best Regards

thank you for your response,
I’m trying to use PVRFrame with OpenTK framework - http://www.opentk.com/

well, I did have some modification on the framework, to make it work with an AMD ES emulator. Since my target platform is OpenPandora, so I prefer PVRFrame to be my emulator if I could.

as far as I can say - yes, I have change to PVRFrame “libGLESv2.dll” as well
                              - about __stdcall, that should be default for P/Invoke operation, right?

I am very happy to send you my project (VS2008), if you want to see it.

PS: I haven’t tried to create my own C# win32 routine for testing PVRFrame yet, as far as O know, I cannot get ES to intialize on OpenTK

Thanks in advance 

Hi,

Thanks for your resposne. I do not have much experience with c# and not at all with opentk, so I would like you to try to print some debug information about the code you have attached like, what library is being loaded (path of libEGL being opened) and if it is possible the reason for access violation eg. returned symbol address is invalid ( symbol does not exist) etc.

__stdcall should be default calling convention for mentioned operations as you have said so the problem is somewhere else.

if it does not bring any results , then narrowed example exposing this issue would be beneficial. In my opinion The error that your are recieving may be result of wrong address of symbol, eg. calling function (eglInialize) by invlaid pointer or access violation caused inside of eglInitialize itself. So if you can make sure that  eglInitalize is handled properly (valid pointer is used a a way of calling eglInialize) then sending us your code would be necessery.  Because we do not know opentk so best if it is a code not related to that library , but if it is not possible then we will be happy to test your project.

Can you confirm that our SDK works fine on your PC? Can you run our Windows Pc emulation SDK training courses and demos ? what version of SDK you are using? Where did you get pvrvframe from?

Regards,

I will try my best to answer the questions as following,

- the path to “libegl.dll” should be fine, my application is working fine with AMD ES Emulator, (which basically I have copied PVRFrame “libegl.dll” and “libxxxv2.dll” over), I dont think the path is the problem

- yes, I believe in .NET, __stdcall is the default option

-  It might be possible that eglInitialize() is appeared to pick up some “bad” pointer inside the function, well anyway, if the function routine is the same standard from Kronos, why it works with AMD but not PVR.
If the problem is insode the PVR DLL, I have no idea how to track :frowning:

- I have downloaded the SDK from this website, (imgtec), and my machine is running all examples just fine (the sdk version is the latest)

- I believe it also possible that OpenTK could pass the “bad” data to EGL, but again, it doesn’t make sense when the same application works on AMD dll?
I did tried debug my code (including OpenTK) and I tracked it until just before the call to eglInitialize() -> the passing parameters do look fine for me

Thanks for helping, please let me know if you need any more information 

Ok, please send us a code exposing given issue. Please send it to: devtech@imgtec.com


sent it,
thanks in advance for your help 

I wonder how this is going, :slight_smile:
Hopefully you can reproduce the error with the code I submitted

Hi,

I gave it a try and it behaves like you have described. However When I run it again PVRVFrame libraries from forthcoming release (2.6) that will be published at the end of Febuary) then it works (control passes through that code and some following methods, it stops when creation of window surface takes place ). Â So the fix will be available with our next release.Â

I’d like to confirmed it’s working with the 2.6 beta!

Thx Jacek