Is it safe to Graphics.Blit a RenderTexture to itself on iOS?
yeah but you’ll get feedback corruption on some devices and not others, depending if the texture used by the model is in the gpu or one frame behind or whatever. It’s unpredictable unless you first blit to another texture so you know what contents you have. I’ve been playing with this for the past week.
Yea… that’s what I ended up doing too. I’ve been running into graphics related blockers like this for weeks now, it seems like when you try to do anything even moderately complex with post processing that works fine on PC there is some blocker for it on iOS, and this is with iOS Pro. There isn’t a bug tracker or shader documentation specific to iOS either so I don’t find out what method will or will not work until I’ve already wasted at least a day on it.
Does anyone know how this is implemented? I see that glBlitFramebuffer is part of OpenGL ES 3.0 but iOS devices appear to support only OpenGL ES 2.0. There is also an OpenGL ES extension (GL_ANGLE_framebuffer_blit) but iPhone 5 doesn’t appear to support it. Thus, Unity might use some hacks to implement this which are not specified to produce defined results. (Also, even if glBlitFramebuffer was supported, the regions must not overlap if source and target are the same. From http://www.khronos.org/opengles/sdk/docs/man3/xhtml/glBlitFramebuffer.xml : “If the source and destination rectangles overlap or are the same, and the read and draw buffers are the same, the result of the operation is undefined.”)
Personaly I’ve found its worked on IOS devices, but its slower to do so than using multiple textures. I had random failures on Android devices and older Mac’s.