Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QRhiD3D11 Class Reference

#include <qrhid3d11_p.h>

Inheritance diagram for QRhiD3D11:
Collaboration diagram for QRhiD3D11:

Classes

struct  OffscreenFrame
struct  TextureReadback
struct  BufferReadback
struct  Shader
struct  BytecodeCacheKey

Public Member Functions

 QRhiD3D11 (QRhiD3D11InitParams *params, QRhiD3D11NativeHandles *importDevice=nullptr)
bool create (QRhi::Flags flags) override
void destroy () override
QRhi::AdapterList enumerateAdaptersBeforeCreate (QRhiNativeHandles *nativeHandles) const override
QRhiGraphicsPipeline * createGraphicsPipeline () override
QRhiComputePipeline * createComputePipeline () override
QRhiShaderResourceBindings * createShaderResourceBindings () override
QRhiBuffer * createBuffer (QRhiBuffer::Type type, QRhiBuffer::UsageFlags usage, quint32 size) override
QRhiRenderBuffer * createRenderBuffer (QRhiRenderBuffer::Type type, const QSize &pixelSize, int sampleCount, QRhiRenderBuffer::Flags flags, QRhiTexture::Format backingFormatHint) override
QRhiTexture * createTexture (QRhiTexture::Format format, const QSize &pixelSize, int depth, int arraySize, int sampleCount, QRhiTexture::Flags flags) override
QRhiSampler * createSampler (QRhiSampler::Filter magFilter, QRhiSampler::Filter minFilter, QRhiSampler::Filter mipmapMode, QRhiSampler::AddressMode u, QRhiSampler::AddressMode v, QRhiSampler::AddressMode w) override
QRhiTextureRenderTarget * createTextureRenderTarget (const QRhiTextureRenderTargetDescription &desc, QRhiTextureRenderTarget::Flags flags) override
QRhiShadingRateMap * createShadingRateMap () override
QRhiSwapChain * createSwapChain () 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 setPushConstants (QRhiCommandBuffer *cb, quint32 offset, quint32 size, const void *data) override
bool ensurePushConstantBuffer ()
void setShadingRate (QRhiCommandBuffer *cb, const QSize &coarsePixelSize) 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 drawIndirect (QRhiCommandBuffer *cb, QRhiBuffer *indirectBuffer, quint32 indirectBufferOffset, quint32 drawCount, quint32 stride) override
void drawIndexedIndirect (QRhiCommandBuffer *cb, QRhiBuffer *indirectBuffer, quint32 indirectBufferOffset, quint32 drawCount, quint32 stride) 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
void dispatchIndirect (QRhiCommandBuffer *cb, QRhiBuffer *indirectBuffer, quint32 indirectBufferOffset) override
void drawIndirectCount (QRhiCommandBuffer *cb, QRhiBuffer *indirectBuffer, quint32 indirectBufferOffset, QRhiBuffer *countBuffer, quint32 countBufferOffset, quint32 maxDrawCount, quint32 stride) override
void drawIndexedIndirectCount (QRhiCommandBuffer *cb, QRhiBuffer *indirectBuffer, quint32 indirectBufferOffset, QRhiBuffer *countBuffer, quint32 countBufferOffset, quint32 maxDrawCount, quint32 stride) override
const QRhiNativeHandles * nativeHandles (QRhiCommandBuffer *cb) override
void beginExternal (QRhiCommandBuffer *cb) override
void endExternal (QRhiCommandBuffer *cb) override
double lastCompletedGpuTime (QRhiCommandBuffer *cb) override
QList< int > supportedSampleCounts () const override
QList< QSize > supportedShadingRates (int sampleCount) 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 QRhiNativeHandles * nativeHandles () override
QRhiDriverInfo driverInfo () const override
QRhiStats statistics () override
bool makeThreadLocalNativeContextCurrent () override
void setQueueSubmitParams (QRhiNativeHandles *params) 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[], uint pushConstantStages)
void executeBufferHostWrites (QD3D11Buffer *bufD)
void bindShaderResources (QD3D11CommandBuffer *cbD, const QD3D11ShaderResourceBindings::ResourceBatches &allResourceBatches, const uint *dynOfsPairs, int dynOfsPairCount, bool offsetOnlyChange, QD3D11RenderTargetUavUpdateState *rtUavState)
void resetShaderResources (QD3D11CommandBuffer *cbD, QD3D11RenderTargetUavUpdateState *rtUavState)
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 ()
virtual QRhiIndirectCommandBuffer * createIndirectCommandBuffer (QRhiIndirectCommandBuffer::Type type, quint32 maxCommandCount)
virtual void buildIndirect (QRhiCommandBuffer *cb, QRhiIndirectCommandBuffer *icb, const QRhiIndirectCommandBufferBuildInfo &info)
virtual void executeIndirect (QRhiCommandBuffer *cb, QRhiIndirectCommandBuffer *icb, quint32 firstCommand, quint32 commandCount)
virtual void commitIndirectCommandBuffer (QRhiResourceUpdateBatch *u, QRhiIndirectCommandBuffer *icb)
void prepareForCreate (QRhi *rhi, QRhi::Implementation impl, QRhi::Flags flags, QRhiAdapter *adapter)
bool isCompressedFormat (QRhiTexture::Format format) const
bool compressedFormatInfo (QRhiTexture::Format format, const QSize &size, quint32 *bpl, quint32 *byteSize, QSize *blockDim) const
bool 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)
bool sanityCheckResourceOwnership (QRhiResource *maybeResource)
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
QSize clampedSubResourceUploadSize (QSize size, QPoint dstPos, int level, QSize textureSizeAtLevelZero, bool warn=true)
QSize clampedSubResourceUploadSizeForSourceData (QSize size, quint32 bpl, quint32 bytesPerPixel, qsizetype dataSize, bool warn=true)
void runCleanup ()

