![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
#include <qrhimetal_p.h>
Public Member Functions | |
| QMetalIndirectCommandBuffer (QRhiImplementation *rhi, Type type, quint32 maxCommandCount) | |
| ~QMetalIndirectCommandBuffer () | |
| void | destroy () override |
| Releases (or requests deferred releasing of) the underlying native graphics resources. | |
| bool | create () override |
| Creates the corresponding native objects. | |
| const QRhiIndirectDrawCommand * | drawCommands () const |
| const QRhiIndexedIndirectDrawCommand * | indexedDrawCommands () const |
| quint64 | contentsGeneration () const |
| 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 | |
| QMetalIndirectCommandBufferData * | d |
| int | lastActiveFrameSlot = -1 |
Friends | |
| class | QRhiMetal |
Definition at line 126 of file qrhimetal_p.h.
| QMetalIndirectCommandBuffer::QMetalIndirectCommandBuffer | ( | QRhiImplementation * | rhi, |
| Type | type, | ||
| quint32 | maxCommandCount ) |
Definition at line 4213 of file qrhimetal.mm.
References QMetalIndirectCommandBuffer(), and d.
Referenced by QMetalIndirectCommandBuffer().
| QMetalIndirectCommandBuffer::~QMetalIndirectCommandBuffer | ( | ) |
|
inline |
Definition at line 141 of file qrhimetal_p.h.
|
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 4249 of file qrhimetal.mm.
References QMetalIndirectCommandBufferData::created, d, destroy(), and lastActiveFrameSlot.
|
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 4226 of file qrhimetal.mm.
References QMetalIndirectCommandBufferData::builtSlot, QMetalIndirectCommandBufferData::created, d, QMetalIndirectCommandBufferData::fallbackBuild, QMetalIndirectCommandBufferData::gpuFilled, qrhimtl_releaseIcbSlots(), and QMetalIndirectCommandBufferData::slotSetupFailed.
Referenced by ~QMetalIndirectCommandBuffer(), and create().
|
inline |
Definition at line 133 of file qrhimetal_p.h.
|
inline |
Definition at line 137 of file qrhimetal_p.h.
Referenced by qrhimtl_encodeIcbFromCpu(), and qrhimtl_replayIcbOnCpu().
|
friend |
Definition at line 145 of file qrhimetal_p.h.
| QMetalIndirectCommandBufferData* QMetalIndirectCommandBuffer::d |
Definition at line 143 of file qrhimetal_p.h.
Referenced by QMetalIndirectCommandBuffer(), ~QMetalIndirectCommandBuffer(), QRhiMetal::buildIndirect(), create(), destroy(), QRhiMetal::executeIndirect(), qrhimtl_ensureIcbSlots(), and qrhimtl_releaseIcbSlots().
| int QMetalIndirectCommandBuffer::lastActiveFrameSlot = -1 |
Definition at line 144 of file qrhimetal_p.h.
Referenced by create(), and qrhimtl_releaseIcbSlots().