20#include <rhi/qshaderdescription.h>
33 QD3D11Buffer(QRhiImplementation *rhi, Type type, UsageFlags usage, quint32 size);
55 int sampleCount, QRhiRenderBuffer::Flags flags,
56 QRhiTexture::Format backingFormatHint);
73 QD3D11Texture(QRhiImplementation *rhi, Format format,
const QSize &pixelSize,
int depth,
74 int arraySize,
int sampleCount, Flags flags);
108 QD3D11Sampler(QRhiImplementation *rhi, Filter magFilter, Filter minFilter, Filter mipmapMode,
109 AddressMode u, AddressMode v, AddressMode w);
124 bool isCompatible(
const QRhiRenderPassDescriptor *other)
const override;
139 void setFrom(
int colorAttCount, ID3D11RenderTargetView *
const *rtv, ID3D11DepthStencilView *dsv)
142 for (
int i = 0; i < colorAttCount; ++i)
143 this->rtv[i] = rtv[i];
145 this->rtv[i] =
nullptr;
152 for (
int i = 0; i < MAX_COLOR_ATTACHMENTS; ++i)
268 present = ubufs.finish();
269 ubuforigbindings.finish();
270 ubufoffsets.finish();
275 ubuforigbindings.clear();
286 present = samplers.finish();
287 shaderresources.finish();
291 shaderresources.clear();
299 present = uavs.finish();
325 vsUniformBufferBatches.clear();
326 hsUniformBufferBatches.clear();
327 dsUniformBufferBatches.clear();
328 gsUniformBufferBatches.clear();
329 fsUniformBufferBatches.clear();
330 csUniformBufferBatches.clear();
332 vsSamplerBatches.clear();
333 hsSamplerBatches.clear();
334 dsSamplerBatches.clear();
335 gsSamplerBatches.clear();
336 fsSamplerBatches.clear();
337 csSamplerBatches.clear();
339 csUavBatches.clear();
340 fsUavBatches.clear();
363 QShader::NativeResourceBindingMap nativeResourceBindingMap;
367 QShader::NativeResourceBindingMap nativeResourceBindingMap;
371 QShader::NativeResourceBindingMap nativeResourceBindingMap;
375 QShader::NativeResourceBindingMap nativeResourceBindingMap;
468 ID3D11Query *tsQuery;
469 ID3D11Query *tsDisjointQuery;
511 } bindGraphicsPipeline;
517 } bindShaderResources;
519 ID3D11Buffer *buffer;
526 ID3D11DepthStencilState *dsState;
530 ID3D11BlendState *blendState;
541 quint32 instanceCount;
544 quint32 firstInstance;
553 ID3D11Buffer *indirectBuffer;
554 quint32 indirectBufferOffset;
557 } drawIndexedIndirect;
596 } bindComputePipeline;
603 ID3D11Buffer *indirectBuffer;
604 quint32 indirectBufferOffset;
642 dataRetainPool.append(data);
643 return reinterpret_cast<
const uchar *>(dataRetainPool.last().constData());
646 bufferDataRetainPool.append(data);
647 return reinterpret_cast<
const uchar *>(bufferDataRetainPool.last().constData());
650 imageRetainPool.append(image);
651 return imageRetainPool.last().constBits();
655 resourceBatchRetainPool.append(resourceBatches);
656 return resourceBatchRetainPool.count() - 1;
659 for (ID3D11UnorderedAccessView *uav : std::as_const(ownedUavs))
665 pushConstantPool.clear();
666 dataRetainPool.clear();
667 bufferDataRetainPool.clear();
668 imageRetainPool.clear();
669 resourceBatchRetainPool.clear();
675 currentTarget =
nullptr;
676 currentRenderTargetViews.reset();
681 currentGraphicsPipeline =
nullptr;
682 currentComputePipeline =
nullptr;
684 currentGraphicsSrb =
nullptr;
685 currentComputeSrb =
nullptr;
687 currentIndexBuffer =
nullptr;
688 currentIndexOffset = 0;
689 currentIndexFormat = DXGI_FORMAT_R16_UINT;
690 pushConstantData.clear();
691 memset(currentVertexBuffers, 0,
sizeof(currentVertexBuffers));
692 memset(currentVertexOffsets, 0,
sizeof(currentVertexOffsets));
727 bool newColorBuffer(
const QSize &size, DXGI_FORMAT format, DXGI_SAMPLE_DESC sampleDesc,
728 ID3D11Texture2D **tex, ID3D11RenderTargetView **rtv)
const;
770 QRhiD3D11(QRhiD3D11InitParams *params, QRhiD3D11NativeHandles *importDevice =
nullptr);
772 bool create(QRhi::Flags flags)
override;
780 QRhiBuffer::UsageFlags usage,
781 quint32 size)
override;
783 const QSize &pixelSize,
785 QRhiRenderBuffer::Flags flags,
786 QRhiTexture::Format backingFormatHint)
override;
788 const QSize &pixelSize,
792 QRhiTexture::Flags flags)
override;
794 QRhiSampler::Filter minFilter,
795 QRhiSampler::Filter mipmapMode,
796 QRhiSampler:: AddressMode u,
797 QRhiSampler::AddressMode v,
798 QRhiSampler::AddressMode w)
override;
801 QRhiTextureRenderTarget::Flags flags)
override;
815 QRhiRenderTarget *rt,
816 const QColor &colorClearValue,
817 const QRhiDepthStencilClearValue &depthStencilClearValue,
818 QRhiResourceUpdateBatch *resourceUpdates,
819 QRhiCommandBuffer::BeginPassFlags flags)
override;
820 void endPass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates)
override;
823 QRhiGraphicsPipeline *ps)
override;
826 QRhiShaderResourceBindings *srb,
827 int dynamicOffsetCount,
828 const QRhiCommandBuffer::DynamicOffset *dynamicOffsets)
override;
831 int startBinding,
int bindingCount,
const QRhiCommandBuffer::VertexInput *bindings,
832 QRhiBuffer *indexBuf, quint32 indexOffset,
833 QRhiCommandBuffer::IndexFormat indexFormat)
override;
835 void setViewport(QRhiCommandBuffer *cb,
const QRhiViewport &viewport)
override;
836 void setScissor(QRhiCommandBuffer *cb,
const QRhiScissor &scissor)
override;
838 void setStencilRef(QRhiCommandBuffer *cb, quint32 refValue)
override;
839 void setPushConstants(QRhiCommandBuffer *cb, quint32 offset, quint32 size,
const void *data)
override;
841 void setShadingRate(QRhiCommandBuffer *cb,
const QSize &coarsePixelSize)
override;
843 void draw(QRhiCommandBuffer *cb, quint32 vertexCount,
844 quint32 instanceCount, quint32 firstVertex, quint32 firstInstance)
override;
846 void drawIndexed(QRhiCommandBuffer *cb, quint32 indexCount,
847 quint32 instanceCount, quint32 firstIndex,
848 qint32 vertexOffset, quint32 firstInstance)
override;
850 void drawIndirect(QRhiCommandBuffer *cb, QRhiBuffer *indirectBuffer,
851 quint32 indirectBufferOffset, quint32 drawCount, quint32 stride)
override;
854 quint32 indirectBufferOffset, quint32 drawCount, quint32 stride)
override;
856 void debugMarkBegin(QRhiCommandBuffer *cb,
const QByteArray &name)
override;
858 void debugMarkMsg(QRhiCommandBuffer *cb,
const QByteArray &msg)
override;
861 QRhiResourceUpdateBatch *resourceUpdates,
862 QRhiCommandBuffer::BeginPassFlags flags)
override;
867 quint32 indirectBufferOffset)
override;
870 QRhiBuffer *indirectBuffer, quint32 indirectBufferOffset,
871 QRhiBuffer *countBuffer, quint32 countBufferOffset,
872 quint32 maxDrawCount, quint32 stride)
override;
874 QRhiBuffer *indirectBuffer, quint32 indirectBufferOffset,
875 QRhiBuffer *countBuffer, quint32 countBufferOffset,
876 quint32 maxDrawCount, quint32 stride)
override;
905 int layer,
int level,
const QRhiTextureSubresourceUploadDescription &subresDesc);
908 const QShader::NativeResourceBindingMap *nativeResourceBindingMaps[],
909 uint pushConstantStages);
914 const uint *dynOfsPairs,
int dynOfsPairCount,
915 bool offsetOnlyChange,
924 QString *error, QShaderKey *usedShaderKey);
1023 return a.sourceHash == b.sourceHash
1024 && a.target == b.target
1025 && a.entryPoint == b.entryPoint
1036 return qHashMulti(seed, k.sourceHash, k.target, k.entryPoint, k
.compileFlags);
QRhiDriverInfo info() const override
QRhiDriverInfo adapterInfo
const char * constData() const
void updateShaderResourceBindings(QD3D11ShaderResourceBindings *srbD, const QShader::NativeResourceBindingMap *nativeResourceBindingMaps[], uint pushConstantStages)
int gsHighestActiveSrvBinding
void setScissor(QRhiCommandBuffer *cb, const QRhiScissor &scissor) override
void debugMarkMsg(QRhiCommandBuffer *cb, const QByteArray &msg) override
static constexpr quint32 MAX_PUSH_CONSTANTS_SIZE
int dsHighestActiveSrvBinding
QRhiD3D11NativeHandles nativeHandlesStruct
bool isYUpInNDC() const override
void drawIndexedIndirect(QRhiCommandBuffer *cb, QRhiBuffer *indirectBuffer, quint32 indirectBufferOffset, quint32 drawCount, quint32 stride) override
QRhiSwapChain * createSwapChain() override
void enqueueResourceUpdates(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates)
bool isFeatureSupported(QRhi::Feature feature) const override
QRhi::FrameOpResult endOffscreenFrame(QRhi::EndFrameFlags flags) override
bool isDeviceLost() const override
bool vsHasIndexBufferBound
void executeBufferHostWrites(QD3D11Buffer *bufD)
QRhiStats statistics() override
QList< QSize > supportedShadingRates(int sampleCount) const override
QRhiComputePipeline * createComputePipeline() override
void debugMarkBegin(QRhiCommandBuffer *cb, const QByteArray &name) override
QRhi::FrameOpResult finish() override
void setVertexInput(QRhiCommandBuffer *cb, int startBinding, int bindingCount, const QRhiCommandBuffer::VertexInput *bindings, QRhiBuffer *indexBuf, quint32 indexOffset, QRhiCommandBuffer::IndexFormat indexFormat) override
void dispatchIndirect(QRhiCommandBuffer *cb, QRhiBuffer *indirectBuffer, quint32 indirectBufferOffset) override
IDXGIAdapter1 * activeAdapter
QRhiGraphicsPipeline * createGraphicsPipeline() override
void drawIndirectCount(QRhiCommandBuffer *cb, QRhiBuffer *indirectBuffer, quint32 indirectBufferOffset, QRhiBuffer *countBuffer, quint32 countBufferOffset, quint32 maxDrawCount, quint32 stride) override
QRhiShaderResourceBindings * createShaderResourceBindings() override
QVarLengthArray< BufferReadback, 2 > activeBufferReadbacks
QRhi::FrameOpResult beginFrame(QRhiSwapChain *swapChain, QRhi::BeginFrameFlags flags) override
ID3D11DeviceContext1 * context
QList< int > supportedSampleCounts() const override
QRhiTextureRenderTarget * createTextureRenderTarget(const QRhiTextureRenderTargetDescription &desc, QRhiTextureRenderTarget::Flags flags) override
QByteArray compileHlslShaderSource(const QShader &shader, QShader::Variant shaderVariant, uint flags, QString *error, QShaderKey *usedShaderKey)
void setBlendConstants(QRhiCommandBuffer *cb, const QColor &c) override
int csHighestActiveSrvBinding
bool isClipDepthZeroToOne() const override
IDCompositionDevice * dcompDevice
QRhiDriverInfo driverInfoStruct
QHash< QRhiShaderStage, Shader > m_shaderCache
void resetShaderResources(QD3D11CommandBuffer *cbD, QD3D11RenderTargetUavUpdateState *rtUavState)
bool ensureDirectCompositionDevice()
const QRhiNativeHandles * nativeHandles(QRhiCommandBuffer *cb) override
void beginComputePass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates, QRhiCommandBuffer::BeginPassFlags flags) override
void draw(QRhiCommandBuffer *cb, quint32 vertexCount, quint32 instanceCount, quint32 firstVertex, quint32 firstInstance) override
void enqueueSubresUpload(QD3D11Texture *texD, QD3D11CommandBuffer *cbD, int layer, int level, const QRhiTextureSubresourceUploadDescription &subresDesc)
QD3D11SwapChain * currentSwapChain
void reportLiveObjects(ID3D11Device *device)
void resourceUpdate(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override
QMatrix4x4 clipSpaceCorrMatrix() const override
void setPushConstants(QRhiCommandBuffer *cb, quint32 offset, quint32 size, const void *data) override
bool isYUpInFramebuffer() const override
int resourceLimit(QRhi::ResourceLimit limit) const override
void beginExternal(QRhiCommandBuffer *cb) override
QRhiTexture * createTexture(QRhiTexture::Format format, const QSize &pixelSize, int depth, int arraySize, int sampleCount, QRhiTexture::Flags flags) override
ID3D11Buffer * pushConstantBuffer
void setPipelineCacheData(const QByteArray &data) override
void executeCommandBuffer(QD3D11CommandBuffer *cbD)
void debugMarkEnd(QRhiCommandBuffer *cb) override
void releaseCachedResources() override
double lastCompletedGpuTime(QRhiCommandBuffer *cb) override
ID3DUserDefinedAnnotation * annotations
bool importedDeviceAndContext
QRhi::FrameOpResult beginOffscreenFrame(QRhiCommandBuffer **cb, QRhi::BeginFrameFlags flags) override
QRhiBuffer * createBuffer(QRhiBuffer::Type type, QRhiBuffer::UsageFlags usage, quint32 size) override
bool supportsAllowTearing
void dispatch(QRhiCommandBuffer *cb, int x, int y, int z) override
void endExternal(QRhiCommandBuffer *cb) override
void setViewport(QRhiCommandBuffer *cb, const QRhiViewport &viewport) override
QVarLengthArray< TextureReadback, 2 > activeTextureReadbacks
QRhi::AdapterList enumerateAdaptersBeforeCreate(QRhiNativeHandles *nativeHandles) const override
bool ensurePushConstantBuffer()
void drawIndexedIndirectCount(QRhiCommandBuffer *cb, QRhiBuffer *indirectBuffer, quint32 indirectBufferOffset, QRhiBuffer *countBuffer, quint32 countBufferOffset, quint32 maxDrawCount, quint32 stride) override
void setComputePipeline(QRhiCommandBuffer *cb, QRhiComputePipeline *ps) override
QRhi::FrameOpResult endFrame(QRhiSwapChain *swapChain, QRhi::EndFrameFlags flags) override
QRhiShadingRateMap * createShadingRateMap() override
bool isTextureFormatSupported(QRhiTexture::Format format, QRhiTexture::Flags flags) const override
void setShaderResources(QRhiCommandBuffer *cb, QRhiShaderResourceBindings *srb, int dynamicOffsetCount, const QRhiCommandBuffer::DynamicOffset *dynamicOffsets) override
D3D_FEATURE_LEVEL featureLevel
bool useLegacySwapchainModel
void endComputePass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override
bool makeThreadLocalNativeContextCurrent() override
bool create(QRhi::Flags flags) override
int csHighestActiveUavBinding
void finishActiveReadbacks()
IDXGIFactory1 * dxgiFactory
int fsHighestActiveSrvBinding
void setShadingRate(QRhiCommandBuffer *cb, const QSize &coarsePixelSize) override
QByteArray pipelineCacheData() override
const QRhiNativeHandles * nativeHandles() override
QRhiDriverInfo driverInfo() const override
void endPass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override
int ubufAlignment() const override
void beginPass(QRhiCommandBuffer *cb, QRhiRenderTarget *rt, const QColor &colorClearValue, const QRhiDepthStencilClearValue &depthStencilClearValue, QRhiResourceUpdateBatch *resourceUpdates, QRhiCommandBuffer::BeginPassFlags flags) override
void bindShaderResources(QD3D11CommandBuffer *cbD, const QD3D11ShaderResourceBindings::ResourceBatches &allResourceBatches, const uint *dynOfsPairs, int dynOfsPairCount, bool offsetOnlyChange, QD3D11RenderTargetUavUpdateState *rtUavState)
void drawIndexed(QRhiCommandBuffer *cb, quint32 indexCount, quint32 instanceCount, quint32 firstIndex, qint32 vertexOffset, quint32 firstInstance) override
void setQueueSubmitParams(QRhiNativeHandles *params) override
QRhiSampler * createSampler(QRhiSampler::Filter magFilter, QRhiSampler::Filter minFilter, QRhiSampler::Filter mipmapMode, QRhiSampler::AddressMode u, QRhiSampler::AddressMode v, QRhiSampler::AddressMode w) override
int vsHighestActiveSrvBinding
QRhiRenderBuffer * createRenderBuffer(QRhiRenderBuffer::Type type, const QSize &pixelSize, int sampleCount, QRhiRenderBuffer::Flags flags, QRhiTexture::Format backingFormatHint) override
int hsHighestActiveSrvBinding
void setGraphicsPipeline(QRhiCommandBuffer *cb, QRhiGraphicsPipeline *ps) override
QRhiD3D11(QRhiD3D11InitParams *params, QRhiD3D11NativeHandles *importDevice=nullptr)
DXGI_SAMPLE_DESC effectiveSampleDesc(int sampleCount) const
int fsHighestActiveUavBinding
void setStencilRef(QRhiCommandBuffer *cb, quint32 refValue) override
int vsHighestActiveVertexBufferBinding
void drawIndirect(QRhiCommandBuffer *cb, QRhiBuffer *indirectBuffer, quint32 indirectBufferOffset, quint32 drawCount, quint32 stride) override
QRhiBinaryCache< BytecodeCacheKey, QByteArray > m_bytecodeCache
static QRhiResourceUpdateBatchPrivate * get(QRhiResourceUpdateBatch *b)
void fillDriverInfo(QRhiDriverInfo *info, const DXGI_ADAPTER_DESC1 &desc)
Combined button and popup list for selecting options.
static const DXGI_FORMAT DEFAULT_SRGB_FORMAT
static void applyDynamicOffsets(UINT *offsets, int batchIndex, const QRhiBatchedBindings< UINT > *originalBindings, const QRhiBatchedBindings< UINT > *staticOffsets, const uint *dynOfsPairs, int dynOfsPairCount)
static D3D11_TEXTURE_ADDRESS_MODE toD3DAddressMode(QRhiSampler::AddressMode m)
#define SETUAVBATCH(stagePrefixL, stagePrefixU)
static QByteArray sourceHash(const QByteArray &source)
#define SETSAMPLERBATCH(stagePrefixL, stagePrefixU)
static const int RBM_HULL
static uint toD3DBufferUsage(QRhiBuffer::UsageFlags usage)
static const int RBM_FRAGMENT
#define SETUBUFBATCH(stagePrefixL, stagePrefixU)
Int aligned(Int v, Int byteAlign)
\variable QRhiVulkanQueueSubmitParams::waitSemaphoreCount
static DXGI_FORMAT toD3DDepthTextureDSVFormat(QRhiTexture::Format format)
static D3D11_BLEND toD3DBlendFactor(QRhiGraphicsPipeline::BlendFactor f, bool rgb)
static const int RBM_VERTEX
static D3D11_BLEND_OP toD3DBlendOp(QRhiGraphicsPipeline::BlendOp op)
#define D3D11_1_UAV_SLOT_COUNT
static const int RBM_DOMAIN
static D3D11_FILTER toD3DFilter(QRhiSampler::Filter minFilter, QRhiSampler::Filter magFilter, QRhiSampler::Filter mipFilter)
static std::pair< int, int > mapBinding(int binding, int stageIndex, const QShader::NativeResourceBindingMap *nativeResourceBindingMaps[], uint pushConstantStages)
static QD3D11RenderTargetData * rtData(QRhiRenderTarget *rt)
static UINT8 toD3DColorWriteMask(QRhiGraphicsPipeline::ColorMask c)
static D3D11_STENCIL_OP toD3DStencilOp(QRhiGraphicsPipeline::StencilOp op)
void releasePipelineShader(T &s)
static D3D11_COMPARISON_FUNC toD3DTextureComparisonFunc(QRhiSampler::CompareOp op)
static int rbmStageIndex(QRhiShaderStage::Type type)
static DXGI_FORMAT toD3DAttributeFormat(QRhiVertexInputAttribute::Format format)
static void getPushConstantInfo(const QShader &shader, const QShaderKey &key, int *reg, quint32 *size)
static const int RBM_GEOMETRY
static D3D11_PRIMITIVE_TOPOLOGY toD3DTopology(QRhiGraphicsPipeline::Topology t, int patchControlPointCount)
static IDXGIFactory1 * createDXGIFactory2()
static D3D11_FILL_MODE toD3DFillMode(QRhiGraphicsPipeline::PolygonMode mode)
static bool isDepthTextureFormat(QRhiTexture::Format format)
static const int RBM_COMPUTE
static D3D11_CULL_MODE toD3DCullMode(QRhiGraphicsPipeline::CullMode c)
#define SETSHADER(StageL, StageU)
static DXGI_FORMAT toD3DTextureFormat(QRhiTexture::Format format, QRhiTexture::Flags flags)
static const DXGI_FORMAT DEFAULT_FORMAT
static uint clampedResourceCount(uint startSlot, int countSlots, uint maxSlots, const char *resType)
#define D3D11_VS_INPUT_REGISTER_COUNT
#define DXGI_ADAPTER_FLAG_SOFTWARE
\variable QRhiD3D11NativeHandles::dev
static QRhiTexture::Format swapchainReadbackTextureFormat(DXGI_FORMAT format, QRhiTexture::Flags *flags)
static D3D11_COMPARISON_FUNC toD3DCompareOp(QRhiGraphicsPipeline::CompareOp op)
static DXGI_FORMAT toD3DDepthTextureSRVFormat(QRhiTexture::Format format)
static const int RBM_SUPPORTED_STAGES
size_t qHash(const QRhiD3D11::BytecodeCacheKey &k, size_t seed=0) noexcept
Q_DECLARE_TYPEINFO(QRhiD3D11::TextureReadback, Q_RELOCATABLE_TYPE)
bool operator!=(const QRhiD3D11::BytecodeCacheKey &a, const QRhiD3D11::BytecodeCacheKey &b) noexcept
Q_DECLARE_TYPEINFO(QRhiD3D11::BufferReadback, Q_RELOCATABLE_TYPE)
bool operator==(const QRhiD3D11::BytecodeCacheKey &a, const QRhiD3D11::BytecodeCacheKey &b) noexcept
bool hasPendingDynamicUpdates
void endFullDynamicBufferUpdateForCurrentFrame() override
To be called when the entire contents of the buffer data has been updated in the memory block returne...
QD3D11Buffer(QRhiImplementation *rhi, Type type, UsageFlags usage, quint32 size)
char * beginFullDynamicBufferUpdateForCurrentFrame() override
bool create() override
Creates the corresponding native graphics resources.
ID3D11UnorderedAccessView * createClearUnorderedAccessView(quint32 offset, quint32 size)
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
QHash< quint32, ID3D11UnorderedAccessView * > uavs
QRhiBuffer::NativeBuffer nativeBuffer() override
ID3D11UnorderedAccessView * unorderedAccessView(quint32 offset)
QRhiRenderTarget * currentTarget
QVarLengthArray< char, 1024 > pushConstantPool
QVarLengthArray< char, 128 > pushConstantData
static const int MAX_DYNAMIC_OFFSET_COUNT
QVarLengthArray< QRhiBufferData, 4 > bufferDataRetainPool
const uchar * retainBufferData(const QRhiBufferData &data)
ID3D11Buffer * currentVertexBuffers[D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT]
QVarLengthArray< QImage, 4 > imageRetainPool
static const int MAX_VERTEX_BUFFER_BINDING_COUNT
int retainResourceBatches(const QD3D11ShaderResourceBindings::ResourceBatches &resourceBatches)
QRhiShaderResourceBindings * currentGraphicsSrb
QVarLengthArray< ID3D11UnorderedAccessView *, 4 > ownedUavs
const uchar * retainImage(const QImage &image)
QD3D11CommandBuffer(QRhiImplementation *rhi)
QD3D11RenderTargetData::Views currentRenderTargetViews
const uchar * retainData(const QByteArray &data)
QRhiShaderResourceBindings * currentComputeSrb
QRhiBackendCommandList< Command > commands
uint currentPipelineGeneration
QVarLengthArray< QD3D11ShaderResourceBindings::ResourceBatches, 4 > resourceBatchRetainPool
quint32 currentIndexOffset
QVarLengthArray< QByteArray, 4 > dataRetainPool
uint currentSrbGeneration
QRhiComputePipeline * currentComputePipeline
ID3D11Buffer * currentIndexBuffer
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
DXGI_FORMAT currentIndexFormat
quint32 currentVertexOffsets[D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT]
QRhiGraphicsPipeline * currentGraphicsPipeline
ID3D11ComputeShader * shader
QD3D11ComputePipeline(QRhiImplementation *rhi)
QShader::NativeResourceBindingMap nativeResourceBindingMap
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
ID3D11DomainShader * shader
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
QD3D11GraphicsPipeline(QRhiImplementation *rhi)
ID3D11VertexShader * shader
ID3D11PixelShader * shader
ID3D11InputLayout * inputLayout
ID3D11BlendState * blendState
ID3D11RasterizerState * rastState
ID3D11GeometryShader * shader
D3D11_PRIMITIVE_TOPOLOGY d3dTopology
~QD3D11GraphicsPipeline()
bool create() override
Creates the corresponding native graphics resources.
ID3D11DepthStencilState * dsState
QShader::NativeResourceBindingMap nativeResourceBindingMap
ID3D11HullShader * shader
QD3D11RenderBuffer(QRhiImplementation *rhi, Type type, const QSize &pixelSize, int sampleCount, QRhiRenderBuffer::Flags flags, QRhiTexture::Format backingFormatHint)
ID3D11RenderTargetView * rtv
ID3D11DepthStencilView * dsv
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
DXGI_SAMPLE_DESC sampleDesc
bool create() override
Creates the corresponding native graphics resources.
QRhiTexture::Format backingFormat() const override
QD3D11RenderPassDescriptor(QRhiImplementation *rhi)
~QD3D11RenderPassDescriptor()
QRhiRenderPassDescriptor * newCompatibleRenderPassDescriptor() const override
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
bool isCompatible(const QRhiRenderPassDescriptor *other) const override
QVector< quint32 > serializedFormat() const override
ID3D11RenderTargetView * rtv[MAX_COLOR_ATTACHMENTS]
ID3D11DepthStencilView * dsv
void setFrom(int colorAttCount, ID3D11RenderTargetView *const *rtv, ID3D11DepthStencilView *dsv)
static const int MAX_COLOR_ATTACHMENTS
QD3D11RenderTargetData(QRhiImplementation *)
QD3D11RenderPassDescriptor * rp
QRhiRenderTargetAttachmentTracker::ResIdList currentResIdList
std::array< ID3D11UnorderedAccessView *, QD3D11RenderTargetData::MAX_COLOR_ATTACHMENTS > uav
bool update(const QD3D11RenderTargetData::Views ¤tRtViews, ID3D11UnorderedAccessView *const *uavs=nullptr, int count=0)
QD3D11RenderTargetUavUpdateState()
QD3D11RenderTargetData::Views rtViews
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
QD3D11Sampler(QRhiImplementation *rhi, Filter magFilter, Filter minFilter, Filter mipmapMode, AddressMode u, AddressMode v, AddressMode w)
ID3D11SamplerState * samplerState
BoundStorageBufferData sbuf
BoundUniformBufferData ubuf
BoundSampledTextureData stex
BoundStorageImageData simage
QVarLengthArray< Entry, 1 > d
StageSamplerBatches csSamplerBatches
StageUniformBufferBatches dsUniformBufferBatches
StageUavBatches csUavBatches
StageSamplerBatches hsSamplerBatches
StageUniformBufferBatches hsUniformBufferBatches
StageUniformBufferBatches csUniformBufferBatches
StageUniformBufferBatches gsUniformBufferBatches
StageUniformBufferBatches vsUniformBufferBatches
StageSamplerBatches gsSamplerBatches
StageSamplerBatches vsSamplerBatches
StageSamplerBatches dsSamplerBatches
StageUavBatches fsUavBatches
StageSamplerBatches fsSamplerBatches
StageUniformBufferBatches fsUniformBufferBatches
QRhiBatchedBindings< ID3D11SamplerState * > samplers
QRhiBatchedBindings< ID3D11ShaderResourceView * > shaderresources
QRhiBatchedBindings< ID3D11UnorderedAccessView * > uavs
QD3D11GraphicsPipeline * lastUsedGraphicsPipeline
bool create() override
Creates the corresponding resource binding set.
QVarLengthArray< BoundResourceData, 8 > boundResourceData
QVarLengthArray< QRhiShaderResourceBinding, 8 > sortedBindings
~QD3D11ShaderResourceBindings()
void updateResources(UpdateFlags flags) override
QD3D11ComputePipeline * lastUsedComputePipeline
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
QD3D11ShaderResourceBindings(QRhiImplementation *rhi)
int sampleCount() const override
~QD3D11SwapChainRenderTarget()
QD3D11SwapChainRenderTarget(QRhiImplementation *rhi, QRhiSwapChain *swapchain)
float devicePixelRatio() const override
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
QSize pixelSize() const override
bool prepare(QRhiD3D11 *rhiD)
bool tryQueryTimestamps(int idx, ID3D11DeviceContext *context, double *elapsedSec)
bool active[TIMESTAMP_PAIRS]
ID3D11Query * query[TIMESTAMP_PAIRS *2]
ID3D11Query * disjointQuery[TIMESTAMP_PAIRS]
static const int TIMESTAMP_PAIRS
QRhiSwapChainHdrInfo hdrInfo() override
\variable QRhiSwapChainHdrInfo::limitsType
HANDLE frameLatencyWaitableObject
QD3D11SwapChainTimestamps timestamps
ID3D11RenderTargetView * backBufferRtv
int lastFrameLatencyWaitSlot
QRhiRenderTarget * currentFrameRenderTarget() override
QD3D11SwapChainRenderTarget rtRight
ID3D11RenderTargetView * backBufferRtvRight
ID3D11Texture2D * msaaTex[BUFFER_COUNT]
QD3D11SwapChain(QRhiImplementation *rhi)
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
IDCompositionTarget * dcompTarget
QRhiRenderTarget * currentFrameRenderTarget(StereoTargetBuffer targetBuffer) override
ID3D11RenderTargetView * msaaRtv[BUFFER_COUNT]
bool createOrResize() override
Creates the swapchain if not already done and resizes the swapchain buffers to match the current size...
QSize surfacePixelSize() override
bool newColorBuffer(const QSize &size, DXGI_FORMAT format, DXGI_SAMPLE_DESC sampleDesc, ID3D11Texture2D **tex, ID3D11RenderTargetView **rtv) const
static const int BUFFER_COUNT
QD3D11SwapChainRenderTarget rt
bool isFormatSupported(Format f) override
DXGI_SAMPLE_DESC sampleDesc
IDCompositionVisual * dcompVisual
QRhiCommandBuffer * currentFrameCommandBuffer() override
int currentTimestampPairIndex
QRhiRenderPassDescriptor * newCompatibleRenderPassDescriptor() override
IDXGISwapChain * swapChain
DXGI_FORMAT srgbAdjustedColorFormat
ID3D11Texture2D * backBufferTex
QSize pixelSize() const override
QD3D11TextureRenderTarget(QRhiImplementation *rhi, const QRhiTextureRenderTargetDescription &desc, Flags flags)
ID3D11DepthStencilView * dsv
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
float devicePixelRatio() const override
QRhiRenderPassDescriptor * newCompatibleRenderPassDescriptor() override
int sampleCount() const override
bool ownsRtv[QD3D11RenderTargetData::MAX_COLOR_ATTACHMENTS]
ID3D11RenderTargetView * rtv[QD3D11RenderTargetData::MAX_COLOR_ATTACHMENTS]
bool create() override
Creates the corresponding native graphics resources.
~QD3D11TextureRenderTarget()
bool create() override
Creates the corresponding native graphics resources.
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
bool createFrom(NativeTexture src) override
Similar to create(), except that no new native textures are created.
NativeTexture nativeTexture() override
ID3D11UnorderedAccessView * perLevelViews[QRhi::MAX_MIP_LEVELS]
bool prepareCreate(QSize *adjustedSize=nullptr)
QD3D11Texture(QRhiImplementation *rhi, Format format, const QSize &pixelSize, int depth, int arraySize, int sampleCount, Flags flags)
ID3D11UnorderedAccessView * unorderedAccessViewForLevel(int level)
DXGI_SAMPLE_DESC sampleDesc
ID3D11ShaderResourceView * srv
ID3D11Resource * textureResource() const
ID3D11Buffer * stagingBuf
QRhiReadbackResult * result
OffscreenFrame(QRhiImplementation *rhi)
ID3D11Query * tsDisjointQuery
ID3D11Query * tsQueries[2]
QD3D11CommandBuffer cbWrapper
Shader(IUnknown *s, const QByteArray &bytecode, const QShader::NativeResourceBindingMap &rbm, int pushConstantRegister=-1, quint32 pushConstantSize=0)
QRhiReadbackResult * result
QRhiTexture::Format format
QRhiReadbackDescription desc
ID3D11Texture2D * stagingTex
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
ID3D11Buffer * buffers[MAX_VERTEX_BUFFER_BINDING_COUNT]
QD3D11RenderTargetData::Views rtViews
ID3D11BlendState * blendState
ID3D11DepthStencilView * swapchainDsv
ID3D11InputLayout * inputLayout
ID3D11UnorderedAccessView * uav
ID3D11ShaderResourceView * srv
D3D11_PRIMITIVE_TOPOLOGY topology
UINT offsets[MAX_VERTEX_BUFFER_BINDING_COUNT]
uint dynamicOffsetPairs[MAX_DYNAMIC_OFFSET_COUNT *2]
ID3D11RasterizerState * rastState
ID3D11Buffer * indirectBuffer
quint32 indirectBufferOffset
UINT strides[MAX_VERTEX_BUFFER_BINDING_COUNT]
ID3D11DepthStencilState * dsState
ID3D11RenderTargetView * swapchainRtv
ID3D11GeometryShader * gs
ID3D11Query * tsDisjointQuery