Public Attributes

QRhi::Flags rhiFlags
bool debugLayer = false
UINT maxFrameLatency = 2
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 
   int   fsHighestActiveUavBinding = -1 
   QD3D11SwapChain *   currentSwapChain = nullptr 
} contextState
ID3D11Buffer * pushConstantBuffer = nullptr
struct QRhiD3D11::OffscreenFrame ofr
QVarLengthArray< TextureReadback, 2 > activeTextureReadbacks
QVarLengthArray< BufferReadback, 2 > activeBufferReadbacks
QHash< QRhiShaderStage, Shader > m_shaderCache
QHash< BytecodeCacheKey, QByteArray > m_bytecodeCache
Public Attributes inherited from QRhiImplementation
QRhi * q
bool debugMarkers = false
bool timestamps = false
int currentFrameSlot = 0
bool inFrame = false
QRhiCommandBuffer * currentOffscreenCb = nullptr
QRhiAdapter * requestedRhiAdapter = nullptr
QHash< QRhiResource *, bool > resources

Static Public Attributes

static constexpr quint32 MAX_PUSH_CONSTANTS_SIZE = 128
Static Public Attributes inherited from QRhiImplementation
static const int MAX_SHADER_CACHE_ENTRIES = 128

Additional Inherited Members

Static Public Member Functions inherited from QRhiImplementation
static QRhiImplementation * newInstance (QRhi::Implementation impl, QRhiInitParams *params, QRhiNativeHandles *importDevice)
static const QRhiShaderResourceBinding::Data * shaderResourceBindingData (const QRhiShaderResourceBinding &binding)
static QRhiShaderResourceBinding::Data * shaderResourceBindingData (QRhiShaderResourceBinding &binding)
static bool sortedBindingLessThan (const QRhiShaderResourceBinding &a, const QRhiShaderResourceBinding &b)

Detailed Description

Definition at line 757 of file qrhid3d11_p.h.

Constructor & Destructor Documentation

◆ QRhiD3D11()

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

Definition at line 158 of file qrhid3d11.cpp.

References QRhiD3D11(), debugLayer, and importedDeviceAndContext.

Referenced by QRhiD3D11().

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

Member Function Documentation

◆ beginComputePass()

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

Implements QRhiImplementation.

Definition at line 2509 of file qrhid3d11.cpp.

References QD3D11CommandBuffer::Command::cmd, QD3D11CommandBuffer::ComputePass, enqueueResourceUpdates(), QD3D11CommandBuffer::NoPass, QD3D11CommandBuffer::recordingPass, QD3D11CommandBuffer::resetCachedState(), QD3D11CommandBuffer::Command::ResetShaderResources, and QD3D11CommandBuffer::Command::SetRenderTarget.

Here is the call graph for this function:

◆ beginExternal()

void QRhiD3D11::beginExternal ( QRhiCommandBuffer * cb)
overridevirtual

