Change rhi-related debug prints to categorized logging

Change-Id: I4e8d3111a2f3b77e984756cc9eef49d42f0b647c
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
This commit is contained in:
Laszlo Agocs 2019-07-31 13:18:48 +02:00
parent 55a0fe4539
commit a22b44266b
3 changed files with 12 additions and 11 deletions

View File

@ -564,7 +564,7 @@ void QSGGuiThreadRenderLoop::renderWindow(QQuickWindow *window)
QRhiRenderBuffer::UsedWithSwapChainOnly);
cd->swapchain->setWindow(window);
cd->swapchain->setDepthStencil(cd->depthStencilForSwapchain);
qDebug("MSAA sample count for the swapchain is %d", rhiSampleCount);
qCDebug(QSG_LOG_INFO, "MSAA sample count for the swapchain is %d", rhiSampleCount);
cd->swapchain->setSampleCount(rhiSampleCount);
cd->swapchain->setFlags(flags);
cd->rpDescForSwapchain = cd->swapchain->newCompatibleRenderPassDescriptor();
@ -629,7 +629,7 @@ void QSGGuiThreadRenderLoop::renderWindow(QQuickWindow *window)
const QSize previousOutputSize = cd->swapchain->currentPixelSize();
if (previousOutputSize != effectiveOutputSize || cd->swapchainJustBecameRenderable) {
if (cd->swapchainJustBecameRenderable)
qDebug("just became exposed");
qCDebug(QSG_LOG_RENDERLOOP, "just became exposed");
cd->swapchainJustBecameRenderable = false;
cd->depthStencilForSwapchain->setPixelSize(effectiveOutputSize);
@ -640,7 +640,7 @@ void QSGGuiThreadRenderLoop::renderWindow(QQuickWindow *window)
if (!cd->hasActiveSwapchain)
qWarning("Failed to build or resize swapchain");
else
qDebug() << "rhi swapchain size" << effectiveOutputSize;
qCDebug(QSG_LOG_RENDERLOOP) << "rhi swapchain size" << effectiveOutputSize;
}
Q_ASSERT(rhi == cd->rhi);

View File

@ -192,8 +192,9 @@ void QSGRhiSupport::applySettings()
default:
break;
}
qDebug("Using QRhi with backend %s\n graphics API debug/validation layers: %d\n QRhi profiling and debug markers: %d",
backendName, m_debugLayer, m_profile);
qCDebug(QSG_LOG_INFO,
"Using QRhi with backend %s\n graphics API debug/validation layers: %d\n QRhi profiling and debug markers: %d",
backendName, m_debugLayer, m_profile);
}
QSGRhiSupport *QSGRhiSupport::staticInst()
@ -527,11 +528,11 @@ void QSGRhiProfileConnection::initialize(QRhi *rhi)
int profPort = qEnvironmentVariableIntValue("QSG_RHI_PROFILE_PORT");
if (!profPort)
profPort = 30667;
qDebug("Sending RHI profiling output to %s:%d", qPrintable(profHost), profPort);
qCDebug(QSG_LOG_INFO, "Sending RHI profiling output to %s:%d", qPrintable(profHost), profPort);
m_profConn.reset(new QTcpSocket);
QObject::connect(m_profConn.data(), QOverload<QAbstractSocket::SocketError>::of(&QAbstractSocket::error), m_profConn.data(),
[this](QAbstractSocket::SocketError socketError) { qDebug(" RHI profiler error: %d (%s)",
socketError, qPrintable(m_profConn->errorString())); });
[this](QAbstractSocket::SocketError socketError) { qWarning(" RHI profiler error: %d (%s)",
socketError, qPrintable(m_profConn->errorString())); });
m_profConn->connectToHost(profHost, profPort);
m_profConn->waitForConnected(); // blocking wait because we want to send stuff already from the init below
rhi->profiler()->setDevice(m_profConn.data());

View File

@ -709,7 +709,7 @@ void QSGRenderThread::syncAndRender(QImage *grabImage)
const QSize previousOutputSize = cd->swapchain->currentPixelSize();
if (previousOutputSize != effectiveOutputSize || cd->swapchainJustBecameRenderable) {
if (cd->swapchainJustBecameRenderable)
qDebug("just became exposed");
qCDebug(QSG_LOG_RENDERLOOP, QSG_RT_PAD, "just became exposed");
cd->swapchainJustBecameRenderable = false;
cd->depthStencilForSwapchain->setPixelSize(effectiveOutputSize);
@ -720,7 +720,7 @@ void QSGRenderThread::syncAndRender(QImage *grabImage)
if (!cd->hasActiveSwapchain)
qWarning("Failed to build or resize swapchain");
else
qDebug() << "rhi swapchain size" << effectiveOutputSize;
qCDebug(QSG_LOG_RENDERLOOP) << "rhi swapchain size" << effectiveOutputSize;
}
Q_ASSERT(rhi == cd->rhi);
@ -940,7 +940,7 @@ void QSGRenderThread::run()
QRhiRenderBuffer::UsedWithSwapChainOnly);
cd->swapchain->setWindow(window);
cd->swapchain->setDepthStencil(cd->depthStencilForSwapchain);
qDebug("MSAA sample count for the swapchain is %d", rhiSampleCount);
qCDebug(QSG_LOG_INFO, "MSAA sample count for the swapchain is %d", rhiSampleCount);
cd->swapchain->setSampleCount(rhiSampleCount);
cd->swapchain->setFlags(flags);
cd->rpDescForSwapchain = cd->swapchain->newCompatibleRenderPassDescriptor();