42 QRhiTexture::Format format)
44 std::unique_ptr<QRhiTexture> texture(
45 rhi.newTexture(format, planeSize, 1, QRhiTexture::UsedAsTransferSource));
46 if (!texture->createFrom(QRhiTexture::NativeTexture{ handle, 0 }))
47 return q23::unexpected(u"QRhiTexture::createFrom failed"_s);
49 QRhiResourceUpdateBatch *batch = rhi.nextResourceUpdateBatch();
50 QRhiReadbackResult result;
51 batch->readBackTexture(texture.get(), &result);
53 QRhiCommandBuffer *cb =
nullptr;
54 if (rhi.beginOffscreenFrame(&cb) != QRhi::FrameOpSuccess || !cb)
55 return q23::unexpected(u"QRhi::beginOffscreenFrame failed"_s);
56 cb->resourceUpdate(batch);
57 rhi.endOffscreenFrame();