Implements QRhiImplementation.

Definition at line 1584 of file qrhid3d11.cpp.

References executeCommandBuffer(), 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 1610 of file qrhid3d11.cpp.

References QD3D11CommandBuffer::Command::BeginFrame, QD3D11CommandBuffer::Command::cmd, QD3D11SwapChain::currentFrameSlot, currentSwapChain, QD3D11SwapChain::currentTimestampPairIndex, QD3D11SwapChain::ds, finishActiveReadbacks(), and QD3D11SwapChain::lastFrameLatencyWaitSlot.

Here is the call graph for this function:

◆ beginOffscreenFrame()

QRhi::FrameOpResult QRhiD3D11::beginOffscreenFrame ( QRhiCommandBuffer ** cb,
QRhi::BeginFrameFlags flags )
overridevirtual

◆ beginPass()

void QRhiD3D11::beginPass ( QRhiCommandBuffer * cb,
QRhiRenderTarget * rt,
const QColor & colorClearValue,
const QRhiDepthStencilClearValue & depthStencilClearValue,
QRhiResourceUpdateBatch * resourceUpdates,
QRhiCommandBuffer::BeginPassFlags flags )
overridevirtual

◆ bindShaderResources()

void QRhiD3D11::bindShaderResources ( QD3D11CommandBuffer * cbD,
const QD3D11ShaderResourceBindings::ResourceBatches & allResourceBatches,
const uint * dynOfsPairs,
int dynOfsPairCount,
bool offsetOnlyChange,
QD3D11RenderTargetUavUpdateState * rtUavState )

Definition at line 3051 of file qrhid3d11.cpp.

References QD3D11CommandBuffer::MAX_DYNAMIC_OFFSET_COUNT.

◆ clearShaderCache()

void QRhiD3D11::clearShaderCache ( )

Definition at line 423 of file qrhid3d11.cpp.

Referenced by QD3D11ComputePipeline::create(), destroy(), and releaseCachedResources().

Here is the caller graph for this function:

◆ clipSpaceCorrMatrix()

QMatrix4x4 QRhiD3D11::clipSpaceCorrMatrix ( ) const
overridevirtual

Implements QRhiImplementation.

Definition at line 600 of file qrhid3d11.cpp.

◆ compileHlslShaderSource()

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

Definition at line 4938 of file qrhid3d11.cpp.

◆ create()

bool QRhiD3D11::create ( QRhi::Flags flags)
overridevirtual

Implements QRhiImplementation.

Definition at line 199 of file qrhid3d11.cpp.

References deviceLost, QRhiD3D::fillDriverInfo(), importedDeviceAndContext, supportsAllowTearing, and useLegacySwapchainModel.

Here is the call graph for this function:

◆ createBuffer()

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

Implements QRhiImplementation.

Definition at line 575 of file qrhid3d11.cpp.

◆ createComputePipeline()

QRhiComputePipeline * QRhiD3D11::createComputePipeline ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 1006 of file qrhid3d11.cpp.

◆ createGraphicsPipeline()

QRhiGraphicsPipeline * QRhiD3D11::createGraphicsPipeline ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 1001 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 969 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 983 of file qrhid3d11.cpp.

◆ createShaderResourceBindings()

QRhiShaderResourceBindings * QRhiD3D11::createShaderResourceBindings ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 1011 of file qrhid3d11.cpp.

◆ createShadingRateMap()

QRhiShadingRateMap * QRhiD3D11::createShadingRateMap ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 996 of file qrhid3d11.cpp.

◆ createSwapChain()

QRhiSwapChain * QRhiD3D11::createSwapChain ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 570 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 976 of file qrhid3d11.cpp.

◆ createTextureRenderTarget()

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

Implements QRhiImplementation.

Definition at line 990 of file qrhid3d11.cpp.

◆ debugMarkBegin()

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

◆ debugMarkEnd()

void QRhiD3D11::debugMarkEnd ( QRhiCommandBuffer * cb)
overridevirtual

◆ debugMarkMsg()

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

◆ destroy()

void QRhiD3D11::destroy ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 431 of file qrhid3d11.cpp.

References clearShaderCache(), finishActiveReadbacks(), and importedDeviceAndContext.

Here is the call graph for this function:

◆ dispatch()

void QRhiD3D11::dispatch ( QRhiCommandBuffer * cb,
int x,
int y,
int z )
overridevirtual

