From a22b44266b402c3b0693e82847b7505cdfcc2ca9 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Wed, 31 Jul 2019 13:18:48 +0200 Subject: Change rhi-related debug prints to categorized logging Change-Id: I4e8d3111a2f3b77e984756cc9eef49d42f0b647c Reviewed-by: Andy Nichols --- src/quick/scenegraph/qsgrenderloop.cpp | 6 +++--- src/quick/scenegraph/qsgrhisupport.cpp | 11 ++++++----- src/quick/scenegraph/qsgthreadedrenderloop.cpp | 6 +++--- 3 files changed, 12 insertions(+), 11 deletions(-) (limited to 'src/quick/scenegraph') diff --git a/src/quick/scenegraph/qsgrenderloop.cpp b/src/quick/scenegraph/qsgrenderloop.cpp index 7545896972..ec835fe3bd 100644 --- a/src/quick/scenegraph/qsgrenderloop.cpp +++ b/src/quick/scenegraph/qsgrenderloop.cpp @@ -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); diff --git a/src/quick/scenegraph/qsgrhisupport.cpp b/src/quick/scenegraph/qsgrhisupport.cpp index 2ca66f23d5..8bae24dc76 100644 --- a/src/quick/scenegraph/qsgrhisupport.cpp +++ b/src/quick/scenegraph/qsgrhisupport.cpp @@ -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::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()); diff --git a/src/quick/scenegraph/qsgthreadedrenderloop.cpp b/src/quick/scenegraph/qsgthreadedrenderloop.cpp index 93853f57d4..d1258cf903 100644 --- a/src/quick/scenegraph/qsgthreadedrenderloop.cpp +++ b/src/quick/scenegraph/qsgthreadedrenderloop.cpp @@ -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(); -- cgit v1.2.3