- Home /
Defer graphics.blit until render thread? (Android)
As part of a plugin, I push some data onto a Texture2D (created at runtime as I cannot manually write to the render texture assets in android) and then I need to copy that to another texture (a render target asset, as I need it as an asset)
In an Update()
I use Graphics.blit(a,b);
which works fine, but blocks the main thread thread as it syncs with the opengl thread (I believe there is a bit stall, flush, or something in non-multi-threaded rendering too)
Can I avoid this? Maybe I should do it with the Rendering command buffers? are they supported on android? AFAIK there are no render-thread callbacks in c# right?
I added a delegate callback which gets called from my plugin on the render thread, but unfortunately if I call Graphics.Blit there, it blocks acquiring the OpenGL thread (when it's already on that thread) so my only solution I can see is to do the blit in my plugin when I say so.
Any alternatives (Just trying to keep the blit code inside unity)
Answer by SoylentGraham · Aug 11, 2015 at 05:03 PM
Couldn't find a way to do this. Wrote my own deferred blit.
Your answer
Follow this Question
Related Questions
Inter Scene Loading Screen Animation 3 Answers
When can GL.IssuePluginEvent be called? 3 Answers
Can't query ID3D10Multithread interface 1 Answer