mirror of
https://github.com/crystalidea/qt6windows7.git
synced 2025-07-07 17:50:59 +08:00
qt 6.6.0 clean
This commit is contained in:
@ -3,7 +3,7 @@
|
||||
|
||||
#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
|
||||
|
@ -4,7 +4,7 @@
|
||||
#ifndef QUADRENDERER_H
|
||||
#define QUADRENDERER_H
|
||||
|
||||
#include <QtGui/private/qrhi_p.h>
|
||||
#include <rhi/qrhi.h>
|
||||
|
||||
class QuadRenderer
|
||||
{
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
#include "texturedcuberenderer.h"
|
||||
#include <QFile>
|
||||
#include <QtGui/private/qshader_p.h>
|
||||
#include <rhi/qshader.h>
|
||||
|
||||
#include "../shared/cube.h"
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
#ifndef TEXTUREDCUBERENDERER_H
|
||||
#define TEXTUREDCUBERENDERER_H
|
||||
|
||||
#include <QtGui/private/qrhi_p.h>
|
||||
#include <rhi/qrhi.h>
|
||||
|
||||
class TexturedCubeRenderer
|
||||
{
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
#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;
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
#include "trianglerenderer.h"
|
||||
#include <QFile>
|
||||
#include <QtGui/private/qshader_p.h>
|
||||
#include <rhi/qshader.h>
|
||||
|
||||
//#define VBUF_IS_DYNAMIC
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
#ifndef TRIANGLERENDERER_H
|
||||
#define TRIANGLERENDERER_H
|
||||
|
||||
#include <QtGui/private/qrhi_p.h>
|
||||
#include <rhi/qrhi.h>
|
||||
|
||||
class TriangleRenderer
|
||||
{
|
||||
|
@ -35,7 +35,6 @@ struct {
|
||||
QSize lastOutputSize;
|
||||
int frameCount = 0;
|
||||
QFile profOut;
|
||||
QVarLengthArray<float, 64> gpuFrameTimes;
|
||||
QElapsedTimer gpuFrameTimePrintTimer;
|
||||
} d;
|
||||
|
||||
@ -136,20 +135,8 @@ void Window::customInit()
|
||||
// With Vulkan at least we should see some details from the memory allocator.
|
||||
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) {
|
||||
|
Reference in New Issue
Block a user