Qt 6.x
The Qt SDK
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, QD3D11SwapChain *timestampSwapChain=nullptr)
 
DXGI_SAMPLE_DESC effectiveSampleCount (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 bool create (QRhi::Flags flags)=0
 
virtual void destroy ()=0
 
virtual QRhiGraphicsPipelinecreateGraphicsPipeline ()=0
 
virtual QRhiComputePipelinecreateComputePipeline ()=0
 
virtual QRhiShaderResourceBindingscreateShaderResourceBindings ()=0
 
virtual QRhiBuffercreateBuffer (QRhiBuffer::Type type, QRhiBuffer::UsageFlags usage, quint32 size)=0
 
virtual QRhiRenderBuffercreateRenderBuffer (QRhiRenderBuffer::Type type, const QSize &pixelSize, int sampleCount, QRhiRenderBuffer::Flags flags, QRhiTexture::Format backingFormatHint)=0
 
virtual QRhiTexturecreateTexture (QRhiTexture::Format format, const QSize &pixelSize, int depth, int arraySize, int sampleCount, QRhiTexture::Flags flags)=0
 
virtual QRhiSamplercreateSampler (QRhiSampler::Filter magFilter, QRhiSampler::Filter minFilter, QRhiSampler::Filter mipmapMode, QRhiSampler::AddressMode u, QRhiSampler::AddressMode v, QRhiSampler::AddressMode w)=0
 
virtual QRhiTextureRenderTargetcreateTextureRenderTarget (const QRhiTextureRenderTargetDescription &desc, QRhiTextureRenderTarget::Flags flags)=0
 
virtual QRhiSwapChaincreateSwapChain ()=0
 
virtual QRhi::FrameOpResult beginFrame (QRhiSwapChain *swapChain, QRhi::BeginFrameFlags flags)=0
 
virtual QRhi::FrameOpResult endFrame (QRhiSwapChain *swapChain, QRhi::EndFrameFlags flags)=0
 
virtual QRhi::FrameOpResult beginOffscreenFrame (QRhiCommandBuffer **cb, QRhi::BeginFrameFlags flags)=0
 
virtual QRhi::FrameOpResult endOffscreenFrame (QRhi::EndFrameFlags flags)=0
 
virtual QRhi::FrameOpResult finish ()=0
 
virtual void resourceUpdate (QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates)=0
 
virtual void beginPass (QRhiCommandBuffer *cb, QRhiRenderTarget *rt, const QColor &colorClearValue, const QRhiDepthStencilClearValue &depthStencilClearValue, QRhiResourceUpdateBatch *resourceUpdates, QRhiCommandBuffer::BeginPassFlags flags)=0
 
virtual void endPass (QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates)=0
 
virtual void setGraphicsPipeline (QRhiCommandBuffer *cb, QRhiGraphicsPipeline *ps)=0
 
virtual void setShaderResources (QRhiCommandBuffer *cb, QRhiShaderResourceBindings *srb, int dynamicOffsetCount, const QRhiCommandBuffer::DynamicOffset *dynamicOffsets)=0
 
virtual void setVertexInput (QRhiCommandBuffer *cb, int startBinding, int bindingCount, const QRhiCommandBuffer::VertexInput *bindings, QRhiBuffer *indexBuf, quint32 indexOffset, QRhiCommandBuffer::IndexFormat indexFormat)=0
 
virtual void setViewport (QRhiCommandBuffer *cb, const QRhiViewport &viewport)=0
 
virtual void setScissor (QRhiCommandBuffer *cb, const QRhiScissor &scissor)=0
 
virtual void setBlendConstants (QRhiCommandBuffer *cb, const QColor &c)=0
 
virtual void setStencilRef (QRhiCommandBuffer *cb, quint32 refValue)=0
 
virtual void draw (QRhiCommandBuffer *cb, quint32 vertexCount, quint32 instanceCount, quint32 firstVertex, quint32 firstInstance)=0
 
virtual void drawIndexed (QRhiCommandBuffer *cb, quint32 indexCount, quint32 instanceCount, quint32 firstIndex, qint32 vertexOffset, quint32 firstInstance)=0
 
virtual void debugMarkBegin (QRhiCommandBuffer *cb, const QByteArray &name)=0
 
virtual void debugMarkEnd (QRhiCommandBuffer *cb)=0
 
virtual void debugMarkMsg (QRhiCommandBuffer *cb, const QByteArray &msg)=0
 
virtual void beginComputePass (QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates, QRhiCommandBuffer::BeginPassFlags flags)=0
 
virtual void endComputePass (QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates)=0
 
virtual void setComputePipeline (QRhiCommandBuffer *cb, QRhiComputePipeline *ps)=0
 
virtual void dispatch (QRhiCommandBuffer *cb, int x, int y, int z)=0
 
virtual const QRhiNativeHandlesnativeHandles (QRhiCommandBuffer *cb)=0
 
virtual void beginExternal (QRhiCommandBuffer *cb)=0
 
virtual void endExternal (QRhiCommandBuffer *cb)=0
 
virtual double lastCompletedGpuTime (QRhiCommandBuffer *cb)=0
 
virtual QList< int > supportedSampleCounts () const =0
 
virtual int ubufAlignment () const =0
 
virtual bool isYUpInFramebuffer () const =0
 
virtual bool isYUpInNDC () const =0
 
virtual bool isClipDepthZeroToOne () const =0
 
virtual QMatrix4x4 clipSpaceCorrMatrix () const =0
 
virtual bool isTextureFormatSupported (QRhiTexture::Format format, QRhiTexture::Flags flags) const =0
 
virtual bool isFeatureSupported (QRhi::Feature feature) const =0
 
virtual int resourceLimit (QRhi::ResourceLimit limit) const =0
 
virtual const QRhiNativeHandlesnativeHandles ()=0
 
virtual QRhiDriverInfo driverInfo () const =0
 
virtual QRhiStats statistics ()=0
 
virtual bool makeThreadLocalNativeContextCurrent ()=0
 
virtual void releaseCachedResources ()=0
 
virtual bool isDeviceLost () const =0
 
virtual QByteArray pipelineCacheData ()=0
 
virtual void setPipelineCacheData (const QByteArray &data)=0
 
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)
 
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
 

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 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 617 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 2068 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 1258 of file qrhid3d11.cpp.

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

