Forum Xamarin.iOS

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.

Sign In or Register to comment.