◆ dispatchIndirect()

void QRhiD3D11::dispatchIndirect ( QRhiCommandBuffer * cb,
QRhiBuffer * indirectBuffer,
quint32 indirectBufferOffset )
overridevirtual

◆ draw()

void QRhiD3D11::draw ( QRhiCommandBuffer * cb,
quint32 vertexCount,
quint32 instanceCount,
quint32 firstVertex,
quint32 firstInstance )
overridevirtual

◆ drawIndexed()

void QRhiD3D11::drawIndexed ( QRhiCommandBuffer * cb,
quint32 indexCount,
quint32 instanceCount,
quint32 firstIndex,
qint32 vertexOffset,
quint32 firstInstance )
overridevirtual

◆ drawIndexedIndirect()

void QRhiD3D11::drawIndexedIndirect ( QRhiCommandBuffer * cb,
QRhiBuffer * indirectBuffer,
quint32 indirectBufferOffset,
quint32 drawCount,
quint32 stride )
overridevirtual

◆ drawIndexedIndirectCount()

void QRhiD3D11::drawIndexedIndirectCount ( QRhiCommandBuffer * cb,
QRhiBuffer * indirectBuffer,
quint32 indirectBufferOffset,
QRhiBuffer * countBuffer,
quint32 countBufferOffset,
quint32 maxDrawCount,
quint32 stride )
overridevirtual

Implements QRhiImplementation.

Definition at line 2602 of file qrhid3d11.cpp.

◆ drawIndirect()

void QRhiD3D11::drawIndirect ( QRhiCommandBuffer * cb,
QRhiBuffer * indirectBuffer,
quint32 indirectBufferOffset,
quint32 drawCount,
quint32 stride )
overridevirtual

◆ drawIndirectCount()

void QRhiD3D11::drawIndirectCount ( QRhiCommandBuffer * cb,
QRhiBuffer * indirectBuffer,
quint32 indirectBufferOffset,
QRhiBuffer * countBuffer,
quint32 countBufferOffset,
quint32 maxDrawCount,
quint32 stride )
overridevirtual

Implements QRhiImplementation.

Definition at line 2587 of file qrhid3d11.cpp.

◆ driverInfo()

QRhiDriverInfo QRhiD3D11::driverInfo ( ) const
overridevirtual

Implements QRhiImplementation.

Definition at line 800 of file qrhid3d11.cpp.

◆ effectiveSampleDesc()

DXGI_SAMPLE_DESC QRhiD3D11::effectiveSampleDesc ( int sampleCount) const

Definition at line 553 of file qrhid3d11.cpp.

◆ endComputePass()

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

Implements QRhiImplementation.

Definition at line 2534 of file qrhid3d11.cpp.

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

Here is the call graph for this function:

◆ endExternal()

void QRhiD3D11::endExternal ( QRhiCommandBuffer * cb)
overridevirtual

Implements QRhiImplementation.

Definition at line 1591 of file qrhid3d11.cpp.

References QD3D11CommandBuffer::Command::cmd, QD3D11CommandBuffer::resetCachedState(), rtData(), and QD3D11CommandBuffer::Command::SetRenderTarget.

Here is the call graph for this function:

◆ endFrame()

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

Implements QRhiImplementation.

Definition at line 1660 of file qrhid3d11.cpp.

References QD3D11SwapChain::BUFFER_COUNT, QD3D11CommandBuffer::Command::cmd, QD3D11SwapChain::currentFrameSlot, currentSwapChain, QD3D11SwapChain::currentTimestampPairIndex, deviceLost, QD3D11CommandBuffer::Command::EndFrame, executeCommandBuffer(), QD3D11SwapChain::frameCount, and QD3D11SwapChainTimestamps::TIMESTAMP_PAIRS.

Here is the call graph for this function:

◆ endOffscreenFrame()

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

Implements QRhiImplementation.

Definition at line 1767 of file qrhid3d11.cpp.

References QD3D11CommandBuffer::Command::cmd, QD3D11CommandBuffer::Command::EndFrame, executeCommandBuffer(), and finishActiveReadbacks().

Here is the call graph for this function:

◆ endPass()

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

Implements QRhiImplementation.

Definition at line 2439 of file qrhid3d11.cpp.

