Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
|
#include <qrhigles2_p.h>
Classes | |
struct | Command |
struct | ComputePassState |
struct | GraphicsPassState |
struct | TextureUnitState |
Public Types | |
enum | PassType { NoPass , RenderPass , ComputePass } |
Public Types inherited from QRhiCommandBuffer | |
enum | IndexFormat { IndexUInt16 , IndexUInt32 } |
Specifies the index data type. More... | |
enum | BeginPassFlag { ExternalContent = 0x01 , DoNotTrackResourcesForCompute = 0x02 } |
Flag values for QRhi::beginPass() More... | |
using | DynamicOffset = QPair<int, quint32> |
Synonym for QPair<int, quint32>. | |
using | VertexInput = QPair<QRhiBuffer *, quint32> |
Synonym for QPair<QRhiBuffer *, quint32>. | |
Public Types inherited from QRhiResource | |
enum | Type { Buffer , Texture , Sampler , RenderBuffer , RenderPassDescriptor , SwapChainRenderTarget , TextureRenderTarget , ShaderResourceBindings , GraphicsPipeline , SwapChain , ComputePipeline , CommandBuffer } |
Specifies type of the resource. More... | |
Public Member Functions | |
QGles2CommandBuffer (QRhiImplementation *rhi) | |
~QGles2CommandBuffer () | |
void | destroy () override |
Releases (or requests deferred releasing of) the underlying native graphics resources. | |
const void * | retainData (const QByteArray &data) |
const uchar * | retainBufferData (const QRhiBufferData &data) |
const void * | retainImage (const QImage &image) |
void | resetCommands () |
void | resetState () |
void | resetCachedState () |
Public Member Functions inherited from QRhiCommandBuffer | |
QRhiResource::Type | resourceType () const override |
void | resourceUpdate (QRhiResourceUpdateBatch *resourceUpdates) |
Sometimes committing resource updates is necessary or just more convenient without starting a render pass. | |
void | beginPass (QRhiRenderTarget *rt, const QColor &colorClearValue, const QRhiDepthStencilClearValue &depthStencilClearValue, QRhiResourceUpdateBatch *resourceUpdates=nullptr, BeginPassFlags flags={}) |
Records starting a new render pass targeting the render target rt. | |
void | endPass (QRhiResourceUpdateBatch *resourceUpdates=nullptr) |
Records ending the current render pass. | |
void | setGraphicsPipeline (QRhiGraphicsPipeline *ps) |
Records setting a new graphics pipeline ps. | |
void | setShaderResources (QRhiShaderResourceBindings *srb=nullptr, int dynamicOffsetCount=0, const DynamicOffset *dynamicOffsets=nullptr) |
Records binding a set of shader resources, such as, uniform buffers or textures, that are made visible to one or more shader stages. | |
void | setVertexInput (int startBinding, int bindingCount, const VertexInput *bindings, QRhiBuffer *indexBuf=nullptr, quint32 indexOffset=0, IndexFormat indexFormat=IndexUInt16) |
Records vertex input bindings. | |
void | setViewport (const QRhiViewport &viewport) |
Records setting the active viewport rectangle specified in viewport. | |
void | setScissor (const QRhiScissor &scissor) |
Records setting the active scissor rectangle specified in scissor. | |
void | setBlendConstants (const QColor &c) |
Records setting the active blend constants to c. | |
void | setStencilRef (quint32 refValue) |
Records setting the active stencil reference value to refValue. | |
void | draw (quint32 vertexCount, quint32 instanceCount=1, quint32 firstVertex=0, quint32 firstInstance=0) |
Records a non-indexed draw. | |
void | drawIndexed (quint32 indexCount, quint32 instanceCount=1, quint32 firstIndex=0, qint32 vertexOffset=0, quint32 firstInstance=0) |
Records an indexed draw. | |
void | debugMarkBegin (const QByteArray &name) |
Records a named debug group on the command buffer with the specified name. | |
void | debugMarkEnd () |
Records the end of a debug group. | |
void | debugMarkMsg (const QByteArray &msg) |
Inserts a debug message msg into the command stream. | |
void | beginComputePass (QRhiResourceUpdateBatch *resourceUpdates=nullptr, BeginPassFlags flags={}) |
Records starting a new compute pass. | |
void | endComputePass (QRhiResourceUpdateBatch *resourceUpdates=nullptr) |
Records ending the current compute pass. | |
void | setComputePipeline (QRhiComputePipeline *ps) |
Records setting a new compute pipeline ps. | |
void | dispatch (int x, int y, int z) |
Records dispatching compute work items, with x, y, and z specifying the number of local workgroups in the corresponding dimension. | |
const QRhiNativeHandles * | nativeHandles () |
void | beginExternal () |
To be called when the application before the application is about to enqueue commands to the current pass' command buffer by calling graphics API functions directly. | |
void | endExternal () |
To be called once the externally added commands are recorded to the command buffer or context. | |
double | lastCompletedGpuTime () |
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 |
Static Public Attributes | |
static const int | MAX_DYNAMIC_OFFSET_COUNT = 8 |
Additional Inherited Members | |
Protected Member Functions inherited from QRhiCommandBuffer | |
QRhiCommandBuffer (QRhiImplementation *rhi) | |
Protected Member Functions inherited from QRhiResource | |
QRhiResource (QRhiImplementation *rhi) | |
Protected Attributes inherited from QRhiResource | |
QRhiImplementation * | m_rhi = nullptr |
quint64 | m_id |
QByteArray | m_objectName |
Definition at line 302 of file qrhigles2_p.h.
Enumerator | |
---|---|
NoPass | |
RenderPass | |
ComputePass |
Definition at line 550 of file qrhigles2_p.h.
QGles2CommandBuffer::QGles2CommandBuffer | ( | QRhiImplementation * | rhi | ) |
Definition at line 6519 of file qrhigles2.cpp.
References resetState().
QGles2CommandBuffer::~QGles2CommandBuffer | ( | ) |
Definition at line 6525 of file qrhigles2.cpp.
References destroy().
|
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 6530 of file qrhigles2.cpp.
Referenced by ~QGles2CommandBuffer().
|
inline |
Definition at line 663 of file qrhigles2_p.h.
References computePassState, currentComputePipeline, currentComputeSrb, currentGraphicsPipeline, currentGraphicsSrb, currentPipelineGeneration, currentSrbGeneration, graphicsPassState, and textureUnitState.
Referenced by QRhiGles2::beginComputePass(), QRhiGles2::beginPass(), QRhiGles2::endExternal(), and resetState().
|
inline |
Definition at line 646 of file qrhigles2_p.h.
References bufferDataRetainPool, QVarLengthArray< T, Prealloc >::clear(), currentPassResTrackerIndex, dataRetainPool, imageRetainPool, and passResTrackers.
Referenced by QRhiGles2::beginExternal(), QRhiGles2::finish(), and resetState().
|
inline |
Definition at line 655 of file qrhigles2_p.h.
References currentTarget, NoPass, passNeedsResourceTracking, recordingPass, resetCachedState(), and resetCommands().
Referenced by QGles2CommandBuffer().
|
inline |
Definition at line 638 of file qrhigles2_p.h.
References QVarLengthArray< T, Prealloc >::append(), bufferDataRetainPool, QRhiBufferData::constData(), and QVarLengthArray< T, Prealloc >::last().
Referenced by QRhiGles2::enqueueResourceUpdates().
|
inline |
Definition at line 634 of file qrhigles2_p.h.
References QVarLengthArray< T, Prealloc >::append(), QByteArray::constData(), dataRetainPool, and QVarLengthArray< T, Prealloc >::last().
Referenced by QRhiGles2::enqueueSubresUpload().
Definition at line 642 of file qrhigles2_p.h.
References QVarLengthArray< T, Prealloc >::append(), QImage::constBits(), imageRetainPool, and QVarLengthArray< T, Prealloc >::last().
Referenced by QRhiGles2::enqueueSubresUpload().
QVarLengthArray<QRhiBufferData, 4> QGles2CommandBuffer::bufferDataRetainPool |
Definition at line 630 of file qrhigles2_p.h.
Referenced by resetCommands(), and retainBufferData().
QRhiBackendCommandList<Command> QGles2CommandBuffer::commands |
Definition at line 556 of file qrhigles2_p.h.
Referenced by addBoundaryCommand(), QRhiGles2::beginExternal(), QRhiGles2::beginPass(), QRhiGles2::dispatch(), QRhiGles2::draw(), QRhiGles2::drawIndexed(), QRhiGles2::endExternal(), QRhiGles2::endPass(), QRhiGles2::enqueueBarriersForPass(), QRhiGles2::enqueueBindFramebuffer(), QRhiGles2::enqueueResourceUpdates(), QRhiGles2::enqueueSubresUpload(), QRhiGles2::executeCommandBuffer(), QRhiGles2::setBlendConstants(), QRhiGles2::setComputePipeline(), QRhiGles2::setGraphicsPipeline(), QRhiGles2::setScissor(), QRhiGles2::setShaderResources(), QRhiGles2::setStencilRef(), QRhiGles2::setVertexInput(), QRhiGles2::setViewport(), QRhiGles2::trackedBufferBarrier(), and QRhiGles2::trackedImageBarrier().
struct QGles2CommandBuffer::ComputePassState QGles2CommandBuffer::computePassState |
Referenced by QRhiGles2::beginExternal(), QRhiGles2::dispatch(), and resetCachedState().
QRhiComputePipeline* QGles2CommandBuffer::currentComputePipeline |
Definition at line 565 of file qrhigles2_p.h.
Referenced by resetCachedState(), QRhiGles2::setComputePipeline(), QRhiGles2::setGraphicsPipeline(), and QRhiGles2::setShaderResources().
QRhiShaderResourceBindings* QGles2CommandBuffer::currentComputeSrb |
Definition at line 568 of file qrhigles2_p.h.
Referenced by QRhiGles2::dispatch(), resetCachedState(), and QRhiGles2::setShaderResources().
QRhiGraphicsPipeline* QGles2CommandBuffer::currentGraphicsPipeline |
Definition at line 564 of file qrhigles2_p.h.
Referenced by QRhiGles2::draw(), QRhiGles2::drawIndexed(), resetCachedState(), QRhiGles2::setComputePipeline(), QRhiGles2::setGraphicsPipeline(), QRhiGles2::setShaderResources(), QRhiGles2::setStencilRef(), and QRhiGles2::setVertexInput().
QRhiShaderResourceBindings* QGles2CommandBuffer::currentGraphicsSrb |
Definition at line 567 of file qrhigles2_p.h.
Referenced by resetCachedState(), and QRhiGles2::setShaderResources().
int QGles2CommandBuffer::currentPassResTrackerIndex |
Definition at line 558 of file qrhigles2_p.h.
Referenced by QRhiGles2::endExternal(), QRhiGles2::enqueueBarriersForPass(), QRhiGles2::enqueueBindFramebuffer(), resetCommands(), QRhiGles2::setShaderResources(), and QRhiGles2::setVertexInput().
uint QGles2CommandBuffer::currentPipelineGeneration |
Definition at line 566 of file qrhigles2_p.h.
Referenced by resetCachedState(), QRhiGles2::setComputePipeline(), and QRhiGles2::setGraphicsPipeline().
uint QGles2CommandBuffer::currentSrbGeneration |
Definition at line 569 of file qrhigles2_p.h.
Referenced by resetCachedState(), and QRhiGles2::setShaderResources().
QRhiRenderTarget* QGles2CommandBuffer::currentTarget |
Definition at line 563 of file qrhigles2_p.h.
Referenced by QRhiGles2::beginPass(), QRhiGles2::endExternal(), QRhiGles2::endPass(), and resetState().
QVarLengthArray<QByteArray, 4> QGles2CommandBuffer::dataRetainPool |
Definition at line 629 of file qrhigles2_p.h.
Referenced by resetCommands(), and retainData().
struct QGles2CommandBuffer::GraphicsPassState QGles2CommandBuffer::graphicsPassState |
Referenced by QRhiGles2::executeBindGraphicsPipeline(), QRhiGles2::executeCommandBuffer(), and resetCachedState().
QVarLengthArray<QImage, 4> QGles2CommandBuffer::imageRetainPool |
Definition at line 631 of file qrhigles2_p.h.
Referenced by resetCommands(), and retainImage().
double QGles2CommandBuffer::lastGpuTime = 0 |
Definition at line 562 of file qrhigles2_p.h.
Referenced by QRhiGles2::lastCompletedGpuTime().
|
static |
Definition at line 309 of file qrhigles2_p.h.
Referenced by QRhiGles2::setShaderResources().
bool QGles2CommandBuffer::passNeedsResourceTracking |
Definition at line 561 of file qrhigles2_p.h.
Referenced by QRhiGles2::beginPass(), QRhiGles2::enqueueBindFramebuffer(), resetState(), QRhiGles2::setShaderResources(), and QRhiGles2::setVertexInput().
QVarLengthArray<QRhiPassResourceTracker, 8> QGles2CommandBuffer::passResTrackers |
Definition at line 557 of file qrhigles2_p.h.
Referenced by QRhiGles2::enqueueBarriersForPass(), QRhiGles2::enqueueBindFramebuffer(), QRhiGles2::executeCommandBuffer(), resetCommands(), QRhiGles2::setShaderResources(), and QRhiGles2::setVertexInput().
PassType QGles2CommandBuffer::recordingPass |
Definition at line 560 of file qrhigles2_p.h.
Referenced by QRhiGles2::beginComputePass(), QRhiGles2::beginExternal(), QRhiGles2::beginPass(), QRhiGles2::dispatch(), QRhiGles2::draw(), QRhiGles2::drawIndexed(), QRhiGles2::endComputePass(), QRhiGles2::endExternal(), QRhiGles2::endPass(), QRhiGles2::finish(), resetState(), QRhiGles2::setBlendConstants(), QRhiGles2::setComputePipeline(), QRhiGles2::setGraphicsPipeline(), QRhiGles2::setScissor(), QRhiGles2::setShaderResources(), QRhiGles2::setStencilRef(), QRhiGles2::setVertexInput(), QRhiGles2::setViewport(), QRhiGles2::trackedBufferBarrier(), and QRhiGles2::trackedImageBarrier().
struct QGles2CommandBuffer::TextureUnitState QGles2CommandBuffer::textureUnitState[16] |
Referenced by QRhiGles2::bindCombinedSampler(), and resetCachedState().