+ Here is the call graph for this function:

◆ beginFrame()

◆ 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

Implements QRhiImplementation.

Definition at line 1948 of file qrhid3d11.cpp.

References QColor::alphaF(), QD3D11CommandBuffer::Command::args, QColor::blueF(), QD3D11CommandBuffer::Command::Args::c, cb, QD3D11CommandBuffer::Command::Clear, QD3D11CommandBuffer::Command::Args::clear, QD3D11CommandBuffer::Command::cmd, QD3D11CommandBuffer::Command::Color, QD3D11RenderTargetData::colorAttCount, QD3D11CommandBuffer::commands, QD3D11TextureRenderTarget::create(), QD3D11RenderTargetData::currentResIdList, QD3D11CommandBuffer::currentTarget, QD3D11CommandBuffer::Command::Args::d, QD3D11CommandBuffer::Command::Depth, QRhiDepthStencilClearValue::depthClearValue(), QRhiTextureRenderTarget::description(), QD3D11RenderTargetData::dsAttCount, enqueueResourceUpdates(), QColor::greenF(), QRhiTextureRenderTarget::m_flags, QD3D11CommandBuffer::Command::Args::mask, QD3D11CommandBuffer::NoPass, QRhiTextureRenderTarget::PreserveColorContents, QRhiTextureRenderTarget::PreserveDepthStencilContents, Q_ASSERT, QRHI_RES, QD3D11CommandBuffer::recordingPass, QColor::redF(), QD3D11CommandBuffer::RenderPass, QD3D11CommandBuffer::resetCachedState(), QD3D11CommandBuffer::Command::ResetShaderResources, QRhiResource::resourceType(), QD3D11CommandBuffer::Command::Args::rt, rtData(), QD3D11CommandBuffer::Command::Args::s, QD3D11CommandBuffer::Command::SetRenderTarget, QD3D11CommandBuffer::Command::Args::setRenderTarget, QD3D11CommandBuffer::Command::Stencil, QRhiDepthStencilClearValue::stencilClearValue(), and QRhiResource::TextureRenderTarget.

+ Here is the call graph for this function:

◆ bindShaderResources()

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

Definition at line 2540 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 365 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 481 of file qrhid3d11.cpp.

◆ compileHlslShaderSource()

◆ create()

◆ createBuffer()

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

Implements QRhiImplementation.

Definition at line 456 of file qrhid3d11.cpp.

◆ createComputePipeline()

QRhiComputePipeline * QRhiD3D11::createComputePipeline ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 859 of file qrhid3d11.cpp.

◆ createGraphicsPipeline()

QRhiGraphicsPipeline * QRhiD3D11::createGraphicsPipeline ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 854 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 827 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 841 of file qrhid3d11.cpp.

◆ createShaderResourceBindings()

QRhiShaderResourceBindings * QRhiD3D11::createShaderResourceBindings ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 864 of file qrhid3d11.cpp.

◆ createSwapChain()

QRhiSwapChain * QRhiD3D11::createSwapChain ( )
overridevirtual

Implements QRhiImplementation.

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

◆ createTextureRenderTarget()

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

Implements QRhiImplementation.

Definition at line 848 of file qrhid3d11.cpp.

References desc.

◆ debugMarkBegin()

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

Implements QRhiImplementation.

Definition at line 1220 of file qrhid3d11.cpp.

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

+ Here is the call graph for this function:

◆ debugMarkEnd()

◆ debugMarkMsg()

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

◆ destroy()

void QRhiD3D11::destroy ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 373 of file qrhid3d11.cpp.

References activeAdapter, annotations, clearShaderCache(), context, dcompDevice, QD3D11Timestamps::destroy(), dev, dxgiFactory, finishActiveReadbacks(), importedDeviceAndContext, ofr, and QRhiD3D11::OffscreenFrame::timestamps.

+ Here is the call graph for this function:

◆ dispatch()

◆ draw()

◆ drawIndexed()

◆ driverInfo()

QRhiDriverInfo QRhiD3D11::driverInfo ( ) const
overridevirtual

Implements QRhiImplementation.

Definition at line 643 of file qrhid3d11.cpp.

References driverInfoStruct.

◆ effectiveSampleCount()

DXGI_SAMPLE_DESC QRhiD3D11::effectiveSampleCount ( int  sampleCount) const

Definition at line 428 of file qrhid3d11.cpp.

References contains(), desc, qBound(), qWarning, and supportedSampleCounts().

+ Here is the call graph for this function:

◆ endComputePass()

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

Implements QRhiImplementation.

Definition at line 2086 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

◆ endFrame()

◆ endOffscreenFrame()

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

◆ endPass()

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

Implements QRhiImplementation.

Definition at line 2000 of file qrhid3d11.cpp.

