From 042cd97884bb86dfd0bedaa63480d99846ab06bb Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Tue, 12 Jan 2021 13:02:13 +0100 Subject: rhi: Expose device name, type, and IDs ...to the extent it is sensible. We have to make compromises still, meaning some fields will only be applicable with certain APIs. Most of this is already shown upon QRhi::create() as info debug prints, when enabled. Now expose it all through the QRhi API as well. This is useful for printing in qtdiag, and, while it should be avoided as much as possible, to make decisions about disabling 3D rendering features depending on the driver and GPU in use. Change-Id: Iebe1e192965c928b82a094d1c7c50ddf4b38b9a2 Reviewed-by: Andy Nichols --- tests/auto/gui/rhi/qrhi/tst_qrhi.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tests/auto/gui/rhi/qrhi/tst_qrhi.cpp') diff --git a/tests/auto/gui/rhi/qrhi/tst_qrhi.cpp b/tests/auto/gui/rhi/qrhi/tst_qrhi.cpp index 6dbd0599e4..db83f7955f 100644 --- a/tests/auto/gui/rhi/qrhi/tst_qrhi.cpp +++ b/tests/auto/gui/rhi/qrhi/tst_qrhi.cpp @@ -228,7 +228,11 @@ void tst_QRhi::create() QScopedPointer rhi(QRhi::create(impl, initParams, QRhi::Flags(), nullptr)); if (rhi) { + qDebug() << rhi->driverInfo(); + QCOMPARE(rhi->backend(), impl); + QVERIFY(strcmp(rhi->backendName(), "")); + QVERIFY(!rhi->driverInfo().deviceName.isEmpty()); QCOMPARE(rhi->thread(), QThread::currentThread()); // do a basic smoke test for the apis that do not directly render anything -- cgit v1.2.3