From 913146ccd401216f71f037ea304b5e61b7a138cf Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Fri, 29 Nov 2019 12:41:38 +0100 Subject: RHI: new native texture API The new version takes/returns a value that can be unpacked and passed to other functions without knowing which backend is in use. The old API will be removed in a later change when dependent modules have been updated Task-number: QTBUG-78570 Change-Id: I18d928ceef3cb617c0c509ecccb345551a7990af Reviewed-by: Laszlo Agocs --- tests/manual/rhi/texuploads/texuploads.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tests/manual') diff --git a/tests/manual/rhi/texuploads/texuploads.cpp b/tests/manual/rhi/texuploads/texuploads.cpp index 091e47b9ea..a6b7d87d3e 100644 --- a/tests/manual/rhi/texuploads/texuploads.cpp +++ b/tests/manual/rhi/texuploads/texuploads.cpp @@ -237,11 +237,11 @@ void Window::customRender() // Exercise texture object export/import. if (d.testStage == 6) { - const QRhiNativeHandles *h = d.tex->nativeHandles(); - if (h) { + const QRhiTexture::NativeTexture nativeTexture = d.tex->nativeTexture(); + if (nativeTexture.object) { #if defined(Q_OS_MACOS) || defined(Q_OS_IOS) if (graphicsApi == Metal) { - qDebug() << "Metal texture: " << static_cast(h)->texture; + qDebug() << "Metal texture: " << *(void**)nativeTexture.object; // Now could cast to id and do something with // it, keeping in mind that copy operations are only done // in beginPass, while rendering into a texture may only @@ -253,7 +253,7 @@ void Window::customRender() d.importedTex = m_r->newTexture(QRhiTexture::RGBA8, d.tex->pixelSize()); d.releasePool << d.importedTex; - if (!d.importedTex->buildFrom(h)) + if (!d.importedTex->buildFrom(nativeTexture)) qWarning("Texture import failed"); // now d.tex and d.importedTex use the same MTLTexture -- cgit v1.2.3