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>.
Loading...
Searching...
No Matches
QRhiD3D11 Class Reference

#include <qrhid3d11_p.h>

+ Inheritance diagram for QRhiD3D11:
+ Collaboration diagram for QRhiD3D11:

Classes

struct  BufferReadback
 
struct  BytecodeCacheKey
 
struct  OffscreenFrame
 
struct  Shader
 
struct  TextureReadback
 

Public Member Functions

 QRhiD3D11 (QRhiD3D11InitParams *params, QRhiD3D11NativeHandles *importDevice=nullptr)
 
bool create (QRhi::Flags flags) override
 
void destroy () override
 
QRhiGraphicsPipelinecreateGraphicsPipeline () override
 
QRhiComputePipelinecreateComputePipeline () override
 
QRhiShaderResourceBindingscreateShaderResourceBindings () override
 
QRhiBuffercreateBuffer (QRhiBuffer::Type type, QRhiBuffer::UsageFlags usage, quint32 size) override
 
QRhiRenderBuffercreateRenderBuffer (QRhiRenderBuffer::Type type, const QSize &pixelSize, int sampleCount, QRhiRenderBuffer::Flags flags, QRhiTexture::Format backingFormatHint) override
 
QRhiTexturecreateTexture (QRhiTexture::Format format, const QSize &pixelSize, int depth, int arraySize, int sampleCount, QRhiTexture::Flags flags) override
 
QRhiSamplercreateSampler (QRhiSampler::Filter magFilter, QRhiSampler::Filter minFilter, QRhiSampler::Filter mipmapMode, QRhiSampler::AddressMode u, QRhiSampler::AddressMode v, QRhiSampler::AddressMode w) override
 
QRhiTextureRenderTargetcreateTextureRenderTarget (const QRhiTextureRenderTargetDescription &desc, QRhiTextureRenderTarget::Flags flags) override
 
QRhiSwapChaincreateSwapChain () override
 
QRhi::FrameOpResult beginFrame (QRhiSwapChain *swapChain, QRhi::BeginFrameFlags flags) override
 
QRhi::FrameOpResult endFrame (QRhiSwapChain *swapChain, QRhi::EndFrameFlags flags) override
 
QRhi::FrameOpResult beginOffscreenFrame (QRhiCommandBuffer **cb, QRhi::BeginFrameFlags flags) override
 
QRhi::FrameOpResult endOffscreenFrame (QRhi::EndFrameFlags flags) override
 
QRhi::FrameOpResult finish () override
 