References QD3D11CommandBuffer::Command::cmd, enqueueResourceUpdates(), QD3D11CommandBuffer::NoPass, QD3D11CommandBuffer::recordingPass, QD3D11CommandBuffer::RenderPass, and QD3D11CommandBuffer::Command::ResolveSubRes.

Here is the call graph for this function:

◆ enqueueResourceUpdates()

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

Definition at line 2068 of file qrhid3d11.cpp.

References QRhiResourceUpdateBatchPrivate::activeBufferOpCount, QRhiResourceUpdateBatchPrivate::activeTextureOpCount, QD3D11CommandBuffer::Command::cmd, QRhiBufferData::constData(), QRhiResourceUpdateBatchPrivate::BufferOp::Copy, QRhiResourceUpdateBatchPrivate::TextureOp::Copy, QD3D11CommandBuffer::Command::CopySubRes, QD3D11SwapChain::currentFrameSlot, currentSwapChain, QRhiResourceUpdateBatchPrivate::BufferOp::data, QRhiResourceUpdateBatchPrivate::TextureOp::dst, QRhiResourceUpdateBatchPrivate::BufferOp::DynamicUpdate, QD3D11Buffer::dynBuf, QRhiResourceUpdateBatchPrivate::free(), QD3D11CommandBuffer::Command::GenMip, QRhiResourceUpdateBatchPrivate::TextureOp::GenMips, QRhiResourceUpdateBatchPrivate::get(), QD3D11Buffer::hasPendingDynamicUpdates, QRhiResourceUpdateBatchPrivate::BufferOp::Read, QRhiResourceUpdateBatchPrivate::TextureOp::Read, QD3D11CommandBuffer::Command::ResolveSubRes, QRhiResourceUpdateBatchPrivate::TextureOp::src, QRhiResourceUpdateBatchPrivate::BufferOp::StaticUpload, QRhiResourceUpdateBatchPrivate::BufferOp::type, QRhiResourceUpdateBatchPrivate::TextureOp::type, QD3D11CommandBuffer::Command::UpdateSubRes, and QRhiResourceUpdateBatchPrivate::TextureOp::Upload.

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()

void QRhiD3D11::enqueueSubresUpload ( QD3D11Texture * texD,
QD3D11CommandBuffer * cbD,
int layer,
int level,
const QRhiTextureSubresourceUploadDescription & subresDesc )

◆ ensureDirectCompositionDevice()

bool QRhiD3D11::ensureDirectCompositionDevice ( )

Definition at line 5640 of file qrhid3d11.cpp.

Referenced by QD3D11SwapChain::createOrResize().

Here is the caller graph for this function:

◆ ensurePushConstantBuffer()

bool QRhiD3D11::ensurePushConstantBuffer ( )

Definition at line 1450 of file qrhid3d11.cpp.

Referenced by setPushConstants().

Here is the caller graph for this function:

◆ enumerateAdaptersBeforeCreate()

QRhi::AdapterList QRhiD3D11::enumerateAdaptersBeforeCreate ( QRhiNativeHandles * nativeHandles) const
overridevirtual

Reimplemented from QRhiImplementation.

Definition at line 500 of file qrhid3d11.cpp.

◆ executeBufferHostWrites()

void QRhiD3D11::executeBufferHostWrites ( QD3D11Buffer * bufD)

Definition at line 2935 of file qrhid3d11.cpp.

References QD3D11Buffer::dynBuf, and QD3D11Buffer::hasPendingDynamicUpdates.

Referenced by QD3D11Buffer::nativeBuffer(), setShaderResources(), and setVertexInput().

Here is the caller graph for this function:

◆ executeCommandBuffer()

◆ finish()

QRhi::FrameOpResult QRhiD3D11::finish ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 1956 of file qrhid3d11.cpp.

References currentSwapChain, executeCommandBuffer(), finishActiveReadbacks(), and QD3D11CommandBuffer::NoPass.

Here is the call graph for this function:

◆ finishActiveReadbacks()

void QRhiD3D11::finishActiveReadbacks ( )

Definition at line 2318 of file qrhid3d11.cpp.

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 595 of file qrhid3d11.cpp.

◆ isDeviceLost()

bool QRhiD3D11::isDeviceLost ( ) const
overridevirtual

Implements QRhiImplementation.

Definition at line 829 of file qrhid3d11.cpp.

References deviceLost.

◆ isFeatureSupported()

bool QRhiD3D11::isFeatureSupported ( QRhi::Feature feature) const
overridevirtual

