Forum Xamarin.iOS
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

OpenGL Image Processing Crash

BrianSmith.1086BrianSmith.1086 USMember
edited February 2016 in Xamarin.iOS

I'm consistently crashing the simulator and device when using OpenGL (OpenGLES 2.0) to do image processing. It appears to be a memory issue related to the CGImage because the resultant image from the image processing can be displayed in the UI. If I try to use the resultant image in another image processing pass the simulator/device crashes. The CGImage being passed in appears to be corrupted even though it displayed just fine in the UI previously.

The application output says

Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries

used by your application.

The general program structure is
(On the same thread)

  • Create EAGLContext (This is only done once.)
  • Create Vertex & Fragment Shaders

    • Create, Attach, Compile, & Link shaders
  • Create Frame Buffer

  • Create Render Buffer (FrameBuffer)
  • Load Texture

    • Copy CGImage into Texture2D
  • Render

    • Apply Shaders to Image & result image is in FrameBuffer
  • Read Image

    • Read pixels & copy into CGImage

I'll put together a compact example and attach it later. Any help would be appreciated.

Tagged:
Sign In or Register to comment.