51 #include "../shared/examplefw.h"
52 #include "../shared/cube.h"
69 d.releasePool <<
d.vbuf;
73 d.releasePool <<
d.ubuf;
75 const QSize cubeMapSize(512, 512);
78 d.releasePool <<
d.tex;
82 d.initialUpdates->uploadStaticBuffer(
d.vbuf, cube);
95 d.initialUpdates->uploadTexture(
d.tex,
desc);
97 d.initialUpdates->generateMips(
d.tex);
101 d.releasePool <<
d.sampler;
105 d.releasePool <<
d.srb;
113 d.releasePool <<
d.ps;
115 d.ps->setDepthTest(
true);
116 d.ps->setDepthWrite(
true);
126 d.ps->setShaderStages({
133 { 3 *
sizeof(float) }
139 d.ps->setVertexInputLayout(inputLayout);
140 d.ps->setShaderResourceBindings(
d.srb);
141 d.ps->setRenderPassDescriptor(
m_rp);
149 d.releasePool.clear();
154 const QSize outputSizeInPixels =
m_sc->currentPixelSize();
158 if (
d.initialUpdates) {
159 u->merge(
d.initialUpdates);
160 d.initialUpdates->release();
161 d.initialUpdates =
nullptr;
172 u->updateDynamicBuffer(
d.ubuf, 0, 64, mvp.
constData());
175 cb->setGraphicsPipeline(
d.ps);
177 cb->setShaderResources();
179 cb->setVertexInput(0, 1, &vbufBinding);
small capitals from c petite p scientific f u
The QImage class provides a hardware-independent image representation that allows direct access to th...
QImage mirrored(bool horizontally=false, bool vertically=true) const &
QImage convertToFormat(Format f, Qt::ImageConversionFlags flags=Qt::AutoColor) const &
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal.
The QMatrix4x4 class represents a 4x4 transformation matrix in 3D space.
void rotate(float angle, const QVector3D &vector)
void scale(const QVector3D &vector)
void perspective(float verticalAngle, float aspectRatio, float nearPlane, float farPlane)
const float * constData() const
QPair< QRhiBuffer *, quint32 > VertexInput
QMatrix4x4 clipSpaceCorrMatrix() const
QRhiShaderResourceBindings * newShaderResourceBindings()
QRhiBuffer * newBuffer(QRhiBuffer::Type type, QRhiBuffer::UsageFlags usage, int size)
QRhiSampler * newSampler(QRhiSampler::Filter magFilter, QRhiSampler::Filter minFilter, QRhiSampler::Filter mipmapMode, QRhiSampler::AddressMode addressU, QRhiSampler::AddressMode addressV, QRhiSampler::AddressMode addressW=QRhiSampler::Repeat)
QRhiGraphicsPipeline * newGraphicsPipeline()
QRhiTexture * newTexture(QRhiTexture::Format format, const QSize &pixelSize, int sampleCount=1, QRhiTexture::Flags flags={})
QRhiResourceUpdateBatch * nextResourceUpdateBatch()
static QRhiShaderResourceBinding sampledTexture(int binding, StageFlags stage, QRhiTexture *tex, QRhiSampler *sampler)
static QRhiShaderResourceBinding uniformBuffer(int binding, StageFlags stage, QRhiBuffer *buf)
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
std::unique_ptr< QRhiSwapChain > m_sc
std::unique_ptr< QRhiRenderPassDescriptor > m_rp
virtual void customRender()
virtual void customInit()
QList< QRhiResource * > releasePool
QRhiShaderResourceBindings * srb
QRhiGraphicsPipeline * ps
QRhiResourceUpdateBatch * initialUpdates
qDeleteAll(list.begin(), list.end())
QShader getShader(const QString &name)
SSL_CTX int(* cb)(SSL *ssl, unsigned char **out, unsigned char *outlen, const unsigned char *in, unsigned int inlen, void *arg)