Implements QRhiImplementation.

Definition at line 622 of file qrhid3d11.cpp.

◆ isTextureFormatSupported()

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

Implements QRhiImplementation.

Definition at line 612 of file qrhid3d11.cpp.

◆ isYUpInFramebuffer()

bool QRhiD3D11::isYUpInFramebuffer ( ) const
overridevirtual

Implements QRhiImplementation.

Definition at line 585 of file qrhid3d11.cpp.

◆ isYUpInNDC()

bool QRhiD3D11::isYUpInNDC ( ) const
overridevirtual

Implements QRhiImplementation.

Definition at line 590 of file qrhid3d11.cpp.

◆ lastCompletedGpuTime()

double QRhiD3D11::lastCompletedGpuTime ( QRhiCommandBuffer * cb)
overridevirtual

Implements QRhiImplementation.

Definition at line 1604 of file qrhid3d11.cpp.

References QD3D11CommandBuffer::lastGpuTime.

◆ makeThreadLocalNativeContextCurrent()

bool QRhiD3D11::makeThreadLocalNativeContextCurrent ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 812 of file qrhid3d11.cpp.

◆ nativeHandles() [1/2]

const QRhiNativeHandles * QRhiD3D11::nativeHandles ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 795 of file qrhid3d11.cpp.

◆ nativeHandles() [2/2]

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

Implements QRhiImplementation.

Definition at line 1578 of file qrhid3d11.cpp.

◆ pipelineCacheData()

QByteArray QRhiD3D11::pipelineCacheData ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 843 of file qrhid3d11.cpp.

◆ releaseCachedResources()

void QRhiD3D11::releaseCachedResources ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 823 of file qrhid3d11.cpp.

References clearShaderCache().

Here is the call graph for this function:

◆ reportLiveObjects()

void QRhiD3D11::reportLiveObjects ( ID3D11Device * device)

Definition at line 490 of file qrhid3d11.cpp.

◆ resetShaderResources()

void QRhiD3D11::resetShaderResources ( QD3D11CommandBuffer * cbD,
QD3D11RenderTargetUavUpdateState * rtUavState )

Definition at line 3100 of file qrhid3d11.cpp.

References csHighestActiveSrvBinding, csHighestActiveUavBinding, dsHighestActiveSrvBinding, fsHighestActiveSrvBinding, fsHighestActiveUavBinding, gsHighestActiveSrvBinding, hsHighestActiveSrvBinding, vsHasIndexBufferBound, vsHighestActiveSrvBinding, and vsHighestActiveVertexBufferBinding.

Referenced by executeCommandBuffer().

Here is the caller graph for this function:

◆ resourceLimit()

int QRhiD3D11::resourceLimit ( QRhi::ResourceLimit limit) const
overridevirtual

Implements QRhiImplementation.

Definition at line 744 of file qrhid3d11.cpp.

◆ resourceUpdate()

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

Implements QRhiImplementation.

Definition at line 2380 of file qrhid3d11.cpp.

References enqueueResourceUpdates().

Here is the call graph for this function:

◆ setBlendConstants()

void QRhiD3D11::setBlendConstants ( QRhiCommandBuffer * cb,
const QColor & c )
overridevirtual

◆ setComputePipeline()

◆ setGraphicsPipeline()

◆ setPipelineCacheData()

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

Implements QRhiImplementation.

Definition at line 910 of file qrhid3d11.cpp.

◆ setPushConstants()

void QRhiD3D11::setPushConstants ( QRhiCommandBuffer * cb,
quint32 offset,
quint32 size,
const void * data )
overridevirtual

Implements QRhiImplementation.

Definition at line 1394 of file qrhid3d11.cpp.

References QD3D11CommandBuffer::Command::cmd, QD3D11CommandBuffer::ComputePass, ensurePushConstantBuffer(), QD3D11CommandBuffer::NoPass, RBM_COMPUTE, QD3D11CommandBuffer::recordingPass, and QD3D11CommandBuffer::Command::SetPushConstants.

Here is the call graph for this function:

◆ setQueueSubmitParams()

void QRhiD3D11::setQueueSubmitParams ( QRhiNativeHandles * params)
overridevirtual

Implements QRhiImplementation.

Definition at line 818 of file qrhid3d11.cpp.

◆ setScissor()

◆ setShaderResources()

◆ setShadingRate()