References QD3D11CommandBuffer::Command::args, cb, QRhiTextureRenderTargetDescription::cbeginColorAttachments(), QRhiTextureRenderTargetDescription::cendColorAttachments(), QD3D11CommandBuffer::Command::cmd, QD3D11CommandBuffer::commands, QD3D11CommandBuffer::currentTarget, QD3D11CommandBuffer::Command::Args::dst, QD3D11CommandBuffer::Command::Args::dstSubRes, QD3D11RenderBuffer::dxgiFormat, QD3D11Texture::dxgiFormat, enqueueResourceUpdates(), QD3D11CommandBuffer::Command::Args::format, it, QRhiColorAttachment::layer(), QRhiTextureRenderTarget::m_desc, QRhiTexture::m_pixelSize, QRhiRenderBuffer::m_pixelSize, QD3D11Texture::mipLevelCount, QD3D11CommandBuffer::NoPass, Q_ASSERT, QRHI_RES, qWarning, QD3D11CommandBuffer::recordingPass, QRhiColorAttachment::renderBuffer(), QD3D11CommandBuffer::RenderPass, QRhiColorAttachment::resolveLayer(), QRhiColorAttachment::resolveLevel(), QD3D11CommandBuffer::Command::ResolveSubRes, QD3D11CommandBuffer::Command::Args::resolveSubRes, QRhiColorAttachment::resolveTexture(), QRhiResource::resourceType(), QD3D11Texture::sampleDesc, QD3D11CommandBuffer::Command::Args::src, QD3D11CommandBuffer::Command::Args::srcSubRes, QD3D11RenderBuffer::tex, QRhiColorAttachment::texture(), QRhiResource::TextureRenderTarget, and QD3D11Texture::textureResource().

+ Here is the call graph for this function:

◆ enqueueResourceUpdates()

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

Definition at line 1643 of file qrhid3d11.cpp.

References QRhiResourceUpdateBatchPrivate::activeBufferOpCount, activeBufferReadbacks, QRhiResourceUpdateBatchPrivate::activeTextureOpCount, activeTextureReadbacks, QD3D11CommandBuffer::Command::args, QD3D11SwapChain::backBufferTex, QRhiD3D11::TextureReadback::bpl, QRhiResourceUpdateBatchPrivate::BufferOp::buf, QD3D11Buffer::buffer, QRhiResourceUpdateBatchPrivate::bufferOps, QRhiD3D11::TextureReadback::byteSize, QRhiD3D11::BufferReadback::byteSize, cb, QD3D11CommandBuffer::Command::cmd, QD3D11SwapChain::colorFormat, QD3D11CommandBuffer::commands, QRhiReadbackResult::completed, QRhiBufferData::constData(), contextState, QRhiResourceUpdateBatchPrivate::TextureOp::Copy, QD3D11CommandBuffer::Command::CopySubRes, QD3D11CommandBuffer::Command::Args::copySubRes, QVarLengthArray< T, Prealloc >::count(), QD3D11SwapChain::currentFrameSlot, QByteArray::data(), QRhiReadbackResult::data, QRhiResourceUpdateBatchPrivate::BufferOp::data, desc, QRhiResourceUpdateBatchPrivate::TextureOp::desc, QRhiD3D11::TextureReadback::desc, QRhiTextureCopyDescription::destinationLayer(), QRhiTextureCopyDescription::destinationLevel(), QRhiTextureCopyDescription::destinationTopLeft(), dev, QRhiResourceUpdateBatchPrivate::TextureOp::dst, QD3D11CommandBuffer::Command::Args::dst, QD3D11CommandBuffer::Command::Args::dstBox, QD3D11CommandBuffer::Command::Args::dstSubRes, QD3D11CommandBuffer::Command::Args::dstX, QD3D11CommandBuffer::Command::Args::dstY, QD3D11CommandBuffer::Command::Args::dstZ, QD3D11Texture::dxgiFormat, QRhiBuffer::Dynamic, QRhiResourceUpdateBatchPrivate::BufferOp::DynamicUpdate, QD3D11Buffer::dynBuf, enqueueSubresUpload(), QRhiTexture::flags(), QD3D11CommandBuffer::Command::Args::format, QRhiD3D11::TextureReadback::format, QRhiResourceUpdateBatchPrivate::free(), QD3D11CommandBuffer::Command::GenMip, QD3D11CommandBuffer::Command::Args::genMip, QRhiResourceUpdateBatchPrivate::TextureOp::GenMips, QRhiResourceUpdateBatchPrivate::get(), QD3D11CommandBuffer::Command::Args::hasDstBox, QD3D11Buffer::hasPendingDynamicUpdates, QD3D11CommandBuffer::Command::Args::hasSrcBox, QSize::height(), QSize::isEmpty(), QRhiReadbackDescription::layer(), QRhiReadbackDescription::level(), QRhiTexture::m_flags, QRhiTexture::m_format, QRhiTexture::m_pixelSize, QRhiBuffer::m_size, QRhiBuffer::m_type, QRhi::MAX_MIP_LEVELS, QD3D11Texture::mipLevelCount, QD3D11SwapChain::msaaTex, QRhiResourceUpdateBatchPrivate::BufferOp::offset, QRhiTextureCopyDescription::pixelSize(), QD3D11SwapChain::pixelSize, QRhiD3D11::TextureReadback::pixelSize, Q_ASSERT, qPrintable, QRHI_RES, qWarning, QRhiResourceUpdateBatchPrivate::TextureOp::rb, QRhiResourceUpdateBatchPrivate::BufferOp::Read, QRhiResourceUpdateBatchPrivate::TextureOp::Read, QRhiResourceUpdateBatchPrivate::BufferOp::readSize, QByteArray::resize(), QD3D11CommandBuffer::Command::ResolveSubRes, QD3D11CommandBuffer::Command::Args::resolveSubRes, QRhiResourceUpdateBatchPrivate::BufferOp::result, QRhiResourceUpdateBatchPrivate::TextureOp::result, QRhiD3D11::TextureReadback::result, QRhiD3D11::BufferReadback::result, QD3D11CommandBuffer::retainBufferData(), QD3D11Texture::sampleDesc, QD3D11SwapChain::sampleDesc, QRhiBufferData::size(), QRhiTextureCopyDescription::sourceLayer(), QRhiTextureCopyDescription::sourceLevel(), QRhiTextureCopyDescription::sourceTopLeft(), sp, QRhiResourceUpdateBatchPrivate::TextureOp::src, QD3D11CommandBuffer::Command::Args::src, QD3D11CommandBuffer::Command::Args::srcBox, QD3D11CommandBuffer::Command::Args::srcRowPitch, QD3D11CommandBuffer::Command::Args::srcSubRes, QD3D11CommandBuffer::Command::Args::srv, QRhiD3D11::BufferReadback::stagingBuf, QRhiD3D11::TextureReadback::stagingTex, QRhiResourceUpdateBatchPrivate::BufferOp::StaticUpload, QRhiResourceUpdateBatchPrivate::TextureOp::subresDesc, swapchainReadbackTextureFormat(), QRhiReadbackDescription::texture(), QRhiImplementation::textureFormatInfo(), QRhiResourceUpdateBatchPrivate::textureOps, QD3D11Texture::textureResource(), QRhiTexture::ThreeDimensional, QRhiResourceUpdateBatchPrivate::BufferOp::type, QRhiResourceUpdateBatchPrivate::TextureOp::type, QRhiTexture::UnknownFormat, QD3D11CommandBuffer::Command::UpdateSubRes, QD3D11CommandBuffer::Command::Args::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()

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

