43 : offscreenCommandBuffer(
this)
144 Q_UNREACHABLE_RETURN(0);
191 int sampleCount, QRhiRenderBuffer::Flags
flags,
198 const QSize &pixelSize,
int depth,
int arraySize,
199 int sampleCount, QRhiTexture::Flags
flags)
208 return new QNullSampler(
this, magFilter, minFilter, mipmapMode, u,
v,
w);
212 QRhiTextureRenderTarget::Flags
flags)
239 int dynamicOffsetCount,
399 if (!subresDesc.image().isNull()) {
403 ?
src.size() : subresDesc.sourceSize();
406 QRect(subresDesc.sourceTopLeft(), srcSize));
407 }
else if (!subresDesc.data().isEmpty()) {
409 int w = subresSize.
width();
411 if (!subresDesc.sourceSize().isEmpty()) {
412 w = subresDesc.sourceSize().width();
413 h = subresDesc.sourceSize().height();
416 const char *
src = subresDesc.data().constData();
417 const int srcBpl =
w * 4;
418 int srcStride = srcBpl;
419 if (subresDesc.dataStride())
420 srcStride = subresDesc.dataStride();
421 const QPoint dstOffset = subresDesc.destinationTopLeft();
424 for (
int y = 0;
y <
h; ++
y) {
425 memcpy(
dst + dstOffset.
x() * 4 + (
y + dstOffset.
y()) * dstBpl,
454 const int levelCount =
q->mipLevelsForSize(baseSize);
502 result->data.resize(
int(byteSize));
505 for (
int y = 0,
h =
src.height();
y <
h; ++
y) {
506 memcpy(
dst,
src.constScanLine(
y), bytesPerLine);
510 result->data.fill(0,
int(byteSize));
524 const QColor &colorClearValue,
527 QRhiCommandBuffer::BeginPassFlags
flags)
551 QRhiCommandBuffer::BeginPassFlags
flags)
581 rhiD->unregisterResource(
this);
593 rhiD->registerResource(
this);
605 int sampleCount, QRhiRenderBuffer::Flags
flags,
622 rhiD->unregisterResource(
this);
634 rhiD->registerResource(
this);
661 rhiD->unregisterResource(
this);
679 const int mipLevelCount = hasMipMaps ? rhiD->q->mipLevelsForSize(
size) : 1;
686 image.resize(layerCount);
698 rhiD->registerResource(
this);
714 rhiD->registerResource(
this);
721 :
QRhiSampler(rhi, magFilter, minFilter, mipmapMode, u,
v,
w)
734 rhiD->unregisterResource(
this);
740 rhiD->registerResource(
this);
758 rhiD->unregisterResource(
this);
771 rhiD->registerResource(rpD,
false);
827 rhiD->unregisterResource(
this);
834 rhiD->registerResource(rpD,
false);
852 QRhiRenderTargetAttachmentTracker::updateResIdList<QNullTexture, QNullRenderBuffer>(
m_desc, &
d.
currentResIdList);
853 rhiD->registerResource(
this);
859 if (!QRhiRenderTargetAttachmentTracker::isUpToDate<QNullTexture, QNullRenderBuffer>(
m_desc,
d.
currentResIdList))
889 rhiD->unregisterResource(
this);
895 if (!rhiD->sanityCheckShaderResourceBindings(
this))
898 rhiD->updateLayoutDesc(
this);
900 rhiD->registerResource(
this,
false);
923 rhiD->unregisterResource(
this);
929 if (!rhiD->sanityCheckGraphicsPipeline(
this))
932 rhiD->registerResource(
this);
950 rhiD->unregisterResource(
this);
956 rhiD->registerResource(
this);
991 rhiD->unregisterResource(
this);
1006 return QSize(1280, 720);
1018 rhiD->registerResource(rpD,
false);
1035 if (needsRegistration) {
1037 rhiD->registerResource(
this);
void resize(qsizetype size)
Sets the size of the byte array to size bytes.
The QColor class provides colors based on RGB, HSV or CMYK values.
@ Format_RGBA8888_Premultiplied
The QMatrix4x4 class represents a 4x4 transformation matrix in 3D space.
The QPainter class performs low-level painting on widgets and other paint devices.
void setCompositionMode(CompositionMode mode)
Sets the composition mode to the given mode.
void drawImage(const QRectF &targetRect, const QImage &image, const QRectF &sourceRect, Qt::ImageConversionFlags flags=Qt::AutoColor)
Draws the rectangular portion source of the given image into the target rectangle in the paint device...
\inmodule QtCore\reentrant
constexpr int x() const noexcept
Returns the x coordinate of this point.
constexpr int y() const noexcept
Returns the y coordinate of this point.
\inmodule QtCore\reentrant
const char * constData() const
Type
Specifies storage type of buffer resource.
QRhiRenderBuffer * renderBuffer() const
QRhiTexture * texture() const
QPair< QRhiBuffer *, quint32 > VertexInput
Synonym for QPair<QRhiBuffer *, quint32>.
QPair< int, quint32 > DynamicOffset
Synonym for QPair<int, quint32>.
IndexFormat
Specifies the index data type.
void textureFormatInfo(QRhiTexture::Format format, const QSize &size, quint32 *bpl, quint32 *byteSize, quint32 *bytesPerPixel) const
void setShaderResources(QRhiCommandBuffer *cb, QRhiShaderResourceBindings *srb, int dynamicOffsetCount, const QRhiCommandBuffer::DynamicOffset *dynamicOffsets) override
double lastCompletedGpuTime(QRhiCommandBuffer *cb) override
QRhi::FrameOpResult endOffscreenFrame(QRhi::EndFrameFlags flags) override
bool isFeatureSupported(QRhi::Feature feature) const override
QRhiNull(QRhiNullInitParams *params)
void debugMarkMsg(QRhiCommandBuffer *cb, const QByteArray &msg) override
void dispatch(QRhiCommandBuffer *cb, int x, int y, int z) override
QRhi::FrameOpResult beginFrame(QRhiSwapChain *swapChain, QRhi::BeginFrameFlags flags) override
void resourceUpdate(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override
void drawIndexed(QRhiCommandBuffer *cb, quint32 indexCount, quint32 instanceCount, quint32 firstIndex, qint32 vertexOffset, quint32 firstInstance) override
void beginComputePass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates, QRhiCommandBuffer::BeginPassFlags flags) override
void beginPass(QRhiCommandBuffer *cb, QRhiRenderTarget *rt, const QColor &colorClearValue, const QRhiDepthStencilClearValue &depthStencilClearValue, QRhiResourceUpdateBatch *resourceUpdates, QRhiCommandBuffer::BeginPassFlags flags) override
bool isClipDepthZeroToOne() const override
void endComputePass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override
QNullCommandBuffer offscreenCommandBuffer
void endPass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override
QRhi::FrameOpResult endFrame(QRhiSwapChain *swapChain, QRhi::EndFrameFlags flags) override
QRhi::FrameOpResult beginOffscreenFrame(QRhiCommandBuffer **cb, QRhi::BeginFrameFlags flags) override
bool isYUpInNDC() const override
QRhiDriverInfo driverInfo() const override
void setScissor(QRhiCommandBuffer *cb, const QRhiScissor &scissor) override
void simulateTextureUpload(const QRhiResourceUpdateBatchPrivate::TextureOp &u)
QRhiComputePipeline * createComputePipeline() override
void setPipelineCacheData(const QByteArray &data) override
void setVertexInput(QRhiCommandBuffer *cb, int startBinding, int bindingCount, const QRhiCommandBuffer::VertexInput *bindings, QRhiBuffer *indexBuf, quint32 indexOffset, QRhiCommandBuffer::IndexFormat indexFormat) override
void debugMarkBegin(QRhiCommandBuffer *cb, const QByteArray &name) override
void draw(QRhiCommandBuffer *cb, quint32 vertexCount, quint32 instanceCount, quint32 firstVertex, quint32 firstInstance) override
QByteArray pipelineCacheData() override
const QRhiNativeHandles * nativeHandles() override
void setGraphicsPipeline(QRhiCommandBuffer *cb, QRhiGraphicsPipeline *ps) override
void releaseCachedResources() override
void simulateTextureCopy(const QRhiResourceUpdateBatchPrivate::TextureOp &u)
QRhiTexture * createTexture(QRhiTexture::Format format, const QSize &pixelSize, int depth, int arraySize, int sampleCount, QRhiTexture::Flags flags) override
void simulateTextureGenMips(const QRhiResourceUpdateBatchPrivate::TextureOp &u)
QRhiRenderBuffer * createRenderBuffer(QRhiRenderBuffer::Type type, const QSize &pixelSize, int sampleCount, QRhiRenderBuffer::Flags flags, QRhiTexture::Format backingFormatHint) override
bool makeThreadLocalNativeContextCurrent() override
QRhiNullNativeHandles nativeHandlesStruct
bool isYUpInFramebuffer() const override
QRhi::FrameOpResult finish() override
void setComputePipeline(QRhiCommandBuffer *cb, QRhiComputePipeline *ps) override
QRhiBuffer * createBuffer(QRhiBuffer::Type type, QRhiBuffer::UsageFlags usage, quint32 size) override
QRhiStats statistics() override
void beginExternal(QRhiCommandBuffer *cb) override
QRhiSwapChain * createSwapChain() override
void setViewport(QRhiCommandBuffer *cb, const QRhiViewport &viewport) override
QRhiTextureRenderTarget * createTextureRenderTarget(const QRhiTextureRenderTargetDescription &desc, QRhiTextureRenderTarget::Flags flags) override
QRhiGraphicsPipeline * createGraphicsPipeline() override
bool create(QRhi::Flags flags) override
void setStencilRef(QRhiCommandBuffer *cb, quint32 refValue) override
void debugMarkEnd(QRhiCommandBuffer *cb) override
QList< int > supportedSampleCounts() const override
QMatrix4x4 clipSpaceCorrMatrix() const override
QRhiSampler * createSampler(QRhiSampler::Filter magFilter, QRhiSampler::Filter minFilter, QRhiSampler::Filter mipmapMode, QRhiSampler::AddressMode u, QRhiSampler::AddressMode v, QRhiSampler::AddressMode w) override
QRhiSwapChain * currentSwapChain
int ubufAlignment() const override
bool isTextureFormatSupported(QRhiTexture::Format format, QRhiTexture::Flags flags) const override
int resourceLimit(QRhi::ResourceLimit limit) const override
QRhiShaderResourceBindings * createShaderResourceBindings() override
void setBlendConstants(QRhiCommandBuffer *cb, const QColor &c) override
void endExternal(QRhiCommandBuffer *cb) override
bool isDeviceLost() const override
QRhiTexture * texture() const
Type
Specifies the type of the renderbuffer.
void setRenderPassDescriptor(QRhiRenderPassDescriptor *desc)
Sets the QRhiRenderPassDescriptor desc for use with this render target.
QRhiRenderPassDescriptor * m_renderPassDesc
QVarLengthArray< BufferOp, BUFFER_OPS_STATIC_ALLOC > bufferOps
QVarLengthArray< TextureOp, TEXTURE_OPS_STATIC_ALLOC > textureOps
static QRhiResourceUpdateBatchPrivate * get(QRhiResourceUpdateBatch *b)
virtual Type resourceType() const =0
QRhiImplementation * m_rhi
Filter
Specifies the minification, magnification, or mipmap filtering.
AddressMode
Specifies the addressing mode.
QSize currentPixelSize() const
QRhiRenderPassDescriptor * m_renderPassDesc
Format
Describes the swapchain format.
QPoint destinationTopLeft() const
QPoint sourceTopLeft() const
int destinationLevel() const
int destinationLayer() const
const QRhiColorAttachment * cbeginColorAttachments() const
QRhiTexture * depthTexture() const
const QRhiColorAttachment * cendColorAttachments() const
QRhiRenderBuffer * depthStencilBuffer() const
QRhiTextureRenderTargetDescription m_desc
QRhiTextureRenderTargetDescription description() const
Format
Specifies the texture format.
ResourceLimit
Describes the resource limit to query.
@ MaxThreadsPerThreadGroup
@ MaxThreadGroupsPerDimension
Feature
Flag values to indicate what features are supported by the backend currently in use.
static const int MAX_MIP_LEVELS
FrameOpResult
Describes the result of operations that can have a soft failure.
constexpr int height() const noexcept
Returns the height.
constexpr int width() const noexcept
Returns the width.
constexpr bool isEmpty() const noexcept
Returns true if either of the width and height is less than or equal to 0; otherwise returns false.
constexpr size_type size() const noexcept
Combined button and popup list for selecting options.
#define QByteArrayLiteral(str)
constexpr const T & qMax(const T &a, const T &b)
GLsizei const GLfloat * v
[13]
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat z
GLint GLint GLint GLint GLint x
[0]
GLint GLenum GLsizei GLsizei GLsizei depth
GLenum GLuint GLint level
GLfloat GLfloat GLfloat w
[0]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLint GLsizei GLsizei GLenum format
GLfloat GLfloat GLfloat GLfloat h
GLdouble GLdouble GLdouble GLdouble q
GLsizeiptr const void GLenum usage
SSL_CTX int(* cb)(SSL *ssl, unsigned char **out, unsigned char *outlen, const unsigned char *in, unsigned int inlen, void *arg)
QFileInfo info(fileName)
[8]
view viewport() -> scroll(dx, dy, deviceRect)
QNullBuffer(QRhiImplementation *rhi, Type type, UsageFlags usage, quint32 size)
bool create() override
Creates the corresponding native graphics resources.
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
char * beginFullDynamicBufferUpdateForCurrentFrame() override
QNullCommandBuffer(QRhiImplementation *rhi)
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
QNullComputePipeline(QRhiImplementation *rhi)
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
bool create() override
Creates the corresponding native graphics resources.
QNullGraphicsPipeline(QRhiImplementation *rhi)
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
bool create() override
Creates the corresponding native graphics resources.
QNullRenderBuffer(QRhiImplementation *rhi, Type type, const QSize &pixelSize, int sampleCount, QRhiRenderBuffer::Flags flags, QRhiTexture::Format backingFormatHint)
QRhiTexture::Format backingFormat() const override
QNullRenderPassDescriptor(QRhiImplementation *rhi)
QRhiRenderPassDescriptor * newCompatibleRenderPassDescriptor() const override
~QNullRenderPassDescriptor()
QVector< quint32 > serializedFormat() const override
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
bool isCompatible(const QRhiRenderPassDescriptor *other) const override
QRhiRenderTargetAttachmentTracker::ResIdList currentResIdList
QNullRenderPassDescriptor * rp
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
QNullSampler(QRhiImplementation *rhi, Filter magFilter, Filter minFilter, Filter mipmapMode, AddressMode u, AddressMode v, AddressMode w)
QNullShaderResourceBindings(QRhiImplementation *rhi)
void updateResources(UpdateFlags flags) override
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
~QNullShaderResourceBindings()
QSize pixelSize() const override
float devicePixelRatio() const override
~QNullSwapChainRenderTarget()
QNullSwapChainRenderTarget(QRhiImplementation *rhi, QRhiSwapChain *swapchain)
int sampleCount() const override
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
bool createOrResize() override
Creates the swapchain if not already done and resizes the swapchain buffers to match the current size...
QSize surfacePixelSize() override
QNullSwapChainRenderTarget rt
bool isFormatSupported(Format f) override
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
QRhiCommandBuffer * currentFrameCommandBuffer() override
QRhiRenderPassDescriptor * newCompatibleRenderPassDescriptor() override
QRhiRenderTarget * currentFrameRenderTarget() override
QNullSwapChain(QRhiImplementation *rhi)
~QNullTextureRenderTarget()
QSize pixelSize() const override
int sampleCount() const override
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
QRhiRenderPassDescriptor * newCompatibleRenderPassDescriptor() override
bool create() override
Creates the corresponding native graphics resources.
QNullTextureRenderTarget(QRhiImplementation *rhi, const QRhiTextureRenderTargetDescription &desc, Flags flags)
float devicePixelRatio() const override
bool create() override
Creates the corresponding native graphics resources.
bool createFrom(NativeTexture src) override
Similar to create(), except that no new native textures are created.
QVarLengthArray< std::array< QImage, QRhi::MAX_MIP_LEVELS >, 6 > image
QNullTexture(QRhiImplementation *rhi, Format format, const QSize &pixelSize, int depth, int arraySize, int sampleCount, Flags flags)
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
\variable QRhiReadbackResult::completed
QRhiReadbackResult * result
QRhiTextureCopyDescription desc
QRhiReadbackDescription rb
QVarLengthArray< MipLevelUploadList, 6 > subresDesc
QRhiReadbackResult * result