void QRhiD3D11::setShadingRate ( QRhiCommandBuffer * cb,
const QSize & coarsePixelSize )
overridevirtual

Implements QRhiImplementation.

Definition at line 1470 of file qrhid3d11.cpp.

◆ setStencilRef()

◆ setVertexInput()

void QRhiD3D11::setVertexInput ( QRhiCommandBuffer * cb,
int startBinding,
int bindingCount,
const QRhiCommandBuffer::VertexInput * bindings,
QRhiBuffer * indexBuf,
quint32 indexOffset,
QRhiCommandBuffer::IndexFormat indexFormat )
overridevirtual

Implements QRhiImplementation.

Definition at line 1257 of file qrhid3d11.cpp.

References QD3D11CommandBuffer::Command::BindIndexBuffer, QD3D11CommandBuffer::Command::BindVertexBuffers, QD3D11CommandBuffer::Command::cmd, executeBufferHostWrites(), QD3D11CommandBuffer::MAX_VERTEX_BUFFER_BINDING_COUNT, QD3D11CommandBuffer::recordingPass, and QD3D11CommandBuffer::RenderPass.

Here is the call graph for this function:

◆ setViewport()

◆ statistics()

QRhiStats QRhiD3D11::statistics ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 805 of file qrhid3d11.cpp.

◆ supportedSampleCounts()

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

Implements QRhiImplementation.

Definition at line 542 of file qrhid3d11.cpp.

◆ supportedShadingRates()

QList< QSize > QRhiD3D11::supportedShadingRates ( int sampleCount) const
overridevirtual

Implements QRhiImplementation.

Definition at line 547 of file qrhid3d11.cpp.

◆ ubufAlignment()

int QRhiD3D11::ubufAlignment ( ) const
overridevirtual

Implements QRhiImplementation.

Definition at line 580 of file qrhid3d11.cpp.

◆ updateShaderResourceBindings()

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

Definition at line 2646 of file qrhid3d11.cpp.

References QD3D11ShaderResourceBindings::StageSamplerBatches::finish(), QD3D11ShaderResourceBindings::StageUavBatches::finish(), QD3D11ShaderResourceBindings::StageUniformBufferBatches::finish(), RBM_COMPUTE, RBM_DOMAIN, RBM_FRAGMENT, RBM_GEOMETRY, RBM_HULL, RBM_SUPPORTED_STAGES, and RBM_VERTEX.

Here is the call graph for this function:

Member Data Documentation

◆ activeAdapter

IDXGIAdapter1* QRhiD3D11::activeAdapter = nullptr

Definition at line 926 of file qrhid3d11_p.h.

◆ activeBufferReadbacks

QVarLengthArray<BufferReadback, 2> QRhiD3D11::activeBufferReadbacks

Definition at line 975 of file qrhid3d11_p.h.

◆ activeTextureReadbacks

QVarLengthArray<TextureReadback, 2> QRhiD3D11::activeTextureReadbacks

Definition at line 969 of file qrhid3d11_p.h.

◆ adapterLuid

LUID QRhiD3D11::adapterLuid = {}

Definition at line 924 of file qrhid3d11_p.h.

◆ annotations

ID3DUserDefinedAnnotation* QRhiD3D11::annotations = nullptr

Definition at line 925 of file qrhid3d11_p.h.

◆ context

◆ [struct]

struct { ... } QRhiD3D11::contextState

◆ csHighestActiveSrvBinding

int QRhiD3D11::csHighestActiveSrvBinding = -1

Definition at line 943 of file qrhid3d11_p.h.

Referenced by resetShaderResources().

◆ csHighestActiveUavBinding

int QRhiD3D11::csHighestActiveUavBinding = -1

Definition at line 944 of file qrhid3d11_p.h.

Referenced by resetShaderResources().

◆ currentSwapChain

QD3D11SwapChain* QRhiD3D11::currentSwapChain = nullptr

Definition at line 946 of file qrhid3d11_p.h.

Referenced by beginFrame(), endFrame(), enqueueResourceUpdates(), and finish().

◆ dcompDevice

IDCompositionDevice* QRhiD3D11::dcompDevice = nullptr

Definition at line 928 of file qrhid3d11_p.h.

◆ debugLayer

bool QRhiD3D11::debugLayer = false

Definition at line 918 of file qrhid3d11_p.h.

Referenced by QRhiD3D11().

