summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2023-03-16 15:09:34 +0100
committerChristian Strømme <christian.stromme@qt.io>2023-03-16 19:33:43 +0000
commitdc4432358626eccc9e4f5146e59d9a8f913b0144 (patch)
treef922c5c5dbbe209206e8ed094bc6ad4b64150dc7 /src/gui
parentc5d4dde67896611e171db778f2bff23e614b9d14 (diff)
rhi: Make non-critical pipeline cache warnings qCDebug instead
It's not just that these are not fatal, but some "errors" are not actual errors, e.g. getting "Nothing to serialize" from Metal is not something we care about. Convert them from qWarning to qCDebug with our standard category, so they still all show up when running with QSG_INFO=1, but won't pollute the output for regular users. Even if a cache file cannot be used or written, that's not something typical users care about. Pick-to: 6.5 Fixes: QTBUG-110485 Change-Id: I63d815f7b95c4d6a4428497b7247811e860ebf04 Reviewed-by: Christian Strømme <christian.stromme@qt.io>
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/rhi/qrhid3d11.cpp12
-rw-r--r--src/gui/rhi/qrhigles2.cpp14
-rw-r--r--src/gui/rhi/qrhimetal.mm27
-rw-r--r--src/gui/rhi/qrhivulkan.cpp36
4 files changed, 45 insertions, 44 deletions
diff --git a/src/gui/rhi/qrhid3d11.cpp b/src/gui/rhi/qrhid3d11.cpp
index c49b40bcd8..d9f323eb1a 100644
--- a/src/gui/rhi/qrhid3d11.cpp
+++ b/src/gui/rhi/qrhid3d11.cpp
@@ -698,7 +698,7 @@ void QRhiD3D11::setPipelineCacheData(const QByteArray &data)
const size_t headerSize = sizeof(QD3D11PipelineCacheDataHeader);
if (data.size() < qsizetype(headerSize)) {
- qWarning("setPipelineCacheData: Invalid blob size (header incomplete)");
+ qCDebug(QRHI_LOG_INFO, "setPipelineCacheData: Invalid blob size (header incomplete)");
return;
}
const size_t dataOffset = headerSize;
@@ -707,21 +707,21 @@ void QRhiD3D11::setPipelineCacheData(const QByteArray &data)
const quint32 rhiId = pipelineCacheRhiId();
if (header.rhiId != rhiId) {
- qWarning("setPipelineCacheData: The data is for a different QRhi version or backend (%u, %u)",
- rhiId, header.rhiId);
+ qCDebug(QRHI_LOG_INFO, "setPipelineCacheData: The data is for a different QRhi version or backend (%u, %u)",
+ rhiId, header.rhiId);
return;
}
const quint32 arch = quint32(sizeof(void*));
if (header.arch != arch) {
- qWarning("setPipelineCacheData: Architecture does not match (%u, %u)",
- arch, header.arch);
+ qCDebug(QRHI_LOG_INFO, "setPipelineCacheData: Architecture does not match (%u, %u)",
+ arch, header.arch);
return;
}
if (header.count == 0)
return;
if (data.size() < qsizetype(dataOffset + header.dataSize)) {
- qWarning("setPipelineCacheData: Invalid blob size (data incomplete)");
+ qCDebug(QRHI_LOG_INFO, "setPipelineCacheData: Invalid blob size (data incomplete)");
return;
}
diff --git a/src/gui/rhi/qrhigles2.cpp b/src/gui/rhi/qrhigles2.cpp
index 7bb7e1fe4a..a9bb8473a2 100644
--- a/src/gui/rhi/qrhigles2.cpp
+++ b/src/gui/rhi/qrhigles2.cpp
@@ -1484,7 +1484,7 @@ void QRhiGles2::setPipelineCacheData(const QByteArray &data)
const size_t headerSize = sizeof(QGles2PipelineCacheDataHeader);
if (data.size() < qsizetype(headerSize)) {
- qWarning("setPipelineCacheData: Invalid blob size (header incomplete)");
+ qCDebug(QRHI_LOG_INFO, "setPipelineCacheData: Invalid blob size (header incomplete)");
return;
}
const size_t dataOffset = headerSize;
@@ -1493,14 +1493,14 @@ void QRhiGles2::setPipelineCacheData(const QByteArray &data)
const quint32 rhiId = pipelineCacheRhiId();
if (header.rhiId != rhiId) {
- qWarning("setPipelineCacheData: The data is for a different QRhi version or backend (%u, %u)",
- rhiId, header.rhiId);
+ qCDebug(QRHI_LOG_INFO, "setPipelineCacheData: The data is for a different QRhi version or backend (%u, %u)",
+ rhiId, header.rhiId);
return;
}
const quint32 arch = quint32(sizeof(void*));
if (header.arch != arch) {
- qWarning("setPipelineCacheData: Architecture does not match (%u, %u)",
- arch, header.arch);
+ qCDebug(QRHI_LOG_INFO, "setPipelineCacheData: Architecture does not match (%u, %u)",
+ arch, header.arch);
return;
}
if (header.programBinaryCount == 0)
@@ -1508,12 +1508,12 @@ void QRhiGles2::setPipelineCacheData(const QByteArray &data)
const size_t driverStrLen = qMin(sizeof(header.driver) - 1, size_t(driverInfoStruct.deviceName.size()));
if (strncmp(header.driver, driverInfoStruct.deviceName.constData(), driverStrLen)) {
- qWarning("setPipelineCacheData: OpenGL vendor/renderer/version does not match");
+ qCDebug(QRHI_LOG_INFO, "setPipelineCacheData: OpenGL vendor/renderer/version does not match");
return;
}
if (data.size() < qsizetype(dataOffset + header.dataSize)) {
- qWarning("setPipelineCacheData: Invalid blob size (data incomplete)");
+ qCDebug(QRHI_LOG_INFO, "setPipelineCacheData: Invalid blob size (data incomplete)");
return;
}
diff --git a/src/gui/rhi/qrhimetal.mm b/src/gui/rhi/qrhimetal.mm
index 2da7d24daf..2a84fd7324 100644
--- a/src/gui/rhi/qrhimetal.mm
+++ b/src/gui/rhi/qrhimetal.mm
@@ -899,7 +899,7 @@ QByteArray QRhiMetal::pipelineCacheData()
QTemporaryFile tmp;
if (!tmp.open()) {
- qWarning("pipelineCacheData: Failed to create temporary file for Metal");
+ qCDebug(QRHI_LOG_INFO, "pipelineCacheData: Failed to create temporary file for Metal");
return data;
}
tmp.close(); // the file exists until the tmp dtor runs
@@ -909,13 +909,14 @@ QByteArray QRhiMetal::pipelineCacheData()
NSError *err = nil;
if (![d->binArch serializeToURL: url error: &err]) {
const QString msg = QString::fromNSString(err.localizedDescription);
- qWarning("Failed to serialize MTLBinaryArchive: %s", qPrintable(msg));
+ // Some of these "errors" are not actual errors. (think of "Nothing to serialize")
+ qCDebug(QRHI_LOG_INFO, "Failed to serialize MTLBinaryArchive: %s", qPrintable(msg));
return data;
}
QFile f(fn);
if (!f.open(QIODevice::ReadOnly)) {
- qWarning("pipelineCacheData: Failed to reopen temporary file");
+ qCDebug(QRHI_LOG_INFO, "pipelineCacheData: Failed to reopen temporary file");
return data;
}
const QByteArray blob = f.readAll();
@@ -950,7 +951,7 @@ void QRhiMetal::setPipelineCacheData(const QByteArray &data)
const size_t headerSize = sizeof(QMetalPipelineCacheDataHeader);
if (data.size() < qsizetype(headerSize)) {
- qWarning("setPipelineCacheData: Invalid blob size (header incomplete)");
+ qCDebug(QRHI_LOG_INFO, "setPipelineCacheData: Invalid blob size (header incomplete)");
return;
}
@@ -960,32 +961,32 @@ void QRhiMetal::setPipelineCacheData(const QByteArray &data)
const quint32 rhiId = pipelineCacheRhiId();
if (header.rhiId != rhiId) {
- qWarning("setPipelineCacheData: The data is for a different QRhi version or backend (%u, %u)",
- rhiId, header.rhiId);
+ qCDebug(QRHI_LOG_INFO, "setPipelineCacheData: The data is for a different QRhi version or backend (%u, %u)",
+ rhiId, header.rhiId);
return;
}
const quint32 arch = quint32(sizeof(void*));
if (header.arch != arch) {
- qWarning("setPipelineCacheData: Architecture does not match (%u, %u)",
- arch, header.arch);
+ qCDebug(QRHI_LOG_INFO, "setPipelineCacheData: Architecture does not match (%u, %u)",
+ arch, header.arch);
return;
}
if (header.osMajor != osMajor || header.osMinor != osMinor) {
- qWarning("setPipelineCacheData: OS version does not match (%u.%u, %u.%u)",
- osMajor, osMinor, header.osMajor, header.osMinor);
+ qCDebug(QRHI_LOG_INFO, "setPipelineCacheData: OS version does not match (%u.%u, %u.%u)",
+ osMajor, osMinor, header.osMajor, header.osMinor);
return;
}
const size_t driverStrLen = qMin(sizeof(header.driver) - 1, size_t(driverInfoStruct.deviceName.length()));
if (strncmp(header.driver, driverInfoStruct.deviceName.constData(), driverStrLen)) {
- qWarning("setPipelineCacheData: Metal device name does not match");
+ qCDebug(QRHI_LOG_INFO, "setPipelineCacheData: Metal device name does not match");
return;
}
if (data.size() < qsizetype(dataOffset + header.dataSize)) {
- qWarning("setPipelineCacheData: Invalid blob size (data incomplete)");
+ qCDebug(QRHI_LOG_INFO, "setPipelineCacheData: Invalid blob size (data incomplete)");
return;
}
@@ -994,7 +995,7 @@ void QRhiMetal::setPipelineCacheData(const QByteArray &data)
QTemporaryFile tmp;
if (!tmp.open()) {
- qWarning("pipelineCacheData: Failed to create temporary file for Metal");
+ qCDebug(QRHI_LOG_INFO, "pipelineCacheData: Failed to create temporary file for Metal");
return;
}
tmp.write(p, header.dataSize);
diff --git a/src/gui/rhi/qrhivulkan.cpp b/src/gui/rhi/qrhivulkan.cpp
index 1128ea8f64..b2f72dce49 100644
--- a/src/gui/rhi/qrhivulkan.cpp
+++ b/src/gui/rhi/qrhivulkan.cpp
@@ -4383,7 +4383,7 @@ QByteArray QRhiVulkan::pipelineCacheData()
size_t dataSize = 0;
VkResult err = df->vkGetPipelineCacheData(dev, pipelineCache, &dataSize, nullptr);
if (err != VK_SUCCESS) {
- qWarning("Failed to get pipeline cache data size: %d", err);
+ qCDebug(QRHI_LOG_INFO, "Failed to get pipeline cache data size: %d", err);
return QByteArray();
}
const size_t headerSize = sizeof(QVkPipelineCacheDataHeader);
@@ -4391,7 +4391,7 @@ QByteArray QRhiVulkan::pipelineCacheData()
data.resize(dataOffset + dataSize);
err = df->vkGetPipelineCacheData(dev, pipelineCache, &dataSize, data.data() + dataOffset);
if (err != VK_SUCCESS) {
- qWarning("Failed to get pipeline cache data of %d bytes: %d", int(dataSize), err);
+ qCDebug(QRHI_LOG_INFO, "Failed to get pipeline cache data of %d bytes: %d", int(dataSize), err);
return QByteArray();
}
@@ -4416,7 +4416,7 @@ void QRhiVulkan::setPipelineCacheData(const QByteArray &data)
const size_t headerSize = sizeof(QVkPipelineCacheDataHeader);
if (data.size() < qsizetype(headerSize)) {
- qWarning("setPipelineCacheData: Invalid blob size");
+ qCDebug(QRHI_LOG_INFO, "setPipelineCacheData: Invalid blob size");
return;
}
QVkPipelineCacheDataHeader header;
@@ -4424,49 +4424,49 @@ void QRhiVulkan::setPipelineCacheData(const QByteArray &data)
const quint32 rhiId = pipelineCacheRhiId();
if (header.rhiId != rhiId) {
- qWarning("setPipelineCacheData: The data is for a different QRhi version or backend (%u, %u)",
- rhiId, header.rhiId);
+ qCDebug(QRHI_LOG_INFO, "setPipelineCacheData: The data is for a different QRhi version or backend (%u, %u)",
+ rhiId, header.rhiId);
return;
}
const quint32 arch = quint32(sizeof(void*));
if (header.arch != arch) {
- qWarning("setPipelineCacheData: Architecture does not match (%u, %u)",
+ qCDebug(QRHI_LOG_INFO, "setPipelineCacheData: Architecture does not match (%u, %u)",
arch, header.arch);
return;
}
if (header.driverVersion != physDevProperties.driverVersion) {
- qWarning("setPipelineCacheData: driverVersion does not match (%u, %u)",
- physDevProperties.driverVersion, header.driverVersion);
+ qCDebug(QRHI_LOG_INFO, "setPipelineCacheData: driverVersion does not match (%u, %u)",
+ physDevProperties.driverVersion, header.driverVersion);
return;
}
if (header.vendorId != physDevProperties.vendorID) {
- qWarning("setPipelineCacheData: vendorID does not match (%u, %u)",
- physDevProperties.vendorID, header.vendorId);
+ qCDebug(QRHI_LOG_INFO, "setPipelineCacheData: vendorID does not match (%u, %u)",
+ physDevProperties.vendorID, header.vendorId);
return;
}
if (header.deviceId != physDevProperties.deviceID) {
- qWarning("setPipelineCacheData: deviceID does not match (%u, %u)",
- physDevProperties.deviceID, header.deviceId);
+ qCDebug(QRHI_LOG_INFO, "setPipelineCacheData: deviceID does not match (%u, %u)",
+ physDevProperties.deviceID, header.deviceId);
return;
}
if (header.uuidSize != VK_UUID_SIZE) {
- qWarning("setPipelineCacheData: VK_UUID_SIZE does not match (%u, %u)",
- quint32(VK_UUID_SIZE), header.uuidSize);
+ qCDebug(QRHI_LOG_INFO, "setPipelineCacheData: VK_UUID_SIZE does not match (%u, %u)",
+ quint32(VK_UUID_SIZE), header.uuidSize);
return;
}
if (data.size() < qsizetype(headerSize + VK_UUID_SIZE)) {
- qWarning("setPipelineCacheData: Invalid blob, no uuid");
+ qCDebug(QRHI_LOG_INFO, "setPipelineCacheData: Invalid blob, no uuid");
return;
}
if (memcmp(data.constData() + headerSize, physDevProperties.pipelineCacheUUID, VK_UUID_SIZE)) {
- qWarning("setPipelineCacheData: pipelineCacheUUID does not match");
+ qCDebug(QRHI_LOG_INFO, "setPipelineCacheData: pipelineCacheUUID does not match");
return;
}
const size_t dataOffset = headerSize + VK_UUID_SIZE;
if (data.size() < qsizetype(dataOffset + header.dataSize)) {
- qWarning("setPipelineCacheData: Invalid blob, data missing");
+ qCDebug(QRHI_LOG_INFO, "setPipelineCacheData: Invalid blob, data missing");
return;
}
@@ -4479,7 +4479,7 @@ void QRhiVulkan::setPipelineCacheData(const QByteArray &data)
qCDebug(QRHI_LOG_INFO, "Created pipeline cache with initial data of %d bytes",
int(header.dataSize));
} else {
- qWarning("Failed to create pipeline cache with initial data specified");
+ qCDebug(QRHI_LOG_INFO, "Failed to create pipeline cache with initial data specified");
}
}