/// <summary> /// Request readback of a texture. /// </summary> /// <param name="src"></param> /// <param name="mipmapIndex"></param> /// <returns></returns> public static UniversalAsyncGPUReadbackRequest Request(Texture src, int mipmapIndex = 0) { if (SystemInfo.supportsAsyncGPUReadback) { return(new UniversalAsyncGPUReadbackRequest() { isPlugin = false, uDisposd = false, uRequest = AsyncGPUReadback.Request(src, mipIndex: mipmapIndex), }); } else { return(new UniversalAsyncGPUReadbackRequest() { isPlugin = true, oRequest = OpenGLAsyncReadbackRequest.CreateTextureRequest(RenderTextureRegistery.GetFor(src).ToInt32(), mipmapIndex) }); } }
void Update() { OpenGLAsyncReadbackRequest.Update(); RenderTextureRegistery.ClearDeadRefs(); }