![]() |
Qt 6.x
The Qt SDK
|
#include <qrhid3d11_p.h>
Classes | |
struct | Command |
Public Types | |
enum | PassType { NoPass , RenderPass , ComputePass } |
![]() | |
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>. | |
![]() | |
enum | Type { Buffer , Texture , Sampler , RenderBuffer , RenderPassDescriptor , SwapChainRenderTarget , TextureRenderTarget , ShaderResourceBindings , GraphicsPipeline , SwapChain , ComputePipeline , CommandBuffer } |
Specifies type of the resource. More... | |
Public Member Functions | |
QD3D11CommandBuffer (QRhiImplementation *rhi) | |
~QD3D11CommandBuffer () | |
void | destroy () override |
Releases (or requests deferred releasing of) the underlying native graphics resources. | |
const uchar * | retainData (const QByteArray &data) |
const uchar * | retainBufferData (const QRhiBufferData &data) |
const uchar * | retainImage (const QImage &image) |
void | resetCommands () |
void | resetState () |
void | resetCachedState () |
![]() | |
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 () |
![]() | |
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 | |
QRhiBackendCommandList< Command > | commands |
PassType | recordingPass |
double | lastGpuTime = 0 |
QRhiRenderTarget * | currentTarget |
QRhiGraphicsPipeline * | currentGraphicsPipeline |
QRhiComputePipeline * | currentComputePipeline |
uint | currentPipelineGeneration |
QRhiShaderResourceBindings * | currentGraphicsSrb |
QRhiShaderResourceBindings * | currentComputeSrb |
uint | currentSrbGeneration |
ID3D11Buffer * | currentIndexBuffer |
quint32 | currentIndexOffset |
DXGI_FORMAT | currentIndexFormat |
ID3D11Buffer * | currentVertexBuffers [D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT] |
quint32 | currentVertexOffsets [D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT] |
QVarLengthArray< QByteArray, 4 > | dataRetainPool |
QVarLengthArray< QRhiBufferData, 4 > | bufferDataRetainPool |
QVarLengthArray< QImage, 4 > | imageRetainPool |
Static Public Attributes | |
static const int | MAX_DYNAMIC_OFFSET_COUNT = 8 |
static const int | MAX_VERTEX_BUFFER_BINDING_COUNT = 8 |
Additional Inherited Members | |
![]() | |
QRhiCommandBuffer (QRhiImplementation *rhi) | |
![]() | |
QRhiResource (QRhiImplementation *rhi) | |
![]() | |
QRhiImplementation * | m_rhi = nullptr |
quint64 | m_id |
QByteArray | m_objectName |
Definition at line 347 of file qrhid3d11_p.h.
Enumerator | |
---|---|
NoPass | |
RenderPass | |
ComputePass |
Definition at line 492 of file qrhid3d11_p.h.
QD3D11CommandBuffer::QD3D11CommandBuffer | ( | QRhiImplementation * | rhi | ) |
Definition at line 4681 of file qrhid3d11.cpp.
References resetState().
QD3D11CommandBuffer::~QD3D11CommandBuffer | ( | ) |
Definition at line 4687 of file qrhid3d11.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 4692 of file qrhid3d11.cpp.
Referenced by ~QD3D11CommandBuffer().
|
inline |
Definition at line 544 of file qrhid3d11_p.h.
References currentComputePipeline, currentComputeSrb, currentGraphicsPipeline, currentGraphicsSrb, currentIndexBuffer, currentIndexFormat, currentIndexOffset, currentPipelineGeneration, currentSrbGeneration, currentVertexBuffers, and currentVertexOffsets.
Referenced by QRhiD3D11::beginComputePass(), QRhiD3D11::beginPass(), QRhiD3D11::endExternal(), and resetState().
|
inline |
Definition at line 531 of file qrhid3d11_p.h.
References bufferDataRetainPool, QVarLengthArray< T, Prealloc >::clear(), dataRetainPool, and imageRetainPool.
Referenced by QRhiD3D11::beginExternal(), QRhiD3D11::finish(), and resetState().
|
inline |
Definition at line 537 of file qrhid3d11_p.h.
References currentTarget, NoPass, recordingPass, resetCachedState(), and resetCommands().
Referenced by QD3D11CommandBuffer(), QRhiD3D11::beginFrame(), and QRhiD3D11::beginOffscreenFrame().
|
inline |
Definition at line 523 of file qrhid3d11_p.h.
References QVarLengthArray< T, Prealloc >::append(), bufferDataRetainPool, QRhiBufferData::constData(), and QVarLengthArray< T, Prealloc >::last().
Referenced by QRhiD3D11::enqueueResourceUpdates().
|
inline |
Definition at line 519 of file qrhid3d11_p.h.
References QVarLengthArray< T, Prealloc >::append(), QByteArray::constData(), dataRetainPool, and QVarLengthArray< T, Prealloc >::last().
Referenced by QRhiD3D11::enqueueSubresUpload().
Definition at line 527 of file qrhid3d11_p.h.
References QVarLengthArray< T, Prealloc >::append(), QImage::constBits(), imageRetainPool, and QVarLengthArray< T, Prealloc >::last().
Referenced by QRhiD3D11::enqueueSubresUpload().
QVarLengthArray<QRhiBufferData, 4> QD3D11CommandBuffer::bufferDataRetainPool |
Definition at line 515 of file qrhid3d11_p.h.
Referenced by resetCommands(), and retainBufferData().
QRhiBackendCommandList<Command> QD3D11CommandBuffer::commands |
Definition at line 498 of file qrhid3d11_p.h.
Referenced by QRhiD3D11::beginComputePass(), QRhiD3D11::beginPass(), QRhiD3D11::debugMarkBegin(), QRhiD3D11::debugMarkEnd(), QRhiD3D11::debugMarkMsg(), QRhiD3D11::dispatch(), QRhiD3D11::draw(), QRhiD3D11::drawIndexed(), QRhiD3D11::endExternal(), QRhiD3D11::endPass(), QRhiD3D11::enqueueResourceUpdates(), QRhiD3D11::enqueueSubresUpload(), QRhiD3D11::executeCommandBuffer(), QRhiD3D11::setBlendConstants(), QRhiD3D11::setComputePipeline(), QRhiD3D11::setGraphicsPipeline(), QRhiD3D11::setScissor(), QRhiD3D11::setShaderResources(), QRhiD3D11::setStencilRef(), QRhiD3D11::setVertexInput(), and QRhiD3D11::setViewport().
QRhiComputePipeline* QD3D11CommandBuffer::currentComputePipeline |
Definition at line 503 of file qrhid3d11_p.h.
Referenced by resetCachedState(), QRhiD3D11::setComputePipeline(), QRhiD3D11::setGraphicsPipeline(), and QRhiD3D11::setShaderResources().
QRhiShaderResourceBindings* QD3D11CommandBuffer::currentComputeSrb |
Definition at line 506 of file qrhid3d11_p.h.
Referenced by resetCachedState(), and QRhiD3D11::setShaderResources().
QRhiGraphicsPipeline* QD3D11CommandBuffer::currentGraphicsPipeline |
Definition at line 502 of file qrhid3d11_p.h.
Referenced by QRhiD3D11::draw(), QRhiD3D11::drawIndexed(), resetCachedState(), QRhiD3D11::setBlendConstants(), QRhiD3D11::setComputePipeline(), QRhiD3D11::setGraphicsPipeline(), QRhiD3D11::setShaderResources(), QRhiD3D11::setStencilRef(), and QRhiD3D11::setVertexInput().
QRhiShaderResourceBindings* QD3D11CommandBuffer::currentGraphicsSrb |
Definition at line 505 of file qrhid3d11_p.h.
Referenced by resetCachedState(), and QRhiD3D11::setShaderResources().
ID3D11Buffer* QD3D11CommandBuffer::currentIndexBuffer |
Definition at line 508 of file qrhid3d11_p.h.
Referenced by resetCachedState(), and QRhiD3D11::setVertexInput().
DXGI_FORMAT QD3D11CommandBuffer::currentIndexFormat |
Definition at line 510 of file qrhid3d11_p.h.
Referenced by resetCachedState(), and QRhiD3D11::setVertexInput().
quint32 QD3D11CommandBuffer::currentIndexOffset |
Definition at line 509 of file qrhid3d11_p.h.
Referenced by resetCachedState(), and QRhiD3D11::setVertexInput().
uint QD3D11CommandBuffer::currentPipelineGeneration |
Definition at line 504 of file qrhid3d11_p.h.
Referenced by resetCachedState(), QRhiD3D11::setComputePipeline(), and QRhiD3D11::setGraphicsPipeline().
uint QD3D11CommandBuffer::currentSrbGeneration |
Definition at line 507 of file qrhid3d11_p.h.
Referenced by resetCachedState(), and QRhiD3D11::setShaderResources().
QRhiRenderTarget* QD3D11CommandBuffer::currentTarget |
Definition at line 501 of file qrhid3d11_p.h.
Referenced by QRhiD3D11::beginPass(), QRhiD3D11::endExternal(), QRhiD3D11::endPass(), resetState(), QRhiD3D11::setScissor(), and QRhiD3D11::setViewport().
ID3D11Buffer* QD3D11CommandBuffer::currentVertexBuffers[D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT] |
Definition at line 511 of file qrhid3d11_p.h.
Referenced by resetCachedState(), and QRhiD3D11::setVertexInput().
quint32 QD3D11CommandBuffer::currentVertexOffsets[D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT] |
Definition at line 512 of file qrhid3d11_p.h.
Referenced by resetCachedState(), and QRhiD3D11::setVertexInput().
QVarLengthArray<QByteArray, 4> QD3D11CommandBuffer::dataRetainPool |
Definition at line 514 of file qrhid3d11_p.h.
Referenced by resetCommands(), and retainData().
QVarLengthArray<QImage, 4> QD3D11CommandBuffer::imageRetainPool |
Definition at line 516 of file qrhid3d11_p.h.
Referenced by resetCommands(), and retainImage().
double QD3D11CommandBuffer::lastGpuTime = 0 |
Definition at line 500 of file qrhid3d11_p.h.
Referenced by QRhiD3D11::beginFrame(), QRhiD3D11::beginOffscreenFrame(), and QRhiD3D11::lastCompletedGpuTime().
|
static |
Definition at line 354 of file qrhid3d11_p.h.
Referenced by QRhiD3D11::bindShaderResources(), and QRhiD3D11::setShaderResources().
|
static |
Definition at line 355 of file qrhid3d11_p.h.
Referenced by QRhiD3D11::setVertexInput().
PassType QD3D11CommandBuffer::recordingPass |
Definition at line 499 of file qrhid3d11_p.h.
Referenced by QRhiD3D11::beginComputePass(), QRhiD3D11::beginPass(), QRhiD3D11::dispatch(), QRhiD3D11::draw(), QRhiD3D11::drawIndexed(), QRhiD3D11::endComputePass(), QRhiD3D11::endPass(), QRhiD3D11::finish(), resetState(), QRhiD3D11::setBlendConstants(), QRhiD3D11::setComputePipeline(), QRhiD3D11::setGraphicsPipeline(), QRhiD3D11::setScissor(), QRhiD3D11::setShaderResources(), QRhiD3D11::setStencilRef(), QRhiD3D11::setVertexInput(), and QRhiD3D11::setViewport().