◆ dev

ID3D11Device* QRhiD3D11::dev = nullptr

Definition at line 921 of file qrhid3d11_p.h.

◆ deviceLost

bool QRhiD3D11::deviceLost = false

◆ driverInfoStruct

QRhiDriverInfo QRhiD3D11::driverInfoStruct

Definition at line 933 of file qrhid3d11_p.h.

◆ dsHighestActiveSrvBinding

int QRhiD3D11::dsHighestActiveSrvBinding = -1

Definition at line 940 of file qrhid3d11_p.h.

Referenced by resetShaderResources().

◆ dxgiFactory

IDXGIFactory1* QRhiD3D11::dxgiFactory = nullptr

Definition at line 927 of file qrhid3d11_p.h.

◆ featureLevel

D3D_FEATURE_LEVEL QRhiD3D11::featureLevel = D3D_FEATURE_LEVEL(0)

Definition at line 923 of file qrhid3d11_p.h.

◆ fsHighestActiveSrvBinding

int QRhiD3D11::fsHighestActiveSrvBinding = -1

Definition at line 942 of file qrhid3d11_p.h.

Referenced by resetShaderResources().

◆ fsHighestActiveUavBinding

int QRhiD3D11::fsHighestActiveUavBinding = -1

Definition at line 945 of file qrhid3d11_p.h.

Referenced by resetShaderResources().

◆ gsHighestActiveSrvBinding

int QRhiD3D11::gsHighestActiveSrvBinding = -1

Definition at line 941 of file qrhid3d11_p.h.

Referenced by resetShaderResources().

◆ hsHighestActiveSrvBinding

int QRhiD3D11::hsHighestActiveSrvBinding = -1

Definition at line 939 of file qrhid3d11_p.h.

Referenced by resetShaderResources().

◆ importedDeviceAndContext

bool QRhiD3D11::importedDeviceAndContext = false

Definition at line 920 of file qrhid3d11_p.h.

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

◆ m_bytecodeCache

QHash<BytecodeCacheKey, QByteArray> QRhiD3D11::m_bytecodeCache

Definition at line 1005 of file qrhid3d11_p.h.

◆ m_shaderCache

QHash<QRhiShaderStage, Shader> QRhiD3D11::m_shaderCache

Definition at line 989 of file qrhid3d11_p.h.

◆ MAX_PUSH_CONSTANTS_SIZE

quint32 QRhiD3D11::MAX_PUSH_CONSTANTS_SIZE = 128
staticconstexpr

Definition at line 949 of file qrhid3d11_p.h.

◆ maxFrameLatency

UINT QRhiD3D11::maxFrameLatency = 2

Definition at line 919 of file qrhid3d11_p.h.

◆ nativeHandlesStruct

QRhiD3D11NativeHandles QRhiD3D11::nativeHandlesStruct

Definition at line 932 of file qrhid3d11_p.h.

◆ ofr

struct QRhiD3D11::OffscreenFrame QRhiD3D11::ofr

◆ pushConstantBuffer

ID3D11Buffer* QRhiD3D11::pushConstantBuffer = nullptr

Definition at line 950 of file qrhid3d11_p.h.

◆ rhiFlags

QRhi::Flags QRhiD3D11::rhiFlags

Definition at line 917 of file qrhid3d11_p.h.

◆ supportsAllowTearing

bool QRhiD3D11::supportsAllowTearing = false

Definition at line 929 of file qrhid3d11_p.h.

Referenced by create().

◆ useLegacySwapchainModel

bool QRhiD3D11::useLegacySwapchainModel = false

Definition at line 930 of file qrhid3d11_p.h.

Referenced by create(), and QD3D11SwapChain::createOrResize().

◆ vsHasIndexBufferBound

bool QRhiD3D11::vsHasIndexBufferBound = false

Definition at line 937 of file qrhid3d11_p.h.

Referenced by executeCommandBuffer(), and resetShaderResources().

◆ vsHighestActiveSrvBinding

int QRhiD3D11::vsHighestActiveSrvBinding = -1

Definition at line 938 of file qrhid3d11_p.h.

Referenced by resetShaderResources().

◆ vsHighestActiveVertexBufferBinding

int QRhiD3D11::vsHighestActiveVertexBufferBinding = -1

Definition at line 936 of file qrhid3d11_p.h.

Referenced by executeCommandBuffer(), and resetShaderResources().


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