![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
#include <qrhi_p.h>
Public Member Functions | |
| QRhiBufferBackedIndirectCommandBuffer (QRhiImplementation *rhi, Type type, quint32 maxCommandCount) | |
| \variable QRhiIndirectCommandBufferBuildInfo::topology | |
| ~QRhiBufferBackedIndirectCommandBuffer () | |
| void | destroy () override |
| Releases (or requests deferred releasing of) the underlying native graphics resources. | |
| bool | create () override |
| Creates the corresponding native objects. | |
| void | enqueueUpload (QRhiResourceUpdateBatch *u) |
| void | execute (QRhiCommandBuffer *cb, quint32 firstCommand, quint32 commandCount) |
| void | build (const QRhiIndirectCommandBufferBuildInfo &info) |
| Public Member Functions inherited from QRhiIndirectCommandBuffer | |
| QRhiResource::Type | resourceType () const override |
| Type | type () const |
| void | setType (Type t) |
| Sets the command type t. | |
| quint32 | maxCommandCount () const |
| void | setMaxCommandCount (quint32 count) |
| Sets the capacity, the maximum number of commands, to count. | |
| void | clear () |
| Discards all commands recorded so far. | |
| void | draw (quint32 vertexCount, quint32 instanceCount=1, quint32 firstVertex=0, quint32 firstInstance=0) |
| Records a non-indexed draw command with vertexCount, instanceCount, firstVertex, and firstInstance. | |
| void | drawIndexed (quint32 indexCount, quint32 instanceCount=1, quint32 firstIndex=0, qint32 vertexOffset=0, quint32 firstInstance=0) |
| Records an indexed draw command with indexCount, instanceCount, firstIndex, vertexOffset, and firstInstance. | |
| quint32 | recordedCommandCount () const |
| bool | isGpuBuilt () const |
| quint32 | commandCount () const |
| Public Member Functions inherited from QRhiResource | |
| virtual | ~QRhiResource () |
| Destructor. | |
| 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 | |
| bool | valid = false |
| QRhiBuffer * | buffer = nullptr |
| quint64 | uploadedGeneration = 0 |
| QRhiIndirectCommandBufferBuildInfo | buildInfo |
| QRhiBufferBackedIndirectCommandBuffer::QRhiBufferBackedIndirectCommandBuffer | ( | QRhiImplementation * | rhi, |
| Type | type, | ||
| quint32 | maxCommandCount ) |
\variable QRhiIndirectCommandBufferBuildInfo::topology
The topology the commands will be drawn with. Must match the topology of the graphics pipeline that is set when QRhiCommandBuffer::executeIndirect() is called. Some backends need it in order to build their native indirect command buffer, and it is not available to them outside of a render pass.
\variable QRhiIndirectCommandBufferBuildInfo::sourceBuffer
The buffer holding the QRhiIndirectDrawCommand or QRhiIndexedIndirectDrawCommand entries. Must have IndirectBuffer usage.
Its size is not used to work out how many commands there are, see commandCount.
\variable QRhiIndirectCommandBufferBuildInfo::sourceBufferOffset
\variable QRhiIndirectCommandBufferBuildInfo::commandCount
The number of commands to take from sourceBuffer. This is what QRhiIndirectCommandBuffer::commandCount() reports afterwards, and so how many draws QRhiCommandBuffer::executeIndirect() issues by default.
0 means QRhiIndirectCommandBuffer::maxCommandCount(). It does not mean "as many as fit in sourceBuffer": a buffer written by the GPU can be larger than the number of commands in it, so no count is ever derived from its size. A value above QRhiIndirectCommandBuffer::maxCommandCount() is clamped to it, with a warning.
\variable QRhiIndirectCommandBufferBuildInfo::stride
The byte distance between two commands in sourceBuffer. 0 means the size of the corresponding command struct.
\variable QRhiIndirectCommandBufferBuildInfo::countBuffer
An optional buffer whose first quint32 holds the number of commands to execute. Requires QRhi::DrawIndirectCount.
\variable QRhiIndirectCommandBufferBuildInfo::countBufferOffset
\variable QRhiIndirectCommandBufferBuildInfo::indexBuffer
The index buffer the commands index into. Required for IndexedDraws.
\variable QRhiIndirectCommandBufferBuildInfo::indexBufferOffset
\variable QRhiIndirectCommandBufferBuildInfo::indexFormat
Definition at line 9093 of file qrhi.cpp.
References QRhiBufferBackedIndirectCommandBuffer().
Referenced by QRhiBufferBackedIndirectCommandBuffer().
| QRhiBufferBackedIndirectCommandBuffer::~QRhiBufferBackedIndirectCommandBuffer | ( | ) |
| void QRhiBufferBackedIndirectCommandBuffer::build | ( | const QRhiIndirectCommandBufferBuildInfo & | info | ) |
|
overridevirtual |
Creates the corresponding native objects.
Fails when maxCommandCount() is 0.
A given QRhiIndirectCommandBuffer takes its commands either from draw() and drawIndexed() followed by QRhiResourceUpdateBatch::commitIndirectCommandBuffer(), or from QRhiCommandBuffer::buildIndirect(), but not from both. Moving to the latter is one-way: clear() does not undo it, and neither does a subsequent commitIndirectCommandBuffer(); isGpuBuilt() stays true and the commands keep coming from the buffer. Call create() again to get an indirect command buffer that is populated from the CPU once more.
true when successful, false when a graphics operation failed. Implements QRhiIndirectCommandBuffer.
Definition at line 9128 of file qrhi.cpp.
References destroy(), and valid.
|
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 9105 of file qrhi.cpp.
Referenced by ~QRhiBufferBackedIndirectCommandBuffer(), and create().
| void QRhiBufferBackedIndirectCommandBuffer::enqueueUpload | ( | QRhiResourceUpdateBatch * | u | ) |
| void QRhiBufferBackedIndirectCommandBuffer::execute | ( | QRhiCommandBuffer * | cb, |
| quint32 | firstCommand, | ||
| quint32 | commandCount ) |
| QRhiBuffer* QRhiBufferBackedIndirectCommandBuffer::buffer = nullptr |
Definition at line 320 of file qrhi_p.h.
Referenced by testing.tools.encode_pdf_filter._Ascii85DecodePdfStream::close(), testing.tools.encode_pdf_filter._FlateDecodePdfStream::close(), testing.tools.encode_pdf_filter._PdfStream::close(), destroy(), enqueueUpload(), execute(), testing.tools.encode_pdf_filter._FlateDecodePdfStream::flush(), testing.tools.encode_pdf_filter._PdfStream::flush(), testing.tools.encode_pdf_filter._SinkPdfStream::getbuffer(), testing.tools.encode_pdf_filter._FlateDecodePdfStream::write(), testing.tools.encode_pdf_filter._PdfStream::write(), and testing.tools.encode_pdf_filter._PngIdatPdfStream::write().
| QRhiIndirectCommandBufferBuildInfo QRhiBufferBackedIndirectCommandBuffer::buildInfo |
| quint64 QRhiBufferBackedIndirectCommandBuffer::uploadedGeneration = 0 |
| bool QRhiBufferBackedIndirectCommandBuffer::valid = false |