Definition at line 1563 of file qrhid3d11.cpp.

References aligned(), QD3D11CommandBuffer::Command::args, QD3D11CommandBuffer::Command::cmd, QD3D11CommandBuffer::commands, QRhiImplementation::compressedFormatInfo(), QRhiTextureSubresourceUploadDescription::data(), QRhiTextureSubresourceUploadDescription::dataStride(), QRhiTextureSubresourceUploadDescription::destinationTopLeft(), QD3D11CommandBuffer::Command::Args::dst, QD3D11CommandBuffer::Command::Args::dstBox, QD3D11CommandBuffer::Command::Args::dstSubRes, QD3D11CommandBuffer::Command::Args::hasDstBox, QSize::height(), QRhiTextureSubresourceUploadDescription::image(), QRhiImplementation::isCompressedFormat(), QByteArray::isEmpty(), QSize::isEmpty(), QImage::isNull(), QPoint::isNull(), QRhiTexture::m_flags, QRhiTexture::m_format, QRhiTexture::m_pixelSize, QD3D11Texture::mipLevelCount, qWarning, QD3D11CommandBuffer::retainData(), QD3D11CommandBuffer::retainImage(), QRhiTextureSubresourceUploadDescription::sourceSize(), QRhiTextureSubresourceUploadDescription::sourceTopLeft(), sp, QD3D11CommandBuffer::Command::Args::src, QD3D11CommandBuffer::Command::Args::srcRowPitch, QRhiImplementation::textureFormatInfo(), QD3D11Texture::textureResource(), QRhiTexture::ThreeDimensional, QD3D11CommandBuffer::Command::UpdateSubRes, QD3D11CommandBuffer::Command::Args::updateSubRes, QSize::width(), QPoint::x(), and QPoint::y().

Referenced by enqueueResourceUpdates().

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

◆ ensureDirectCompositionDevice()

bool QRhiD3D11::ensureDirectCompositionDevice ( )

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

References QD3D11Buffer::buffer, context, QRhiBuffer::Dynamic, QD3D11Buffer::dynBuf, QD3D11Buffer::hasPendingDynamicUpdates, QRhiBuffer::m_size, QRhiBuffer::m_type, Q_ASSERT, qPrintable, and qWarning.

Referenced by setShaderResources(), and setVertexInput().

+ Here is the caller graph for this function:

◆ executeCommandBuffer()

void QRhiD3D11::executeCommandBuffer ( QD3D11CommandBuffer cbD,
QD3D11SwapChain timestampSwapChain = nullptr 
)

Definition at line 2646 of file qrhid3d11.cpp.

