获取相机渲染画面错误

我想获取相机当前渲染画面,这块代码出现以下错误[.WebGL-00002EDC0028E900] GL_INVALID_OPERATION: Feedback loop formed between Framebuffer and active Texture.
这是怎么回事

   // 创建一个 RenderTexture 对象
    const texture = new cc.RenderTexture();
    texture.initWithSize(cc.visibleRect.width, cc.visibleRect.height);
    // 将当前画面渲染到 RenderTexture 对象中
    const camera = cc.Camera.main;
    camera.targetTexture = null;
    camera.targetTexture = texture;
    camera.render();
    // // 将 RenderTexture 转换为 SpriteFrame
    const spriteFrame = new cc.SpriteFrame();
    spriteFrame.setTexture(texture);
    this.testSpr.spriteFrame = spriteFrame;

image 为什么要置空,不应该是存起来吗,等替换RT渲染完再换回去吗

可能 cc.visibleRect.width这个东西带了小数点?