![]() |
Qt 6.x
The Qt SDK
|
#include <qrhinull_p.h>
Public Member Functions | |
QNullBuffer (QRhiImplementation *rhi, Type type, UsageFlags usage, quint32 size) | |
~QNullBuffer () | |
void | destroy () override |
Releases (or requests deferred releasing of) the underlying native graphics resources. | |
bool | create () override |
Creates the corresponding native graphics resources. | |
char * | beginFullDynamicBufferUpdateForCurrentFrame () override |
![]() | |
QRhiResource::Type | resourceType () const override |
Type | type () const |
void | setType (Type t) |
Sets the buffer's type to t. | |
UsageFlags | usage () const |
void | setUsage (UsageFlags u) |
Sets the buffer's usage flags to u. | |
quint32 | size () const |
void | setSize (quint32 sz) |
Sets the size of the buffer in bytes. | |
virtual bool | create ()=0 |
Creates the corresponding native graphics resources. | |
virtual NativeBuffer | nativeBuffer () |
virtual char * | beginFullDynamicBufferUpdateForCurrentFrame () |
virtual void | endFullDynamicBufferUpdateForCurrentFrame () |
To be called when the entire contents of the buffer data has been updated in the memory block returned from beginFullDynamicBufferUpdateForCurrentFrame(). | |
![]() | |
virtual | ~QRhiResource () |
Destructor. | |
virtual Type | resourceType () const =0 |
virtual void | destroy ()=0 |
Releases (or requests deferred releasing of) the underlying native graphics resources. | |
void | deleteLater () |
When called without a frame being recorded, this function is equivalent to deleting the object. | |
QByteArray | name () const |
void | setName (const QByteArray &name) |
Sets a name for the object. | |
quint64 | globalResourceId () const |
QRhi * | rhi () const |
Public Attributes | |
char * | data = nullptr |
Additional Inherited Members | |
![]() | |
enum | Type { Immutable , Static , Dynamic } |
Specifies storage type of buffer resource. More... | |
enum | UsageFlag { VertexBuffer = 1 << 0 , IndexBuffer = 1 << 1 , UniformBuffer = 1 << 2 , StorageBuffer = 1 << 3 } |
Flag values to specify how the buffer is going to be used. More... | |
![]() | |
enum | Type { Buffer , Texture , Sampler , RenderBuffer , RenderPassDescriptor , SwapChainRenderTarget , TextureRenderTarget , ShaderResourceBindings , GraphicsPipeline , SwapChain , ComputePipeline , CommandBuffer } |
Specifies type of the resource. More... | |
![]() | |
QRhiBuffer (QRhiImplementation *rhi, Type type_, UsageFlags usage_, quint32 size_) | |
\variable QRhiBuffer::NativeBuffer::objects | |
![]() | |
QRhiResource (QRhiImplementation *rhi) | |
![]() | |
Type | m_type |
UsageFlags | m_usage |
quint32 | m_size |
![]() | |
QRhiImplementation * | m_rhi = nullptr |
quint64 | m_id |
QByteArray | m_objectName |
Definition at line 22 of file qrhinull_p.h.
QNullBuffer::QNullBuffer | ( | QRhiImplementation * | rhi, |
Type | type, | ||
UsageFlags | usage, | ||
quint32 | size | ||
) |
Definition at line 564 of file qrhinull.cpp.
QNullBuffer::~QNullBuffer | ( | ) |
Definition at line 569 of file qrhinull.cpp.
References destroy().
|
overridevirtual |
This is a shortcut for medium-to-large dynamic uniform buffers that have their entire contents (or at least all regions that are read by the shaders in the current frame) changed {in every frame} and the QRhiResourceUpdateBatch-based update mechanism is seen too heavy due to the amount of data copying involved.
The call to this function must be eventually followed by a call to endFullDynamicUniformBufferUpdateForCurrentFrame(), before recording any render or compute pass that relies on this buffer.
Reimplemented from QRhiBuffer.
Definition at line 598 of file qrhinull.cpp.
References data, QRhiBuffer::Dynamic, QRhiBuffer::m_type, and Q_ASSERT.
|
overridevirtual |
Creates the corresponding native graphics resources.
If there are already resources present due to an earlier create() with no corresponding destroy(), then destroy() is called implicitly first.
true
when successful, false
when a graphics operation failed. Regardless of the return value, calling destroy() is always safe. Implements QRhiBuffer.
Definition at line 584 of file qrhinull.cpp.
References destroy(), QRhiBuffer::m_size, and QRHI_RES_RHI.
|
overridevirtual |
Releases (or requests deferred releasing of) the underlying native graphics resources.
Safe to call multiple times, subsequent invocations will be a no-op then.
Once destroy() is called, the QRhiResource instance can be reused, by calling create()
again. That will then result in creating new native graphics resources underneath.
The QRhiResource destructor also performs the same task, so calling this function is not necessary before deleting a QRhiResource.
Implements QRhiResource.
Definition at line 574 of file qrhinull.cpp.
References data, and QRHI_RES_RHI.
Referenced by ~QNullBuffer(), and create().
char* QNullBuffer::data = nullptr |
Definition at line 30 of file qrhinull_p.h.
Referenced by beginFullDynamicBufferUpdateForCurrentFrame(), destroy(), and QRhiNull::resourceUpdate().