void resourceUpdate (QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override
 
void beginPass (QRhiCommandBuffer *cb, QRhiRenderTarget *rt, const QColor &colorClearValue, const QRhiDepthStencilClearValue &depthStencilClearValue, QRhiResourceUpdateBatch *resourceUpdates, QRhiCommandBuffer::BeginPassFlags flags) override
 
void endPass (QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override
 
void setGraphicsPipeline (QRhiCommandBuffer *cb, QRhiGraphicsPipeline *ps) override
 
void setShaderResources (QRhiCommandBuffer *cb, QRhiShaderResourceBindings *srb, int dynamicOffsetCount, const QRhiCommandBuffer::DynamicOffset *dynamicOffsets) override
 
void setVertexInput (QRhiCommandBuffer *cb, int startBinding, int bindingCount, const QRhiCommandBuffer::VertexInput *bindings, QRhiBuffer *indexBuf, quint32 indexOffset, QRhiCommandBuffer::IndexFormat indexFormat) override
 
void setViewport (QRhiCommandBuffer *cb, const QRhiViewport &viewport) override
 
void setScissor (QRhiCommandBuffer *cb, const QRhiScissor &scissor) override
 
void setBlendConstants (QRhiCommandBuffer *cb, const QColor &c) override
 
void setStencilRef (QRhiCommandBuffer *cb, quint32 refValue) override
 
void draw (QRhiCommandBuffer *cb, quint32 vertexCount, quint32 instanceCount, quint32 firstVertex, quint32 firstInstance) override
 
void drawIndexed (QRhiCommandBuffer *cb, quint32 indexCount, quint32 instanceCount, quint32 firstIndex, qint32 vertexOffset, quint32 firstInstance) override
 
void debugMarkBegin (QRhiCommandBuffer *cb, const QByteArray &name) override
 
void debugMarkEnd (QRhiCommandBuffer *cb) override
 
void debugMarkMsg (QRhiCommandBuffer *cb, const QByteArray &msg) override
 
void beginComputePass (QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates, QRhiCommandBuffer::BeginPassFlags flags) override
 
void endComputePass (QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override
 
void setComputePipeline (QRhiCommandBuffer *cb, QRhiComputePipeline *ps) override
 
void dispatch (QRhiCommandBuffer *cb, int x, int y, int z) override
 
const QRhiNativeHandlesnativeHandles (QRhiCommandBuffer *cb) override
 
void beginExternal (QRhiCommandBuffer *cb) override
 
void endExternal (QRhiCommandBuffer *cb) override
 
double lastCompletedGpuTime (QRhiCommandBuffer *cb) override
 
QList< int > supportedSampleCounts () const override
 
int ubufAlignment () const override
 
bool isYUpInFramebuffer () const override
 
bool isYUpInNDC () const override
 
bool isClipDepthZeroToOne () const override
 
QMatrix4x4 clipSpaceCorrMatrix () const override
 
bool isTextureFormatSupported (QRhiTexture::Format format, QRhiTexture::Flags flags) const override
 
bool isFeatureSupported (QRhi::Feature feature) const override
 
int resourceLimit (QRhi::ResourceLimit limit) const override
 
const QRhiNativeHandlesnativeHandles () override
 
QRhiDriverInfo driverInfo () const override
 
QRhiStats statistics () override
 
bool makeThreadLocalNativeContextCurrent () override
 
void releaseCachedResources () override
 
bool isDeviceLost () const override
 
QByteArray pipelineCacheData () override
 
void setPipelineCacheData (const QByteArray &data) override
 
void enqueueSubresUpload (QD3D11Texture *texD, QD3D11CommandBuffer *cbD, int layer, int level, const QRhiTextureSubresourceUploadDescription &subresDesc)
 
void enqueueResourceUpdates (QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates)
 
void updateShaderResourceBindings (QD3D11ShaderResourceBindings *srbD, const QShader::NativeResourceBindingMap *nativeResourceBindingMaps[])
 
void executeBufferHostWrites (QD3D11Buffer *bufD)
 
void bindShaderResources (QD3D11ShaderResourceBindings *srbD, const uint *dynOfsPairs, int dynOfsPairCount, bool offsetOnlyChange)
 
void resetShaderResources ()
 
void executeCommandBuffer (QD3D11CommandBuffer *cbD)
 
DXGI_SAMPLE_DESC effectiveSampleDesc (int sampleCount) const
 
void finishActiveReadbacks ()
 
void reportLiveObjects (ID3D11Device *device)
 
void clearShaderCache ()
 
QByteArray compileHlslShaderSource (const QShader &shader, QShader::Variant shaderVariant, uint flags, QString *error, QShaderKey *usedShaderKey)
 
bool ensureDirectCompositionDevice ()
 
- Public Member Functions inherited from QRhiImplementation
virtual ~QRhiImplementation ()
 
void prepareForCreate (QRhi *rhi, QRhi::Implementation impl, QRhi::Flags flags)
 
bool isCompressedFormat (QRhiTexture::Format format) const
 
void compressedFormatInfo (QRhiTexture::Format format, const QSize &size, quint32 *bpl, quint32 *byteSize, QSize *blockDim) const
 
void textureFormatInfo (QRhiTexture::Format format, const QSize &size, quint32 *bpl, quint32 *byteSize, quint32 *bytesPerPixel) const
 
bool isStencilSupportingFormat (QRhiTexture::Format format) const
 
void registerResource (QRhiResource *res, bool ownsNativeResources=true)
 
void unregisterResource (QRhiResource *res)
 
void addDeleteLater (QRhiResource *res)
 
void addCleanupCallback (const QRhi::CleanupCallback &callback)
 
void addCleanupCallback (const void *key, const QRhi::CleanupCallback &callback)
 
void removeCleanupCallback (const void *key)
 
bool sanityCheckGraphicsPipeline (QRhiGraphicsPipeline *ps)
 
bool sanityCheckShaderResourceBindings (QRhiShaderResourceBindings *srb)
 
void updateLayoutDesc (QRhiShaderResourceBindings *srb)
 
quint32 pipelineCacheRhiId () const
 
void pipelineCreationStart ()
 
void pipelineCreationEnd ()
 
qint64 totalPipelineCreationTime () const
 
QRhiVertexInputAttribute::Format shaderDescVariableFormatToVertexInputFormat (QShaderDescription::VariableType type) const
 
quint32 byteSizePerVertexForVertexInputFormat (QRhiVertexInputAttribute::Format format) const
 
int effectiveSampleCount (int sampleCount) const
 

Public Attributes

QRhi::Flags rhiFlags
 
bool debugLayer = false
 
bool importedDeviceAndContext = false
 
ID3D11Device * dev = nullptr
 
ID3D11DeviceContext1 * context = nullptr
 
D3D_FEATURE_LEVEL featureLevel = D3D_FEATURE_LEVEL(0)
 
LUID adapterLuid = {}
 
ID3DUserDefinedAnnotation * annotations = nullptr
 
IDXGIAdapter1 * activeAdapter = nullptr
 
IDXGIFactory1 * dxgiFactory = nullptr
 
IDCompositionDevice * dcompDevice = nullptr
 
bool supportsAllowTearing = false
 
bool useLegacySwapchainModel = false
 
bool deviceLost = false
 
QRhiD3D11NativeHandles nativeHandlesStruct
 
QRhiDriverInfo driverInfoStruct
 
struct { 
 
   int   vsHighestActiveVertexBufferBinding = -1 
 
   bool   vsHasIndexBufferBound = false 
 
   int   vsHighestActiveSrvBinding = -1 
 
   int   hsHighestActiveSrvBinding = -1 
 
   int   dsHighestActiveSrvBinding = -1 
 
   int   gsHighestActiveSrvBinding = -1 
 
   int   fsHighestActiveSrvBinding = -1 
 
   int   csHighestActiveSrvBinding = -1 
 
   int   csHighestActiveUavBinding = -1 
 
   QD3D11SwapChain *   currentSwapChain = nullptr 
 
contextState 
 
struct QRhiD3D11::OffscreenFrame ofr
 
QVarLengthArray< TextureReadback, 2 > activeTextureReadbacks
 
QVarLengthArray< BufferReadback, 2 > activeBufferReadbacks
 
QHash< QRhiShaderStage, Shaderm_shaderCache
 
QHash< BytecodeCacheKey, QByteArraym_bytecodeCache
 
- Public Attributes inherited from QRhiImplementation
QRhiq
 
bool debugMarkers = false
 
int currentFrameSlot = 0
 
bool inFrame = false
 

Additional Inherited Members

- Static Public Member Functions inherited from QRhiImplementation
static const QRhiShaderResourceBinding::DatashaderResourceBindingData (const QRhiShaderResourceBinding &binding)
 
static QRhiShaderResourceBinding::DatashaderResourceBindingData (QRhiShaderResourceBinding &binding)
 
static bool sortedBindingLessThan (const QRhiShaderResourceBinding &a, const QRhiShaderResourceBinding &b)
 
- Static Public Attributes inherited from QRhiImplementation
static const int MAX_SHADER_CACHE_ENTRIES = 128
 

Detailed Description

Definition at line 630 of file qrhid3d11_p.h.

Constructor & Destructor Documentation

◆ QRhiD3D11()

QRhiD3D11::QRhiD3D11 ( QRhiD3D11InitParams * params,
QRhiD3D11NativeHandles * importDevice = nullptr )

Member Function Documentation

◆ beginComputePass()

void QRhiD3D11::beginComputePass ( QRhiCommandBuffer * cb,
QRhiResourceUpdateBatch * resourceUpdates,
QRhiCommandBuffer::BeginPassFlags flags )
overridevirtual

Implements QRhiImplementation.

Definition at line 2160 of file qrhid3d11.cpp.

References cb, QD3D11CommandBuffer::Command::cmd, QD3D11CommandBuffer::commands, QD3D11CommandBuffer::ComputePass, enqueueResourceUpdates(), QD3D11CommandBuffer::NoPass, Q_ASSERT, QRHI_RES, QD3D11CommandBuffer::recordingPass, QD3D11CommandBuffer::resetCachedState(), and QD3D11CommandBuffer::Command::ResetShaderResources.

+ Here is the call graph for this function:

◆ beginExternal()

void QRhiD3D11::beginExternal ( QRhiCommandBuffer * cb)
overridevirtual

Implements QRhiImplementation.

Definition at line 1297 of file qrhid3d11.cpp.

References cb, executeCommandBuffer(), QRHI_RES, and QD3D11CommandBuffer::resetCommands().

+ Here is the call graph for this function:

◆ beginFrame()

QRhi::FrameOpResult QRhiD3D11::beginFrame ( QRhiSwapChain * swapChain,
QRhi::BeginFrameFlags flags )
overridevirtual

Implements QRhiImplementation.

Definition at line 1335 of file qrhid3d11.cpp.

References QD3D11CommandBuffer::Command::args, QD3D11CommandBuffer::Command::BeginFrame, QD3D11CommandBuffer::Command::cmd, context, contextState, QRhiImplementation::currentFrameSlot, finishActiveReadbacks(), QRhi::FrameOpSuccess, Q_UNUSED, QRHI_RES, and rtData().

+ Here is the call graph for this function:

◆ beginOffscreenFrame()

◆ beginPass()

◆ bindShaderResources()

void QRhiD3D11::bindShaderResources ( QD3D11ShaderResourceBindings * srbD,
const uint * dynOfsPairs,
int dynOfsPairCount,
bool offsetOnlyChange )

Definition at line 2632 of file qrhid3d11.cpp.

References QD3D11CommandBuffer::MAX_DYNAMIC_OFFSET_COUNT, SETSAMPLERBATCH, SETUAVBATCH, and SETUBUFBATCH.

Referenced by executeCommandBuffer().

+ Here is the caller graph for this function:

◆ clearShaderCache()

void QRhiD3D11::clearShaderCache ( )

Definition at line 397 of file qrhid3d11.cpp.

References m_shaderCache.

Referenced by destroy(), and releaseCachedResources().

+ Here is the caller graph for this function:

◆ clipSpaceCorrMatrix()

QMatrix4x4 QRhiD3D11::clipSpaceCorrMatrix ( ) const
overridevirtual

Implements QRhiImplementation.

Definition at line 516 of file qrhid3d11.cpp.

◆ compileHlslShaderSource()

QByteArray QRhiD3D11::compileHlslShaderSource ( const QShader & shader,
QShader::Variant shaderVariant,
uint flags,
QString * error,
QShaderKey * usedShaderKey )

◆ create()

◆ createBuffer()

QRhiBuffer * QRhiD3D11::createBuffer ( QRhiBuffer::Type type,
QRhiBuffer::UsageFlags usage,
quint32 size )
overridevirtual

Implements QRhiImplementation.

Definition at line 491 of file qrhid3d11.cpp.

◆ createComputePipeline()

QRhiComputePipeline * QRhiD3D11::createComputePipeline ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 898 of file qrhid3d11.cpp.

◆ createGraphicsPipeline()

QRhiGraphicsPipeline * QRhiD3D11::createGraphicsPipeline ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 893 of file qrhid3d11.cpp.

◆ createRenderBuffer()

QRhiRenderBuffer * QRhiD3D11::createRenderBuffer ( QRhiRenderBuffer::Type type,
const QSize & pixelSize,
int sampleCount,
QRhiRenderBuffer::Flags flags,
QRhiTexture::Format backingFormatHint )
overridevirtual

Implements QRhiImplementation.

Definition at line 866 of file qrhid3d11.cpp.

◆ createSampler()

QRhiSampler * QRhiD3D11::createSampler ( QRhiSampler::Filter magFilter,
QRhiSampler::Filter minFilter,
QRhiSampler::Filter mipmapMode,
QRhiSampler::AddressMode u,
QRhiSampler::AddressMode v,
QRhiSampler::AddressMode w )
overridevirtual

Implements QRhiImplementation.

Definition at line 880 of file qrhid3d11.cpp.

◆ createShaderResourceBindings()

QRhiShaderResourceBindings * QRhiD3D11::createShaderResourceBindings ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 903 of file qrhid3d11.cpp.

◆ createSwapChain()

QRhiSwapChain * QRhiD3D11::createSwapChain ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 486 of file qrhid3d11.cpp.

◆ createTexture()

QRhiTexture * QRhiD3D11::createTexture ( QRhiTexture::Format format,
const QSize & pixelSize,
int depth,
int arraySize,
int sampleCount,
QRhiTexture::Flags flags )
overridevirtual

Implements QRhiImplementation.

Definition at line 873 of file qrhid3d11.cpp.

◆ createTextureRenderTarget()

QRhiTextureRenderTarget * QRhiD3D11::createTextureRenderTarget ( const QRhiTextureRenderTargetDescription & desc,
QRhiTextureRenderTarget::Flags flags )
overridevirtual

Implements QRhiImplementation.

Definition at line 887 of file qrhid3d11.cpp.

◆ debugMarkBegin()

void QRhiD3D11::debugMarkBegin ( QRhiCommandBuffer * cb,
const QByteArray & name )
overridevirtual

Implements QRhiImplementation.

Definition at line 1259 of file qrhid3d11.cpp.

References annotations, QD3D11CommandBuffer::Command::args, cb, QD3D11CommandBuffer::Command::cmd, QD3D11CommandBuffer::commands, QD3D11CommandBuffer::Command::DebugMarkBegin, QRhiImplementation::debugMarkers, QRHI_RES, and qstrncpy().

+ Here is the call graph for this function:

◆ debugMarkEnd()

◆ debugMarkMsg()

void QRhiD3D11::debugMarkMsg ( QRhiCommandBuffer * cb,
const QByteArray & msg )
overridevirtual

Implements QRhiImplementation.

Definition at line 1280 of file qrhid3d11.cpp.

References annotations, QD3D11CommandBuffer::Command::args, cb, QD3D11CommandBuffer::Command::cmd, QD3D11CommandBuffer::commands, QByteArray::constData(), QRhiImplementation::debugMarkers, QD3D11CommandBuffer::Command::DebugMarkMsg, QRHI_RES, and qstrncpy().

+ Here is the call graph for this function:

◆ destroy()

void QRhiD3D11::destroy ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 405 of file qrhid3d11.cpp.

References activeAdapter, annotations, clearShaderCache(), context, dcompDevice, dev, dxgiFactory, finishActiveReadbacks(), i, importedDeviceAndContext, and ofr.

+ Here is the call graph for this function:

◆ dispatch()

◆ draw()

◆ drawIndexed()

◆ driverInfo()

QRhiDriverInfo QRhiD3D11::driverInfo ( ) const
overridevirtual

Implements QRhiImplementation.

Definition at line 682 of file qrhid3d11.cpp.

References driverInfoStruct.

◆ effectiveSampleDesc()

DXGI_SAMPLE_DESC QRhiD3D11::effectiveSampleDesc ( int sampleCount) const

Definition at line 469 of file qrhid3d11.cpp.

References QRhiImplementation::effectiveSampleCount().

+ Here is the call graph for this function:

◆ endComputePass()

void QRhiD3D11::endComputePass ( QRhiCommandBuffer * cb,
QRhiResourceUpdateBatch * resourceUpdates )
overridevirtual

Implements QRhiImplementation.

Definition at line 2178 of file qrhid3d11.cpp.

References cb, QD3D11CommandBuffer::ComputePass, enqueueResourceUpdates(), QD3D11CommandBuffer::NoPass, Q_ASSERT, QRHI_RES, and QD3D11CommandBuffer::recordingPass.

+ Here is the call graph for this function:

◆ endExternal()

void QRhiD3D11::endExternal ( QRhiCommandBuffer * cb)
overridevirtual

Implements QRhiImplementation.

Definition at line 1304 of file qrhid3d11.cpp.

References cb, QD3D11CommandBuffer::commands, QD3D11CommandBuffer::currentTarget, Q_ASSERT, QRHI_RES, QD3D11CommandBuffer::resetCachedState(), and QD3D11CommandBuffer::Command::SetRenderTarget.

+ Here is the call graph for this function:

◆ endFrame()

QRhi::FrameOpResult QRhiD3D11::endFrame ( QRhiSwapChain * swapChain,
QRhi::EndFrameFlags flags )
overridevirtual

◆ endOffscreenFrame()

QRhi::FrameOpResult QRhiD3D11::endOffscreenFrame ( QRhi::EndFrameFlags flags)
overridevirtual

Implements QRhiImplementation.

Definition at line 1476 of file qrhid3d11.cpp.

References QD3D11CommandBuffer::Command::args, QD3D11CommandBuffer::Command::cmd, context, QD3D11CommandBuffer::Command::EndFrame, executeCommandBuffer(), finishActiveReadbacks(), QRhi::FrameOpSuccess, ofr, ok, and Q_UNUSED.

+ Here is the call graph for this function:

◆ endPass()

◆ enqueueResourceUpdates()

void QRhiD3D11::enqueueResourceUpdates ( QRhiCommandBuffer * cb,
QRhiResourceUpdateBatch * resourceUpdates )

Definition at line 1746 of file qrhid3d11.cpp.

References activeBufferReadbacks, activeTextureReadbacks, QD3D11CommandBuffer::Command::args, QRhiResourceUpdateBatchPrivate::BufferOp::buf, cb, QD3D11CommandBuffer::Command::cmd, QD3D11CommandBuffer::commands, QRhiReadbackResult::completed, QRhiBufferData::constData(), contextState, QRhiResourceUpdateBatchPrivate::TextureOp::Copy, QD3D11CommandBuffer::Command::CopySubRes, QVarLengthArray< T, Prealloc >::count(), QByteArray::data(), QRhiReadbackResult::data, QRhiResourceUpdateBatchPrivate::BufferOp::data, QRhiResourceUpdateBatchPrivate::TextureOp::desc, QRhiD3D11::TextureReadback::desc, QRhiTextureCopyDescription::destinationLayer(), QRhiTextureCopyDescription::destinationLevel(), QRhiTextureCopyDescription::destinationTopLeft(), dev, QRhiResourceUpdateBatchPrivate::TextureOp::dst, QRhiBuffer::Dynamic, QRhiResourceUpdateBatchPrivate::BufferOp::DynamicUpdate, enqueueSubresUpload(), QRhiTexture::flags(), QD3D11CommandBuffer::Command::GenMip, QRhiResourceUpdateBatchPrivate::TextureOp::GenMips, QRhiResourceUpdateBatchPrivate::get(), QSize::height(), QSize::isEmpty(), QRhiReadbackDescription::layer(), QRhiReadbackDescription::level(), QRhi::MAX_MIP_LEVELS, QRhiResourceUpdateBatchPrivate::BufferOp::offset, QRhiTextureCopyDescription::pixelSize(), Q_ASSERT, qPrintable, QRHI_RES, qWarning, QRhiResourceUpdateBatchPrivate::TextureOp::rb, QRhiResourceUpdateBatchPrivate::BufferOp::Read, QRhiResourceUpdateBatchPrivate::TextureOp::Read, QRhiResourceUpdateBatchPrivate::BufferOp::readSize, QByteArray::resize(), QD3D11CommandBuffer::Command::ResolveSubRes, QRhiResourceUpdateBatchPrivate::BufferOp::result, QRhiResourceUpdateBatchPrivate::TextureOp::result, QRhiD3D11::BufferReadback::result, QD3D11CommandBuffer::retainBufferData(), QRhiBufferData::size(), QRhiTextureCopyDescription::sourceLayer(), QRhiTextureCopyDescription::sourceLevel(), QRhiTextureCopyDescription::sourceTopLeft(), sp, QRhiResourceUpdateBatchPrivate::TextureOp::src, QRhiResourceUpdateBatchPrivate::BufferOp::StaticUpload, QRhiResourceUpdateBatchPrivate::TextureOp::subresDesc, swapchainReadbackTextureFormat(), QRhiReadbackDescription::texture(), QRhiImplementation::textureFormatInfo(), QRhiTexture::ThreeDimensional, QRhiResourceUpdateBatchPrivate::BufferOp::type, QRhiResourceUpdateBatchPrivate::TextureOp::type, QRhiTexture::UnknownFormat, QD3D11CommandBuffer::Command::UpdateSubRes, QRhiResourceUpdateBatchPrivate::TextureOp::Upload, QRhiTexture::UsedWithGenerateMips, and QSize::width().

Referenced by beginComputePass(), beginPass(), endComputePass(), endPass(), and resourceUpdate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ enqueueSubresUpload()

◆ ensureDirectCompositionDevice()

bool QRhiD3D11::ensureDirectCompositionDevice ( )

Definition at line 5064 of file qrhid3d11.cpp.

References QRhiD3D::createDirectCompositionDevice(), dcompDevice, and qCDebug.

+ Here is the call graph for this function:

◆ executeBufferHostWrites()

void QRhiD3D11::executeBufferHostWrites ( QD3D11Buffer * bufD)

Definition at line 2516 of file qrhid3d11.cpp.

References context, QRhiBuffer::Dynamic, Q_ASSERT, qPrintable, and qWarning.

Referenced by setShaderResources(), and setVertexInput().

+ Here is the caller graph for this function:

◆ executeCommandBuffer()

void QRhiD3D11::executeCommandBuffer ( QD3D11CommandBuffer * cbD)

Definition at line 2738 of file qrhid3d11.cpp.

References annotations, QD3D11CommandBuffer::Command::args, QD3D11CommandBuffer::Command::BeginFrame, QD3D11CommandBuffer::Command::BindComputePipeline, QD3D11CommandBuffer::Command::BindGraphicsPipeline, QD3D11CommandBuffer::Command::BindIndexBuffer, QD3D11CommandBuffer::Command::BindShaderResources, bindShaderResources(), QD3D11CommandBuffer::Command::BindVertexBuffers, QD3D11CommandBuffer::Command::BlendConstants, QD3D11CommandBuffer::Command::Clear, QD3D11CommandBuffer::Command::cmd, QD3D11CommandBuffer::Command::Color, QD3D11CommandBuffer::commands, context, contextState, QD3D11CommandBuffer::Command::CopySubRes, QD3D11CommandBuffer::Command::DebugMarkBegin, QD3D11CommandBuffer::Command::DebugMarkEnd, QD3D11CommandBuffer::Command::DebugMarkMsg, QD3D11CommandBuffer::Command::Depth, QD3D11CommandBuffer::Command::Dispatch, QD3D11CommandBuffer::Command::Draw, QD3D11CommandBuffer::Command::DrawIndexed, QD3D11CommandBuffer::Command::EndFrame, QString::fromLatin1(), QD3D11CommandBuffer::Command::GenMip, i, it, qWarning, QD3D11CommandBuffer::Command::ResetShaderResources, resetShaderResources(), QD3D11CommandBuffer::Command::ResolveSubRes, rtData(), QD3D11CommandBuffer::Command::Scissor, QD3D11CommandBuffer::Command::SetRenderTarget, SETSHADER, QD3D11CommandBuffer::Command::Stencil, QD3D11CommandBuffer::Command::StencilRef, QD3D11CommandBuffer::Command::UpdateSubRes, and QD3D11CommandBuffer::Command::Viewport.

Referenced by beginExternal(), endFrame(), endOffscreenFrame(), and finish().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ finish()

QRhi::FrameOpResult QRhiD3D11::finish ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 1645 of file qrhid3d11.cpp.

References contextState, executeCommandBuffer(), finishActiveReadbacks(), QRhi::FrameOpSuccess, QRhiImplementation::inFrame, QD3D11CommandBuffer::NoPass, ofr, and Q_ASSERT.

+ Here is the call graph for this function:

◆ finishActiveReadbacks()

void QRhiD3D11::finishActiveReadbacks ( )

Definition at line 1969 of file qrhid3d11.cpp.

References activeBufferReadbacks, activeTextureReadbacks, context, i, qPrintable, qWarning, and void.

Referenced by beginFrame(), destroy(), endOffscreenFrame(), and finish().

+ Here is the caller graph for this function:

◆ isClipDepthZeroToOne()

bool QRhiD3D11::isClipDepthZeroToOne ( ) const
overridevirtual

Implements QRhiImplementation.

Definition at line 511 of file qrhid3d11.cpp.

◆ isDeviceLost()

bool QRhiD3D11::isDeviceLost ( ) const
overridevirtual

Implements QRhiImplementation.

Definition at line 706 of file qrhid3d11.cpp.

References deviceLost.

◆ isFeatureSupported()

◆ isTextureFormatSupported()

bool QRhiD3D11::isTextureFormatSupported ( QRhiTexture::Format format,
QRhiTexture::Flags flags ) const
overridevirtual

Implements QRhiImplementation.

Definition at line 531 of file qrhid3d11.cpp.

References QRhiTexture::ASTC_12x12, QRhiTexture::ETC2_RGB8, and Q_UNUSED.

◆ isYUpInFramebuffer()

bool QRhiD3D11::isYUpInFramebuffer ( ) const
overridevirtual

Implements QRhiImplementation.

Definition at line 501 of file qrhid3d11.cpp.

◆ isYUpInNDC()

bool QRhiD3D11::isYUpInNDC ( ) const
overridevirtual

Implements QRhiImplementation.

Definition at line 506 of file qrhid3d11.cpp.

◆ lastCompletedGpuTime()

double QRhiD3D11::lastCompletedGpuTime ( QRhiCommandBuffer * cb)
overridevirtual

Implements QRhiImplementation.

Definition at line 1316 of file qrhid3d11.cpp.

References cb, QD3D11CommandBuffer::lastGpuTime, and QRHI_RES.

◆ makeThreadLocalNativeContextCurrent()

bool QRhiD3D11::makeThreadLocalNativeContextCurrent ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 694 of file qrhid3d11.cpp.

◆ nativeHandles() [1/2]

const QRhiNativeHandles * QRhiD3D11::nativeHandles ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 677 of file qrhid3d11.cpp.

References nativeHandlesStruct.

◆ nativeHandles() [2/2]

const QRhiNativeHandles * QRhiD3D11::nativeHandles ( QRhiCommandBuffer * cb)
overridevirtual

Implements QRhiImplementation.

Definition at line 1291 of file qrhid3d11.cpp.

References cb, and Q_UNUSED.

◆ pipelineCacheData()

QByteArray QRhiD3D11::pipelineCacheData ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 720 of file qrhid3d11.cpp.

References QByteArray::constData(), header(), i, it, m_bytecodeCache, QRhiImplementation::pipelineCacheRhiId(), Q_ASSERT, QSet< T >::size(), QByteArray::size(), and Qt::Uninitialized.

+ Here is the call graph for this function:

◆ releaseCachedResources()

void QRhiD3D11::releaseCachedResources ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 700 of file qrhid3d11.cpp.

References clearShaderCache(), and m_bytecodeCache.

+ Here is the call graph for this function:

◆ reportLiveObjects()

void QRhiD3D11::reportLiveObjects ( ID3D11Device * device)

Definition at line 454 of file qrhid3d11.cpp.

References debug, and device.

◆ resetShaderResources()

void QRhiD3D11::resetShaderResources ( )

Definition at line 2657 of file qrhid3d11.cpp.

References context, contextState, i, and qMax().

Referenced by executeCommandBuffer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resourceLimit()

◆ resourceUpdate()

void QRhiD3D11::resourceUpdate ( QRhiCommandBuffer * cb,
QRhiResourceUpdateBatch * resourceUpdates )
overridevirtual

Implements QRhiImplementation.

Definition at line 2031 of file qrhid3d11.cpp.

References cb, enqueueResourceUpdates(), QD3D11CommandBuffer::NoPass, Q_ASSERT, and QRHI_RES.

+ Here is the call graph for this function:

◆ setBlendConstants()

◆ setComputePipeline()

◆ setGraphicsPipeline()

◆ setPipelineCacheData()

void QRhiD3D11::setPipelineCacheData ( const QByteArray & data)
overridevirtual

Implements QRhiImplementation.

Definition at line 787 of file qrhid3d11.cpp.

References cacheKey(), QByteArray::data(), header(), headerSize, i, m_bytecodeCache, QRhiImplementation::pipelineCacheRhiId(), qCDebug, sourceHash(), and Qt::Uninitialized.

+ Here is the call graph for this function:

◆ setScissor()

void QRhiD3D11::setScissor ( QRhiCommandBuffer * cb,
const QRhiScissor & scissor )
overridevirtual

Implements QRhiImplementation.

Definition at line 1183 of file qrhid3d11.cpp.

References QD3D11CommandBuffer::Command::args, cb, QD3D11CommandBuffer::Command::cmd, QD3D11CommandBuffer::commands, QD3D11CommandBuffer::currentTarget, QRhiRenderTarget::pixelSize(), Q_ASSERT, QRHI_RES, QD3D11CommandBuffer::recordingPass, QD3D11CommandBuffer::RenderPass, QRhiScissor::scissor(), and QD3D11CommandBuffer::Command::Scissor.

+ Here is the call graph for this function:

◆ setShaderResources()

void QRhiD3D11::setShaderResources ( QRhiCommandBuffer * cb,
QRhiShaderResourceBindings * srb,
int dynamicOffsetCount,
const QRhiCommandBuffer::DynamicOffset * dynamicOffsets )
overridevirtual

◆ setStencilRef()

◆ setVertexInput()

◆ setViewport()

void QRhiD3D11::setViewport ( QRhiCommandBuffer * cb,
const QRhiViewport & viewport )
overridevirtual

Implements QRhiImplementation.

Definition at line 1161 of file qrhid3d11.cpp.

References QD3D11CommandBuffer::Command::args, cb, QD3D11CommandBuffer::Command::cmd, QD3D11CommandBuffer::commands, QD3D11CommandBuffer::currentTarget, QRhiRenderTarget::pixelSize(), Q_ASSERT, QRHI_RES, QD3D11CommandBuffer::recordingPass, QD3D11CommandBuffer::RenderPass, QD3D11CommandBuffer::Command::Viewport, and viewport().

+ Here is the call graph for this function:

◆ statistics()

QRhiStats QRhiD3D11::statistics ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 687 of file qrhid3d11.cpp.

References QRhiImplementation::totalPipelineCreationTime().

+ Here is the call graph for this function:

◆ supportedSampleCounts()

QList< int > QRhiD3D11::supportedSampleCounts ( ) const
overridevirtual

Implements QRhiImplementation.

Definition at line 464 of file qrhid3d11.cpp.

◆ ubufAlignment()

int QRhiD3D11::ubufAlignment ( ) const
overridevirtual

Implements QRhiImplementation.

Definition at line 496 of file qrhid3d11.cpp.

◆ updateShaderResourceBindings()

void QRhiD3D11::updateShaderResourceBindings ( QD3D11ShaderResourceBindings * srbD,
const QShader::NativeResourceBindingMap * nativeResourceBindingMaps[] )

Definition at line 2237 of file qrhid3d11.cpp.

References aligned(), Buffer, QRhiShaderResourceBinding::BufferLoad, QRhiShaderResourceBinding::BufferLoadStore, QRhiShaderResourceBinding::BufferStore, QSet< T >::clear(), QRhiShaderResourceBinding::ComputeStage, QRhiShaderResourceBinding::Data::TextureAndOrSamplerData::count, QRhiBatchedBindings< T >::feed(), QD3D11ShaderResourceBindings::StageUniformBufferBatches::finish(), QD3D11ShaderResourceBindings::StageSamplerBatches::finish(), QD3D11ShaderResourceBindings::StageUavBatches::finish(), QRhiShaderResourceBinding::FragmentStage, QRhiShaderResourceBinding::GeometryStage, i, QRhiShaderResourceBinding::ImageLoad, QRhiShaderResourceBinding::ImageLoadStore, QRhiShaderResourceBinding::ImageStore, mapBinding(), Q_ASSERT, QRHI_RES, qWarning, RBM_COMPUTE, RBM_DOMAIN, RBM_FRAGMENT, RBM_GEOMETRY, RBM_HULL, RBM_SUPPORTED_STAGES, RBM_VERTEX, QRhiShaderResourceBinding::SampledTexture, QRhiShaderResourceBinding::Sampler, Sampler, QD3D11ShaderResourceBindings::StageSamplerBatches::samplers, QRhiImplementation::shaderResourceBindingData(), QD3D11ShaderResourceBindings::StageSamplerBatches::shaderresources, QRhiShaderResourceBinding::TessellationControlStage, QRhiShaderResourceBinding::TessellationEvaluationStage, QD3D11Texture::tex, QRhiShaderResourceBinding::Texture, Texture, QD3D11ShaderResourceBindings::StageUavBatches::uavs, QD3D11ShaderResourceBindings::StageUniformBufferBatches::ubufoffsets, QD3D11ShaderResourceBindings::StageUniformBufferBatches::ubuforigbindings, QD3D11ShaderResourceBindings::StageUniformBufferBatches::ubufs, QD3D11ShaderResourceBindings::StageUniformBufferBatches::ubufsizes, QRhiShaderResourceBinding::UniformBuffer, and QRhiShaderResourceBinding::VertexStage.

Referenced by setShaderResources().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ activeAdapter

IDXGIAdapter1* QRhiD3D11::activeAdapter = nullptr

Definition at line 769 of file qrhid3d11_p.h.

Referenced by create(), and destroy().

◆ activeBufferReadbacks

QVarLengthArray<BufferReadback, 2> QRhiD3D11::activeBufferReadbacks

Definition at line 814 of file qrhid3d11_p.h.

Referenced by enqueueResourceUpdates(), and finishActiveReadbacks().

◆ activeTextureReadbacks

QVarLengthArray<TextureReadback, 2> QRhiD3D11::activeTextureReadbacks

Definition at line 808 of file qrhid3d11_p.h.

Referenced by enqueueResourceUpdates(), and finishActiveReadbacks().

◆ adapterLuid

LUID QRhiD3D11::adapterLuid = {}

Definition at line 767 of file qrhid3d11_p.h.

Referenced by QRhiD3D11(), and create().

◆ annotations

ID3DUserDefinedAnnotation* QRhiD3D11::annotations = nullptr

◆ context

◆ [struct]

struct { ... } QRhiD3D11::contextState

◆ csHighestActiveSrvBinding

int QRhiD3D11::csHighestActiveSrvBinding = -1

Definition at line 786 of file qrhid3d11_p.h.

◆ csHighestActiveUavBinding

int QRhiD3D11::csHighestActiveUavBinding = -1

Definition at line 787 of file qrhid3d11_p.h.

◆ currentSwapChain

QD3D11SwapChain* QRhiD3D11::currentSwapChain = nullptr

Definition at line 788 of file qrhid3d11_p.h.

◆ dcompDevice

IDCompositionDevice* QRhiD3D11::dcompDevice = nullptr

Definition at line 771 of file qrhid3d11_p.h.

Referenced by destroy(), endFrame(), and ensureDirectCompositionDevice().

◆ debugLayer

bool QRhiD3D11::debugLayer = false

Definition at line 762 of file qrhid3d11_p.h.

Referenced by QRhiD3D11(), and create().

◆ dev

ID3D11Device* QRhiD3D11::dev = nullptr

◆ deviceLost

bool QRhiD3D11::deviceLost = false

Definition at line 774 of file qrhid3d11_p.h.

Referenced by create(), endFrame(), and isDeviceLost().

◆ driverInfoStruct

QRhiDriverInfo QRhiD3D11::driverInfoStruct

Definition at line 776 of file qrhid3d11_p.h.

Referenced by create(), and driverInfo().

◆ dsHighestActiveSrvBinding

int QRhiD3D11::dsHighestActiveSrvBinding = -1

Definition at line 783 of file qrhid3d11_p.h.

◆ dxgiFactory

IDXGIFactory1* QRhiD3D11::dxgiFactory = nullptr

Definition at line 770 of file qrhid3d11_p.h.

Referenced by create(), and destroy().

◆ featureLevel

D3D_FEATURE_LEVEL QRhiD3D11::featureLevel = D3D_FEATURE_LEVEL(0)

Definition at line 766 of file qrhid3d11_p.h.

Referenced by QRhiD3D11(), and create().

◆ fsHighestActiveSrvBinding

int QRhiD3D11::fsHighestActiveSrvBinding = -1

Definition at line 785 of file qrhid3d11_p.h.

◆ gsHighestActiveSrvBinding

int QRhiD3D11::gsHighestActiveSrvBinding = -1

Definition at line 784 of file qrhid3d11_p.h.

◆ hsHighestActiveSrvBinding

int QRhiD3D11::hsHighestActiveSrvBinding = -1

Definition at line 782 of file qrhid3d11_p.h.

◆ importedDeviceAndContext

bool QRhiD3D11::importedDeviceAndContext = false

Definition at line 763 of file qrhid3d11_p.h.

Referenced by QRhiD3D11(), create(), and destroy().

◆ m_bytecodeCache

◆ m_shaderCache

QHash<QRhiShaderStage, Shader> QRhiD3D11::m_shaderCache

Definition at line 824 of file qrhid3d11_p.h.

Referenced by clearShaderCache().

◆ nativeHandlesStruct

QRhiD3D11NativeHandles QRhiD3D11::nativeHandlesStruct

Definition at line 775 of file qrhid3d11_p.h.

Referenced by create(), and nativeHandles().

◆ ofr

◆ rhiFlags

QRhi::Flags QRhiD3D11::rhiFlags

Definition at line 761 of file qrhid3d11_p.h.

Referenced by beginOffscreenFrame(), compileHlslShaderSource(), and create().

◆ supportsAllowTearing

bool QRhiD3D11::supportsAllowTearing = false

Definition at line 772 of file qrhid3d11_p.h.

Referenced by create().

◆ useLegacySwapchainModel

bool QRhiD3D11::useLegacySwapchainModel = false

Definition at line 773 of file qrhid3d11_p.h.

Referenced by create().

◆ vsHasIndexBufferBound

bool QRhiD3D11::vsHasIndexBufferBound = false

Definition at line 780 of file qrhid3d11_p.h.

◆ vsHighestActiveSrvBinding

int QRhiD3D11::vsHighestActiveSrvBinding = -1

Definition at line 781 of file qrhid3d11_p.h.

◆ vsHighestActiveVertexBufferBinding

int QRhiD3D11::vsHighestActiveVertexBufferBinding = -1

Definition at line 779 of file qrhid3d11_p.h.


The documentation for this class was generated from the following files: