56 #define EXAMPLEFW_PREINIT
57 #include "../shared/examplefw.h"
65 #include <QtGui/private/qrhiprofiler_p.h>
67 #define PROFILE_TO_FILE
90 #ifdef PROFILE_TO_FILE
93 qDebug(
"Writing profiling output to %s", qPrintable(profFn));
94 d.profOut.setFileName(profFn);
106 #ifdef READBACK_SWAPCHAIN
110 #ifdef USE_SRGB_SWAPCHAIN
118 #ifdef USE_MIN_SWAPCHAIN_BUFFERS
122 #ifdef DECLARE_EXT_CONTENTS
132 #ifdef PROFILE_TO_FILE
136 d.triRenderer.setRhi(
m_r);
138 d.triRenderer.initResources(
m_rp);
140 if (!
d.triangleOnly) {
141 d.triRenderer.setTranslation(
QVector3D(0, 0.5f, 0));
143 d.quadRenderer.setRhi(
m_r);
145 d.quadRenderer.setPipeline(
d.triRenderer.pipeline());
146 d.quadRenderer.initResources(
m_rp);
147 d.quadRenderer.setTranslation(
QVector3D(1.5f, -0.5f, 0));
149 d.cubeRenderer.setRhi(
m_r);
151 d.cubeRenderer.initResources(
m_rp);
152 d.cubeRenderer.setTranslation(
QVector3D(0, -0.5f, 0));
155 if (!
d.onScreenOnly) {
156 d.liveTexCubeRenderer.setRhi(
m_r);
158 d.liveTexCubeRenderer.initResources(
m_rp);
159 d.liveTexCubeRenderer.setTranslation(
QVector3D(-2.0f, 0, 0));
199 d.triRenderer.releaseResources();
201 if (!
d.triangleOnly) {
202 d.quadRenderer.releaseResources();
203 d.cubeRenderer.releaseResources();
207 d.liveTexCubeRenderer.releaseResources();
217 if (!
d.triangleOnly) {
226 if (!
d.onScreenOnly) {
227 cb->debugMarkBegin(
"Offscreen triangle pass");
228 d.liveTexCubeRenderer.queueOffscreenPass(
cb);
233 d.triRenderer.queueResourceUpdates(
u);
234 if (!
d.triangleOnly) {
235 d.quadRenderer.queueResourceUpdates(
u);
236 d.cubeRenderer.queueResourceUpdates(
u);
239 d.liveTexCubeRenderer.queueResourceUpdates(
u);
245 if (!
d.triangleOnly) {
254 if (!
d.onScreenOnly) {
262 #ifdef READBACK_SWAPCHAIN
266 int frameNo =
d.frameCount;
267 rbResult->
completed = [
this, rbResult, frameNo] {
275 qDebug(
"Saving into %s", qPrintable(
fn));
286 cb->endPass(passEndUpdates);
small capitals from c petite p scientific f u
const char * constData() const noexcept
The QFile class provides an interface for reading from and writing to files.
The QFileInfo class provides system-independent file information.
QString absoluteFilePath() const
The QImage class provides a hardware-independent image representation that allows direct access to th...
@ Format_RGBA8888_Premultiplied
@ Format_ARGB32_Premultiplied
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal.
int resourceLimit(ResourceLimit limit) const
bool isYUpInFramebuffer() const
bool isFeatureSupported(QRhi::Feature feature) const
@ MaxThreadsPerThreadGroup
@ MaxThreadGroupsPerDimension
QRhiProfiler * profiler()
@ NonDynamicUniformBuffers
@ MultisampleRenderBuffer
@ PipelineCacheDataLoadSave
@ NonFourAlignedEffectiveIndexBufferOffset
QRhiResourceUpdateBatch * nextResourceUpdateBatch()
void setDevice(QIODevice *device)
void addVMemAllocatorStats()
void readBackTexture(const QRhiReadbackDescription &rb, QRhiReadbackResult *result)
The QSize class defines the size of a two-dimensional object using integer point precision.
constexpr int height() const noexcept
constexpr int width() const noexcept
The QString class provides a Unicode character string.
static QString static QString asprintf(const char *format,...) Q_ATTRIBUTE_FORMAT_PRINTF(1
The QVector3D class represents a vector or vertex in 3D space.
std::unique_ptr< QRhiSwapChain > m_sc
std::unique_ptr< QRhiRenderPassDescriptor > m_rp
virtual void customRender()
virtual void customInit()
QRhi::EndFrameFlags endFrameFlags
QRhiSwapChain::Flags scFlags
QRhi::BeginFrameFlags beginFrameFlags
#define QByteArrayLiteral(str)
QT_BEGIN_INCLUDE_NAMESPACE typedef unsigned char uchar
SSL_CTX int(* cb)(SSL *ssl, unsigned char **out, unsigned char *outlen, const unsigned char *in, unsigned int inlen, void *arg)
QRhiTexture::Format format
std::function< void()> completed
TriangleRenderer triRenderer
QuadRenderer quadRenderer
TriangleOnCubeRenderer liveTexCubeRenderer
TexturedCubeRenderer cubeRenderer