summaryrefslogtreecommitdiffstats
path: root/tests/manual/rhi/triquadcube
diff options
context:
space:
mode:
Diffstat (limited to 'tests/manual/rhi/triquadcube')
-rw-r--r--tests/manual/rhi/triquadcube/CMakeLists.txt9
-rw-r--r--tests/manual/rhi/triquadcube/quadrenderer.cpp4
-rw-r--r--tests/manual/rhi/triquadcube/quadrenderer.h4
-rw-r--r--tests/manual/rhi/triquadcube/texturedcuberenderer.cpp4
-rw-r--r--tests/manual/rhi/triquadcube/texturedcuberenderer.h4
-rw-r--r--tests/manual/rhi/triquadcube/triangleoncuberenderer.cpp4
-rw-r--r--tests/manual/rhi/triquadcube/triangleoncuberenderer.h2
-rw-r--r--tests/manual/rhi/triquadcube/trianglerenderer.cpp4
-rw-r--r--tests/manual/rhi/triquadcube/trianglerenderer.h4
-rw-r--r--tests/manual/rhi/triquadcube/triquadcube.cpp24
10 files changed, 26 insertions, 37 deletions
diff --git a/tests/manual/rhi/triquadcube/CMakeLists.txt b/tests/manual/rhi/triquadcube/CMakeLists.txt
index 8c343890b3..babf468728 100644
--- a/tests/manual/rhi/triquadcube/CMakeLists.txt
+++ b/tests/manual/rhi/triquadcube/CMakeLists.txt
@@ -1,4 +1,5 @@
-# Generated from triquadcube.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## triquadcube Binary:
@@ -12,7 +13,7 @@ qt_internal_add_manual_test(triquadcube
triangleoncuberenderer.cpp triangleoncuberenderer.h
trianglerenderer.cpp trianglerenderer.h
triquadcube.cpp
- PUBLIC_LIBRARIES
+ LIBRARIES
Qt::Gui
Qt::GuiPrivate
)
@@ -47,7 +48,3 @@ qt_internal_add_resource(triquadcube "triquadcube"
FILES
${triquadcube_resource_files}
)
-
-
-#### Keys ignored in scope 1:.:.:triquadcube.pro:<TRUE>:
-# TEMPLATE = "app"
diff --git a/tests/manual/rhi/triquadcube/quadrenderer.cpp b/tests/manual/rhi/triquadcube/quadrenderer.cpp
index 4536412309..67392dc583 100644
--- a/tests/manual/rhi/triquadcube/quadrenderer.cpp
+++ b/tests/manual/rhi/triquadcube/quadrenderer.cpp
@@ -1,9 +1,9 @@
// Copyright (C) 2018 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include "quadrenderer.h"
#include <QFile>
-#include <QtGui/private/qshader_p.h>
+#include <rhi/qshader.h>
// Renders a quad using indexed drawing. No QRhiGraphicsPipeline is created, it
// expects to reuse the one created by TriangleRenderer. A separate
diff --git a/tests/manual/rhi/triquadcube/quadrenderer.h b/tests/manual/rhi/triquadcube/quadrenderer.h
index a9f882fe54..8e5b556e06 100644
--- a/tests/manual/rhi/triquadcube/quadrenderer.h
+++ b/tests/manual/rhi/triquadcube/quadrenderer.h
@@ -1,10 +1,10 @@
// Copyright (C) 2018 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#ifndef QUADRENDERER_H
#define QUADRENDERER_H
-#include <QtGui/private/qrhi_p.h>
+#include <rhi/qrhi.h>
class QuadRenderer
{
diff --git a/tests/manual/rhi/triquadcube/texturedcuberenderer.cpp b/tests/manual/rhi/triquadcube/texturedcuberenderer.cpp
index 23b3c5c7c5..452c593e16 100644
--- a/tests/manual/rhi/triquadcube/texturedcuberenderer.cpp
+++ b/tests/manual/rhi/triquadcube/texturedcuberenderer.cpp
@@ -1,9 +1,9 @@
// Copyright (C) 2018 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include "texturedcuberenderer.h"
#include <QFile>
-#include <QtGui/private/qshader_p.h>
+#include <rhi/qshader.h>
#include "../shared/cube.h"
diff --git a/tests/manual/rhi/triquadcube/texturedcuberenderer.h b/tests/manual/rhi/triquadcube/texturedcuberenderer.h
index 59517b2fef..53fc9a30d1 100644
--- a/tests/manual/rhi/triquadcube/texturedcuberenderer.h
+++ b/tests/manual/rhi/triquadcube/texturedcuberenderer.h
@@ -1,10 +1,10 @@
// Copyright (C) 2018 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#ifndef TEXTUREDCUBERENDERER_H
#define TEXTUREDCUBERENDERER_H
-#include <QtGui/private/qrhi_p.h>
+#include <rhi/qrhi.h>
class TexturedCubeRenderer
{
diff --git a/tests/manual/rhi/triquadcube/triangleoncuberenderer.cpp b/tests/manual/rhi/triquadcube/triangleoncuberenderer.cpp
index b66d869642..33dc0776d7 100644
--- a/tests/manual/rhi/triquadcube/triangleoncuberenderer.cpp
+++ b/tests/manual/rhi/triquadcube/triangleoncuberenderer.cpp
@@ -1,9 +1,9 @@
// Copyright (C) 2018 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include "triangleoncuberenderer.h"
#include <QFile>
-#include <QtGui/private/qshader_p.h>
+#include <rhi/qshader.h>
// toggle to test the preserved content (no clear) path
const bool IMAGE_UNDER_OFFSCREEN_RENDERING = false;
diff --git a/tests/manual/rhi/triquadcube/triangleoncuberenderer.h b/tests/manual/rhi/triquadcube/triangleoncuberenderer.h
index ae8134601e..9d77feb253 100644
--- a/tests/manual/rhi/triquadcube/triangleoncuberenderer.h
+++ b/tests/manual/rhi/triquadcube/triangleoncuberenderer.h
@@ -1,5 +1,5 @@
// Copyright (C) 2018 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#ifndef TRIANGLEONCUBERENDERER_H
#define TRIANGLEONCUBERENDERER_H
diff --git a/tests/manual/rhi/triquadcube/trianglerenderer.cpp b/tests/manual/rhi/triquadcube/trianglerenderer.cpp
index 160a94ef46..21e3e791b4 100644
--- a/tests/manual/rhi/triquadcube/trianglerenderer.cpp
+++ b/tests/manual/rhi/triquadcube/trianglerenderer.cpp
@@ -1,9 +1,9 @@
// Copyright (C) 2018 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include "trianglerenderer.h"
#include <QFile>
-#include <QtGui/private/qshader_p.h>
+#include <rhi/qshader.h>
//#define VBUF_IS_DYNAMIC
diff --git a/tests/manual/rhi/triquadcube/trianglerenderer.h b/tests/manual/rhi/triquadcube/trianglerenderer.h
index ec591eb284..bad2198be5 100644
--- a/tests/manual/rhi/triquadcube/trianglerenderer.h
+++ b/tests/manual/rhi/triquadcube/trianglerenderer.h
@@ -1,10 +1,10 @@
// Copyright (C) 2018 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#ifndef TRIANGLERENDERER_H
#define TRIANGLERENDERER_H
-#include <QtGui/private/qrhi_p.h>
+#include <rhi/qrhi.h>
class TriangleRenderer
{
diff --git a/tests/manual/rhi/triquadcube/triquadcube.cpp b/tests/manual/rhi/triquadcube/triquadcube.cpp
index f89f0753af..2ef0d567db 100644
--- a/tests/manual/rhi/triquadcube/triquadcube.cpp
+++ b/tests/manual/rhi/triquadcube/triquadcube.cpp
@@ -1,5 +1,5 @@
// Copyright (C) 2018 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// An example exercising more than a single feature. Enables profiling
// (resource logging to a file) and inserts debug markers and sets some
@@ -35,7 +35,6 @@ struct {
QSize lastOutputSize;
int frameCount = 0;
QFile profOut;
- QVarLengthArray<float, 64> gpuFrameTimes;
QElapsedTimer gpuFrameTimePrintTimer;
} d;
@@ -134,22 +133,10 @@ void Window::customInit()
qDebug("MaxVertexOutputs: %d", m_r->resourceLimit(QRhi::MaxVertexOutputs));
// With Vulkan at least we should see some details from the memory allocator.
- qDebug() << m_r->graphicsMemoryAllocationStatistics();
+ qDebug() << m_r->statistics();
- // Every two seconds try printing an average of the gpu frame times.
+ // Every two seconds try printing last known gpu frame time.
d.gpuFrameTimePrintTimer.start();
- m_r->addGpuFrameTimeCallback([](float elapsedMs) {
- d.gpuFrameTimes.append(elapsedMs);
- if (d.gpuFrameTimePrintTimer.elapsed() > 2000) {
- float at = 0.0f;
- for (float t : d.gpuFrameTimes)
- at += t;
- at /= d.gpuFrameTimes.count();
- qDebug() << "Average GPU frame time" << at;
- d.gpuFrameTimes.clear();
- d.gpuFrameTimePrintTimer.restart();
- }
- });
}
void Window::customRelease()
@@ -170,6 +157,11 @@ void Window::customRender()
const QSize outputSize = m_sc->currentPixelSize();
QRhiCommandBuffer *cb = m_sc->currentFrameCommandBuffer();
+ if (d.gpuFrameTimePrintTimer.elapsed() > 2000) {
+ qDebug() << "Last completed GPU frame time" << cb->lastCompletedGpuTime() << "seconds";
+ d.gpuFrameTimePrintTimer.restart();
+ }
+
if (outputSize != d.lastOutputSize) {
d.triRenderer.resize(outputSize);
if (!d.triangleOnly) {