References QD3D11Timestamps::active, annotations, QD3D11CommandBuffer::Command::args, QD3D11CommandBuffer::Command::BindComputePipeline, QD3D11CommandBuffer::Command::Args::bindComputePipeline, QD3D11CommandBuffer::Command::BindGraphicsPipeline, QD3D11CommandBuffer::Command::Args::bindGraphicsPipeline, QD3D11CommandBuffer::Command::BindIndexBuffer, QD3D11CommandBuffer::Command::Args::bindIndexBuffer, QD3D11CommandBuffer::Command::BindShaderResources, QD3D11CommandBuffer::Command::Args::bindShaderResources, bindShaderResources(), QD3D11CommandBuffer::Command::BindVertexBuffers, QD3D11CommandBuffer::Command::Args::bindVertexBuffers, QD3D11CommandBuffer::Command::BlendConstants, QD3D11CommandBuffer::Command::Args::blendConstants, QD3D11GraphicsPipeline::blendState, QD3D11CommandBuffer::Command::Args::buffer, QD3D11SwapChain::BUFFER_COUNT, QD3D11CommandBuffer::Command::Args::buffers, QD3D11CommandBuffer::Command::Args::c, QD3D11CommandBuffer::Command::Clear, QD3D11CommandBuffer::Command::Args::clear, QD3D11CommandBuffer::Command::cmd, QD3D11CommandBuffer::Command::Color, QD3D11RenderTargetData::colorAttCount, QD3D11CommandBuffer::commands, context, contextState, QD3D11CommandBuffer::Command::CopySubRes, QD3D11CommandBuffer::Command::Args::copySubRes, QRhiImplementation::currentFrameSlot, QD3D11SwapChain::currentFrameSlot, QD3D11CommandBuffer::Command::Args::d, QD3D11CommandBuffer::Command::Args::d0, QD3D11CommandBuffer::Command::Args::d1, QD3D11GraphicsPipeline::d3dTopology, QD3D11CommandBuffer::Command::Args::debugMark, QD3D11CommandBuffer::Command::DebugMarkBegin, QD3D11CommandBuffer::Command::DebugMarkEnd, QD3D11CommandBuffer::Command::DebugMarkMsg, QD3D11CommandBuffer::Command::Depth, QD3D11Timestamps::disjointQuery, QD3D11CommandBuffer::Command::Dispatch, QD3D11CommandBuffer::Command::Args::dispatch, QD3D11CommandBuffer::Command::Draw, QD3D11CommandBuffer::Command::Args::draw, QD3D11CommandBuffer::Command::DrawIndexed, QD3D11CommandBuffer::Command::Args::drawIndexed, QD3D11GraphicsPipeline::dsState, QD3D11CommandBuffer::Command::Args::dst, QD3D11CommandBuffer::Command::Args::dstBox, QD3D11CommandBuffer::Command::Args::dstSubRes, QD3D11CommandBuffer::Command::Args::dstX, QD3D11CommandBuffer::Command::Args::dstY, QD3D11CommandBuffer::Command::Args::dstZ, QD3D11RenderTargetData::dsv, QD3D11CommandBuffer::Command::Args::dynamicOffsetCount, QD3D11CommandBuffer::Command::Args::dynamicOffsetPairs, QD3D11CommandBuffer::Command::Args::firstIndex, QD3D11CommandBuffer::Command::Args::firstInstance, QD3D11CommandBuffer::Command::Args::firstVertex, QD3D11CommandBuffer::Command::Args::format, QString::fromLatin1(), QD3D11CommandBuffer::Command::GenMip, QD3D11CommandBuffer::Command::Args::genMip, QD3D11CommandBuffer::Command::Args::h, QD3D11CommandBuffer::Command::Args::hasDstBox, QD3D11CommandBuffer::Command::Args::hasSrcBox, i, QD3D11CommandBuffer::Command::Args::indexCount, QD3D11GraphicsPipeline::inputLayout, QD3D11CommandBuffer::Command::Args::instanceCount, it, QD3D11CommandBuffer::Command::Args::mask, QD3D11CommandBuffer::Command::Args::offset, QD3D11CommandBuffer::Command::Args::offsetOnlyChange, QD3D11CommandBuffer::Command::Args::offsets, QD3D11CommandBuffer::Command::Args::ps, QD3D11Timestamps::query, qWarning, QD3D11GraphicsPipeline::rastState, QD3D11CommandBuffer::Command::Args::ref, QD3D11CommandBuffer::Command::ResetShaderResources, resetShaderResources(), QD3D11CommandBuffer::Command::ResolveSubRes, QD3D11CommandBuffer::Command::Args::resolveSubRes, QD3D11CommandBuffer::Command::Args::rt, QD3D11SwapChain::rt, rtData(), QD3D11RenderTargetData::rtv, QD3D11CommandBuffer::Command::Args::s, QD3D11CommandBuffer::Command::Scissor, QD3D11CommandBuffer::Command::Args::scissor, QD3D11CommandBuffer::Command::SetRenderTarget, QD3D11CommandBuffer::Command::Args::setRenderTarget, SETSHADER, QD3D11GraphicsPipeline::shader, QD3D11CommandBuffer::Command::Args::slotCount, QD3D11CommandBuffer::Command::Args::srb, QD3D11CommandBuffer::Command::Args::src, QD3D11CommandBuffer::Command::Args::srcBox, QD3D11CommandBuffer::Command::Args::srcRowPitch, QD3D11CommandBuffer::Command::Args::srcSubRes, QD3D11CommandBuffer::Command::Args::srv, QD3D11CommandBuffer::Command::Args::startSlot, QD3D11CommandBuffer::Command::Stencil, QD3D11CommandBuffer::Command::StencilRef, QD3D11CommandBuffer::Command::Args::stencilRef, QD3D11CommandBuffer::Command::Args::strides, QD3D11SwapChain::timestamps, QD3D11CommandBuffer::Command::UpdateSubRes, QD3D11CommandBuffer::Command::Args::updateSubRes, QString::utf16(), QD3D11CommandBuffer::Command::Args::vertexCount, QD3D11CommandBuffer::Command::Args::vertexOffset, QD3D11CommandBuffer::Command::Viewport, QD3D11CommandBuffer::Command::Args::viewport, QD3D11CommandBuffer::Command::Args::w, QD3D11CommandBuffer::Command::Args::x, QD3D11CommandBuffer::Command::Args::y, and QD3D11CommandBuffer::Command::Args::z.

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

References QRhiD3D11::OffscreenFrame::active, QRhiD3D11::OffscreenFrame::cbWrapper, contextState, executeCommandBuffer(), finishActiveReadbacks(), QRhi::FrameOpSuccess, QRhiImplementation::inFrame, QD3D11CommandBuffer::NoPass, ofr, Q_ASSERT, QD3D11CommandBuffer::recordingPass, and QD3D11CommandBuffer::resetCommands().

+ Here is the call graph for this function:

◆ finishActiveReadbacks()

void QRhiD3D11::finishActiveReadbacks ( )

◆ isClipDepthZeroToOne()

bool QRhiD3D11::isClipDepthZeroToOne ( ) const
overridevirtual

Implements QRhiImplementation.

Definition at line 476 of file qrhid3d11.cpp.

◆ isDeviceLost()

bool QRhiD3D11::isDeviceLost ( ) const
overridevirtual

Implements QRhiImplementation.

Definition at line 667 of file qrhid3d11.cpp.

References deviceLost.

◆ isFeatureSupported()

◆ isTextureFormatSupported()

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

Implements QRhiImplementation.

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

◆ isYUpInNDC()

bool QRhiD3D11::isYUpInNDC ( ) const
overridevirtual

Implements QRhiImplementation.

Definition at line 471 of file qrhid3d11.cpp.

◆ lastCompletedGpuTime()

