summaryrefslogtreecommitdiffstats
path: root/src/gui/rhi/qrhiprofiler_p_p.h
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2021-12-17 17:04:38 +0100
committerLaszlo Agocs <laszlo.agocs@qt.io>2022-01-04 13:00:40 +0100
commit23f8d6c57f8d599b8b9542586801964d10cf8fba (patch)
tree3c0fe3e7b3cb808afcd828687e3613c57b3b9a41 /src/gui/rhi/qrhiprofiler_p_p.h
parentdcc2704d17bda08e6dc7783559ccbfd864dd4339 (diff)
rhi: Drop the profiler for now
The system we inherited from the original Qt 5.14 introduction of QRhi is a text stream based solution where resource creation and frame timings are sent in a comma-separated format to a QIODevice. This, while useful to get insights about the number of resources at a given time, is not actively helpful. The frameworks built on top (Qt Quick, Qt Quick 3D) are expected to provide solutions for logging timings in a different way (e.g. via the QML Profiler). Similarly, tracking active resources and generating statistics from that is better handled on a higher level. The unique bits, such as the Vulkan memory allocator statistics and the GPU frame timestamps, are converted into APIs in QRhi. This way a user of QRhi can query it at any time and do whatever it sees fit with the data. When it comes to the GPU timestamps, that has a somewhat limited value due to the heavy asynchronousness, hence the callback based API. Nonetheless, this is still useful since it is the only means of reporting some frame timing data (an approx. elapsed milliseconds for a frame) from the GPU side. Change-Id: I67cd58b81aaa7e343c11731f9aa5b4804c2a1823 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/gui/rhi/qrhiprofiler_p_p.h')
-rw-r--r--src/gui/rhi/qrhiprofiler_p_p.h124
1 files changed, 0 insertions, 124 deletions
diff --git a/src/gui/rhi/qrhiprofiler_p_p.h b/src/gui/rhi/qrhiprofiler_p_p.h
deleted file mode 100644
index 7d0eec8614..0000000000
--- a/src/gui/rhi/qrhiprofiler_p_p.h
+++ /dev/null
@@ -1,124 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Gui module
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QRHIPROFILER_P_H
-#define QRHIPROFILER_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include "qrhiprofiler_p.h"
-#include <QElapsedTimer>
-#include <QHash>
-
-QT_BEGIN_NAMESPACE
-
-class QRhiProfilerPrivate
-{
-public:
- static QRhiProfilerPrivate *get(QRhiProfiler *p) { return p->d; }
-
- void newBuffer(QRhiBuffer *buf, quint32 realSize, int backingGpuBufCount, int backingCpuBufCount);
- void releaseBuffer(QRhiBuffer *buf);
- void newBufferStagingArea(QRhiBuffer *buf, int slot, quint32 size);
- void releaseBufferStagingArea(QRhiBuffer *buf, int slot);
-
- void newRenderBuffer(QRhiRenderBuffer *rb, bool transientBacking, bool winSysBacking, int sampleCount);
- void releaseRenderBuffer(QRhiRenderBuffer *rb);
-
- void newTexture(QRhiTexture *tex, bool owns, int mipCount, int layerCount, int sampleCount);
- void releaseTexture(QRhiTexture *tex);
- void newTextureStagingArea(QRhiTexture *tex, int slot, quint32 size);
- void releaseTextureStagingArea(QRhiTexture *tex, int slot);
-
- void resizeSwapChain(QRhiSwapChain *sc, int bufferCount, int msaaBufferCount, int sampleCount);
- void releaseSwapChain(QRhiSwapChain *sc);
-
- void beginSwapChainFrame(QRhiSwapChain *sc);
- void endSwapChainFrame(QRhiSwapChain *sc, int frameCount);
- void swapChainFrameGpuTime(QRhiSwapChain *sc, float gpuTimeMs);
-
- void newReadbackBuffer(qint64 id, QRhiResource *src, quint32 size);
- void releaseReadbackBuffer(qint64 id);
-
- void vmemStat(uint realAllocCount, uint subAllocCount, quint32 totalSize, quint32 unusedSize);
-
- void startEntry(QRhiProfiler::StreamOp op, qint64 timestamp, QRhiResource *res);
- void writeInt(const char *key, qint64 v);
- void writeFloat(const char *key, float f);
- void endEntry();
-
- QRhiImplementation *rhiDWhenEnabled = nullptr;
- QIODevice *outputDevice = nullptr;
- QElapsedTimer ts;
- QByteArray buf;
- static const int DEFAULT_FRAME_TIMING_WRITE_INTERVAL = 120; // frames
- int frameTimingWriteInterval = DEFAULT_FRAME_TIMING_WRITE_INTERVAL;
- struct Sc {
- Sc() {
- frameToFrameSamples.reserve(DEFAULT_FRAME_TIMING_WRITE_INTERVAL);
- beginToEndSamples.reserve(DEFAULT_FRAME_TIMING_WRITE_INTERVAL);
- gpuFrameSamples.reserve(DEFAULT_FRAME_TIMING_WRITE_INTERVAL);
- }
- QElapsedTimer frameToFrameTimer;
- bool frameToFrameRunning = false;
- QElapsedTimer beginToEndTimer;
- QList<qint64> frameToFrameSamples;
- QList<qint64> beginToEndSamples;
- QList<float> gpuFrameSamples;
- QRhiProfiler::CpuTime frameToFrameTime;
- QRhiProfiler::CpuTime beginToEndFrameTime;
- QRhiProfiler::GpuTime gpuFrameTime;
- };
- QHash<QRhiSwapChain *, Sc> swapchains;
-};
-
-Q_DECLARE_TYPEINFO(QRhiProfilerPrivate::Sc, Q_RELOCATABLE_TYPE);
-
-QT_END_NAMESPACE
-
-#endif