diff options
Diffstat (limited to 'tests/manual/rhi/shared/examplefw.h')
-rw-r--r-- | tests/manual/rhi/shared/examplefw.h | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/tests/manual/rhi/shared/examplefw.h b/tests/manual/rhi/shared/examplefw.h index 220c3d0ff2..d28bbea0a8 100644 --- a/tests/manual/rhi/shared/examplefw.h +++ b/tests/manual/rhi/shared/examplefw.h @@ -58,6 +58,7 @@ #include <QPlatformSurfaceEvent> #include <QElapsedTimer> #include <QTimer> +#include <QLoggingCategory> #include <QtGui/private/qshader_p.h> #include <QFile> @@ -70,7 +71,6 @@ #endif #if QT_CONFIG(vulkan) -#include <QLoggingCategory> #include <QtGui/private/qrhivulkan_p.h> #endif @@ -307,7 +307,7 @@ void Window::init() m_sc = m_r->newSwapChain(); // allow depth-stencil, although we do not actually enable depth test/write for the triangle m_ds = m_r->newRenderBuffer(QRhiRenderBuffer::DepthStencil, - QSize(), // no need to set the size yet + QSize(), // no need to set the size here, due to UsedWithSwapChainOnly sampleCount, QRhiRenderBuffer::UsedWithSwapChainOnly); m_sc->setWindow(this); @@ -344,16 +344,12 @@ void Window::releaseResources() void Window::resizeSwapChain() { - const QSize outputSize = m_sc->surfacePixelSize(); - - m_ds->setPixelSize(outputSize); - m_ds->build(); // == m_ds->release(); m_ds->build(); - - m_hasSwapChain = m_sc->buildOrResize(); + m_hasSwapChain = m_sc->buildOrResize(); // also handles m_ds m_frameCount = 0; m_timer.restart(); + const QSize outputSize = m_sc->currentPixelSize(); m_proj = m_r->clipSpaceCorrMatrix(); m_proj.perspective(45.0f, outputSize.width() / (float) outputSize.height(), 0.01f, 1000.0f); m_proj.translate(0, 0, -4); @@ -444,6 +440,8 @@ int main(int argc, char **argv) QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QGuiApplication app(argc, argv); + QLoggingCategory::setFilterRules(QLatin1String("qt.rhi.*=true")); + // Defaults. #if defined(Q_OS_WIN) graphicsApi = D3D11; |