double QRhiD3D11::lastCompletedGpuTime ( QRhiCommandBuffer cb)
overridevirtual

Implements QRhiImplementation.

Definition at line 1278 of file qrhid3d11.cpp.

References cb, QD3D11CommandBuffer::lastGpuTime, and QRHI_RES.

◆ makeThreadLocalNativeContextCurrent()

bool QRhiD3D11::makeThreadLocalNativeContextCurrent ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 655 of file qrhid3d11.cpp.

◆ nativeHandles() [1/2]

const QRhiNativeHandles * QRhiD3D11::nativeHandles ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 638 of file qrhid3d11.cpp.

References nativeHandlesStruct.

◆ nativeHandles() [2/2]

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

Implements QRhiImplementation.

Definition at line 1252 of file qrhid3d11.cpp.

References cb, and Q_UNUSED.

◆ pipelineCacheData()

QByteArray QRhiD3D11::pipelineCacheData ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 681 of file qrhid3d11.cpp.

References QByteArray::constData(), QString::count(), 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 661 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 413 of file qrhid3d11.cpp.

References debug, and device.

◆ resetShaderResources()

void QRhiD3D11::resetShaderResources ( )

Definition at line 2565 of file qrhid3d11.cpp.

References QVarLengthArray< T, Prealloc >::constData(), 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 1941 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

◆ setScissor()

◆ setShaderResources()

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

Implements QRhiImplementation.

Definition at line 895 of file qrhid3d11.cpp.

References aligned(), QD3D11CommandBuffer::Command::args, QVarLengthArray< T, Prealloc >::at(), QD3D11CommandBuffer::Command::BindShaderResources, QD3D11CommandBuffer::Command::Args::bindShaderResources, QD3D11ShaderResourceBindings::boundResourceData, QRhiShaderResourceBinding::BufferLoad, QRhiShaderResourceBinding::BufferLoadStore, QRhiShaderResourceBinding::BufferStore, cb, QD3D11CommandBuffer::Command::cmd, QD3D11CommandBuffer::commands, QVarLengthArray< T, Prealloc >::count(), QD3D11ShaderResourceBindings::BoundSampledTextureData::count, QD3D11ComputePipeline::cs, QD3D11CommandBuffer::currentComputePipeline, QD3D11CommandBuffer::currentComputeSrb, QD3D11CommandBuffer::currentGraphicsPipeline, QD3D11CommandBuffer::currentGraphicsSrb, QD3D11CommandBuffer::currentSrbGeneration, QD3D11ShaderResourceBindings::BoundSampledTextureData::d, QD3D11GraphicsPipeline::ds, QRhiBuffer::Dynamic, QD3D11CommandBuffer::Command::Args::dynamicOffsetCount, QD3D11CommandBuffer::Command::Args::dynamicOffsetPairs, executeBufferHostWrites(), QD3D11GraphicsPipeline::fs, QD3D11Buffer::generation, QD3D11Texture::generation, QD3D11Sampler::generation, QD3D11ShaderResourceBindings::generation, QD3D11ShaderResourceBindings::BoundUniformBufferData::generation, QD3D11ShaderResourceBindings::BoundStorageImageData::generation, QD3D11ShaderResourceBindings::BoundStorageBufferData::generation, QD3D11GraphicsPipeline::gs, QD3D11ShaderResourceBindings::hasDynamicOffset, QD3D11GraphicsPipeline::hs, i, QD3D11ShaderResourceBindings::BoundUniformBufferData::id, QD3D11ShaderResourceBindings::BoundStorageImageData::id, QD3D11ShaderResourceBindings::BoundStorageBufferData::id, QRhiShaderResourceBinding::ImageLoad, QRhiShaderResourceBinding::ImageLoadStore, QRhiShaderResourceBinding::ImageStore, QRhiResource::m_id, QRhiGraphicsPipeline::m_shaderResourceBindings, QRhiComputePipeline::m_shaderResourceBindings, QRhiBuffer::m_type, QRhiBuffer::m_usage, QD3D11CommandBuffer::MAX_DYNAMIC_OFFSET_COUNT, QD3D11GraphicsPipeline::nativeResourceBindingMap, QD3D11ComputePipeline::nativeResourceBindingMap, QD3D11CommandBuffer::NoPass, QD3D11CommandBuffer::Command::Args::offsetOnlyChange, Q_ASSERT, QRHI_RES, qWarning, RBM_COMPUTE, RBM_DOMAIN, RBM_FRAGMENT, RBM_GEOMETRY, RBM_HULL, RBM_SUPPORTED_STAGES, RBM_VERTEX, QD3D11CommandBuffer::recordingPass, QRhiShaderResourceBinding::SampledTexture, QRhiShaderResourceBinding::Sampler, QD3D11ShaderResourceBindings::BoundSampledTextureData::samplerGeneration, QD3D11ShaderResourceBindings::BoundSampledTextureData::samplerId, QD3D11ShaderResourceBindings::BoundResourceData::sbuf, QRhiImplementation::shaderResourceBindingData(), QD3D11ShaderResourceBindings::BoundResourceData::simage, QD3D11ShaderResourceBindings::sortedBindings, QD3D11CommandBuffer::Command::Args::srb, QD3D11ShaderResourceBindings::BoundResourceData::stex, QD3D11Texture::tex, QD3D11ShaderResourceBindings::BoundSampledTextureData::texGeneration, QD3D11ShaderResourceBindings::BoundSampledTextureData::texId, QRhiShaderResourceBinding::Texture, QD3D11ShaderResourceBindings::BoundResourceData::ubuf, QRhiShaderResourceBinding::UniformBuffer, QRhiBuffer::UniformBuffer, updateShaderResourceBindings(), and QD3D11GraphicsPipeline::vs.

+ Here is the call graph for this function:

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

