public static UniversalAsyncGPUReadbackRequest OpenGLRequestTexture(int texture, int mipmapIndex) { return(new UniversalAsyncGPUReadbackRequest() { isPlugin = true, oRequest = OpenGLAsyncReadbackRequest.CreateTextureRequest((int)texture, mipmapIndex) }); }
/// <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) }); } }