References QD3D11CommandBuffer::Command::args, QD3D11CommandBuffer::Command::BindIndexBuffer, QD3D11CommandBuffer::Command::Args::bindIndexBuffer, QRhiVertexInputLayout::bindingAt(), QD3D11CommandBuffer::Command::BindVertexBuffers, QD3D11CommandBuffer::Command::Args::bindVertexBuffers, QD3D11Buffer::buffer, QD3D11CommandBuffer::Command::Args::buffer, QD3D11CommandBuffer::Command::Args::buffers, cb, QRhiVertexInputLayout::cbeginBindings(), QRhiVertexInputLayout::cendBindings(), QD3D11CommandBuffer::Command::cmd, QD3D11CommandBuffer::commands, QD3D11CommandBuffer::currentGraphicsPipeline, QD3D11CommandBuffer::currentIndexBuffer, QD3D11CommandBuffer::currentIndexFormat, QD3D11CommandBuffer::currentIndexOffset, QD3D11CommandBuffer::currentVertexBuffers, QD3D11CommandBuffer::currentVertexOffsets, QRhiBuffer::Dynamic, executeBufferHostWrites(), QD3D11CommandBuffer::Command::Args::format, i, QRhiBuffer::IndexBuffer, QRhiCommandBuffer::IndexUInt16, QRhiBuffer::m_type, QRhiBuffer::m_usage, QRhiGraphicsPipeline::m_vertexInputLayout, QD3D11CommandBuffer::MAX_VERTEX_BUFFER_BINDING_COUNT, QD3D11CommandBuffer::Command::Args::offset, QD3D11CommandBuffer::Command::Args::offsets, Q_ASSERT, qMin(), QRHI_RES, qWarning, QD3D11CommandBuffer::recordingPass, QD3D11CommandBuffer::RenderPass, QD3D11CommandBuffer::Command::Args::slotCount, QD3D11CommandBuffer::Command::Args::startSlot, QRhiVertexInputBinding::stride(), QD3D11CommandBuffer::Command::Args::strides, and QRhiBuffer::VertexBuffer.

+ Here is the call graph for this function:

◆ setViewport()

◆ statistics()

QRhiStats QRhiD3D11::statistics ( )
overridevirtual

Implements QRhiImplementation.

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

Referenced by effectiveSampleCount().

+ Here is the caller graph for this function:

◆ ubufAlignment()

int QRhiD3D11::ubufAlignment ( ) const
overridevirtual

Implements QRhiImplementation.

Definition at line 461 of file qrhid3d11.cpp.

◆ updateShaderResourceBindings()

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

Definition at line 2145 of file qrhid3d11.cpp.

References aligned(), QVarLengthArray< T, Prealloc >::at(), QD3D11ShaderResourceBindings::boundResourceData, QD3D11Buffer::buffer, Buffer, QRhiShaderResourceBinding::BufferLoad, QRhiShaderResourceBinding::BufferLoadStore, QRhiShaderResourceBinding::BufferStore, QD3D11ShaderResourceBindings::StageUniformBufferBatches::clear(), QD3D11ShaderResourceBindings::StageSamplerBatches::clear(), QD3D11ShaderResourceBindings::StageUavBatches::clear(), QRhiShaderResourceBinding::ComputeStage, QVarLengthArray< T, Prealloc >::count(), QD3D11ShaderResourceBindings::BoundSampledTextureData::count, QD3D11ShaderResourceBindings::csSamplerBatches, QD3D11ShaderResourceBindings::csUavBatches, QD3D11ShaderResourceBindings::csUniformBufferBatches, QD3D11ShaderResourceBindings::BoundSampledTextureData::d, QD3D11ShaderResourceBindings::dsSamplerBatches, QD3D11ShaderResourceBindings::dsUniformBufferBatches, QRhiBatchedBindings< T >::feed(), QD3D11ShaderResourceBindings::StageUniformBufferBatches::finish(), QD3D11ShaderResourceBindings::StageSamplerBatches::finish(), QD3D11ShaderResourceBindings::StageUavBatches::finish(), QRhiShaderResourceBinding::FragmentStage, QD3D11ShaderResourceBindings::fsSamplerBatches, QD3D11ShaderResourceBindings::fsUniformBufferBatches, QD3D11Buffer::generation, QD3D11Texture::generation, QD3D11Sampler::generation, QD3D11ShaderResourceBindings::BoundUniformBufferData::generation, QD3D11ShaderResourceBindings::BoundStorageImageData::generation, QD3D11ShaderResourceBindings::BoundStorageBufferData::generation, QRhiShaderResourceBinding::GeometryStage, QD3D11ShaderResourceBindings::gsSamplerBatches, QD3D11ShaderResourceBindings::gsUniformBufferBatches, QD3D11ShaderResourceBindings::hsSamplerBatches, QD3D11ShaderResourceBindings::hsUniformBufferBatches, i, QD3D11ShaderResourceBindings::BoundUniformBufferData::id, QD3D11ShaderResourceBindings::BoundStorageImageData::id, QD3D11ShaderResourceBindings::BoundStorageBufferData::id, QRhiShaderResourceBinding::ImageLoad, QRhiShaderResourceBinding::ImageLoadStore, QRhiShaderResourceBinding::ImageStore, QRhiResource::m_id, QRhiBuffer::m_size, 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::BoundSampledTextureData::samplerGeneration, QD3D11ShaderResourceBindings::BoundSampledTextureData::samplerId, QD3D11ShaderResourceBindings::StageSamplerBatches::samplers, QD3D11Sampler::samplerState, QD3D11ShaderResourceBindings::BoundResourceData::sbuf, QRhiImplementation::shaderResourceBindingData(), QD3D11ShaderResourceBindings::StageSamplerBatches::shaderresources, QD3D11ShaderResourceBindings::BoundResourceData::simage, QD3D11ShaderResourceBindings::sortedBindings, QD3D11Texture::srv, QD3D11ShaderResourceBindings::BoundResourceData::stex, QRhiShaderResourceBinding::TessellationControlStage, QRhiShaderResourceBinding::TessellationEvaluationStage, QD3D11Texture::tex, QD3D11ShaderResourceBindings::BoundSampledTextureData::texGeneration, QD3D11ShaderResourceBindings::BoundSampledTextureData::texId, QRhiShaderResourceBinding::Texture, Texture, QD3D11ShaderResourceBindings::StageUavBatches::uavs, QD3D11ShaderResourceBindings::BoundResourceData::ubuf, QD3D11ShaderResourceBindings::StageUniformBufferBatches::ubufoffsets, QD3D11ShaderResourceBindings::StageUniformBufferBatches::ubuforigbindings, QD3D11ShaderResourceBindings::StageUniformBufferBatches::ubufs, QD3D11ShaderResourceBindings::StageUniformBufferBatches::ubufsizes, QRhiShaderResourceBinding::UniformBuffer, QD3D11Buffer::unorderedAccessView(), QD3D11Texture::unorderedAccessViewForLevel(), QRhiShaderResourceBinding::VertexStage, QD3D11ShaderResourceBindings::vsSamplerBatches, and QD3D11ShaderResourceBindings::vsUniformBufferBatches.

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 756 of file qrhid3d11_p.h.

Referenced by create(), and destroy().

◆ activeBufferReadbacks

QVarLengthArray<BufferReadback, 2> QRhiD3D11::activeBufferReadbacks

Definition at line 800 of file qrhid3d11_p.h.

Referenced by enqueueResourceUpdates(), and finishActiveReadbacks().

◆ activeTextureReadbacks

QVarLengthArray<TextureReadback, 2> QRhiD3D11::activeTextureReadbacks

Definition at line 794 of file qrhid3d11_p.h.

Referenced by enqueueResourceUpdates(), and finishActiveReadbacks().

◆ adapterLuid

LUID QRhiD3D11::adapterLuid = {}

Definition at line 754 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 772 of file qrhid3d11_p.h.

◆ csHighestActiveUavBinding

int QRhiD3D11::csHighestActiveUavBinding = -1

Definition at line 773 of file qrhid3d11_p.h.

◆ currentSwapChain

QD3D11SwapChain* QRhiD3D11::currentSwapChain = nullptr

Definition at line 774 of file qrhid3d11_p.h.

◆ dcompDevice

IDCompositionDevice* QRhiD3D11::dcompDevice = nullptr

Definition at line 758 of file qrhid3d11_p.h.

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

◆ debugLayer

bool QRhiD3D11::debugLayer = false

Definition at line 749 of file qrhid3d11_p.h.

Referenced by QRhiD3D11(), and create().

◆ dev

ID3D11Device* QRhiD3D11::dev = nullptr

◆ deviceLost

bool QRhiD3D11::deviceLost = false

Definition at line 760 of file qrhid3d11_p.h.

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

◆ driverInfoStruct

QRhiDriverInfo QRhiD3D11::driverInfoStruct

Definition at line 762 of file qrhid3d11_p.h.

Referenced by create(), and driverInfo().

◆ dsHighestActiveSrvBinding

int QRhiD3D11::dsHighestActiveSrvBinding = -1

Definition at line 769 of file qrhid3d11_p.h.

◆ dxgiFactory

IDXGIFactory1* QRhiD3D11::dxgiFactory = nullptr

Definition at line 757 of file qrhid3d11_p.h.

Referenced by create(), and destroy().

◆ featureLevel

D3D_FEATURE_LEVEL QRhiD3D11::featureLevel = D3D_FEATURE_LEVEL(0)

Definition at line 753 of file qrhid3d11_p.h.

Referenced by QRhiD3D11(), and create().

◆ fsHighestActiveSrvBinding

int QRhiD3D11::fsHighestActiveSrvBinding = -1

Definition at line 771 of file qrhid3d11_p.h.

◆ gsHighestActiveSrvBinding

int QRhiD3D11::gsHighestActiveSrvBinding = -1

Definition at line 770 of file qrhid3d11_p.h.

◆ hsHighestActiveSrvBinding

int QRhiD3D11::hsHighestActiveSrvBinding = -1

Definition at line 768 of file qrhid3d11_p.h.

◆ importedDeviceAndContext

bool QRhiD3D11::importedDeviceAndContext = false

Definition at line 750 of file qrhid3d11_p.h.

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

◆ m_bytecodeCache

◆ m_shaderCache

QHash<QRhiShaderStage, Shader> QRhiD3D11::m_shaderCache

Definition at line 810 of file qrhid3d11_p.h.

Referenced by clearShaderCache().

◆ nativeHandlesStruct

QRhiD3D11NativeHandles QRhiD3D11::nativeHandlesStruct

Definition at line 761 of file qrhid3d11_p.h.

Referenced by create(), and nativeHandles().

◆ ofr

◆ rhiFlags

QRhi::Flags QRhiD3D11::rhiFlags

Definition at line 748 of file qrhid3d11_p.h.

Referenced by compileHlslShaderSource(), and create().

◆ supportsAllowTearing

bool QRhiD3D11::supportsAllowTearing = false

Definition at line 759 of file qrhid3d11_p.h.

Referenced by create().

◆ vsHasIndexBufferBound

bool QRhiD3D11::vsHasIndexBufferBound = false

Definition at line 766 of file qrhid3d11_p.h.

◆ vsHighestActiveSrvBinding

int QRhiD3D11::vsHighestActiveSrvBinding = -1

Definition at line 767 of file qrhid3d11_p.h.

◆ vsHighestActiveVertexBufferBinding

int QRhiD3D11::vsHighestActiveVertexBufferBinding = -1

Definition at line 765 of file qrhid3d11_p.h.


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