Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
QRhiVulkan Class Reference

#include <qrhivulkan_p.h>

+ Inheritance diagram for QRhiVulkan:
+ Collaboration diagram for QRhiVulkan:

Classes

struct  BufferReadback
 
struct  DeferredReleaseEntry
 
struct  DescriptorPoolData
 
struct  OffscreenFrame
 
struct  TextureReadback
 

Public Types

using BufferImageCopyList = QVarLengthArray< VkBufferImageCopy, 16 >
 

Public Member Functions

 QRhiVulkan (QRhiVulkanInitParams *params, QRhiVulkanNativeHandles *importParams=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
 
VkResult createDescriptorPool (VkDescriptorPool *pool)
 
bool allocateDescriptorSet (VkDescriptorSetAllocateInfo *allocInfo, VkDescriptorSet *result, int *resultPoolIndex)
 
uint32_t chooseTransientImageMemType (VkImage img, uint32_t startIndex)
 
bool createTransientImage (VkFormat format, const QSize &pixelSize, VkImageUsageFlags usage, VkImageAspectFlags aspectMask, VkSampleCountFlagBits samples, VkDeviceMemory *mem, VkImage *images, VkImageView *views, int count)
 
bool recreateSwapChain (QRhiSwapChain *swapChain)
 
void releaseSwapChainResources (QRhiSwapChain *swapChain)
 
VkFormat optimalDepthStencilFormat ()
 
VkSampleCountFlagBits effectiveSampleCount (int sampleCount)
 
bool createDefaultRenderPass (QVkRenderPassDescriptor *rpD, bool hasDepthStencil, VkSampleCountFlagBits samples, VkFormat colorFormat)
 
bool createOffscreenRenderPass (QVkRenderPassDescriptor *rpD, const QRhiColorAttachment *firstColorAttachment, const QRhiColorAttachment *lastColorAttachment, bool preserveColor, bool preserveDs, QRhiRenderBuffer *depthStencilBuffer, QRhiTexture *depthTexture)
 
bool ensurePipelineCache (const void *initialData=nullptr, size_t initialDataSize=0)
 
VkShaderModule createShader (const QByteArray &spirv)
 
void prepareNewFrame (QRhiCommandBuffer *cb)
 
VkCommandBuffer startSecondaryCommandBuffer (QVkRenderTargetData *rtD=nullptr)
 
void endAndEnqueueSecondaryCommandBuffer (VkCommandBuffer cb, QVkCommandBuffer *cbD)
 
QRhi::FrameOpResult startPrimaryCommandBuffer (VkCommandBuffer *cb)
 
QRhi::FrameOpResult endAndSubmitPrimaryCommandBuffer (VkCommandBuffer cb, VkFence cmdFence, VkSemaphore *waitSem, VkSemaphore *signalSem)
 
void waitCommandCompletion (int frameSlot)
 
VkDeviceSize subresUploadByteSize (const QRhiTextureSubresourceUploadDescription &subresDesc) const
 
void prepareUploadSubres (QVkTexture *texD, int layer, int level, const QRhiTextureSubresourceUploadDescription &subresDesc, size_t *curOfs, void *mp, BufferImageCopyList *copyInfos)
 
void enqueueResourceUpdates (QVkCommandBuffer *cbD, QRhiResourceUpdateBatch *resourceUpdates)
 
void executeBufferHostWritesForSlot (QVkBuffer *bufD, int slot)
 
void enqueueTransitionPassResources (QVkCommandBuffer *cbD)
 
void recordPrimaryCommandBuffer (QVkCommandBuffer *cbD)
 
void trackedRegisterBuffer (QRhiPassResourceTracker *passResTracker, QVkBuffer *bufD, int slot, QRhiPassResourceTracker::BufferAccess access, QRhiPassResourceTracker::BufferStage stage)
 
void trackedRegisterTexture (QRhiPassResourceTracker *passResTracker, QVkTexture *texD, QRhiPassResourceTracker::TextureAccess access, QRhiPassResourceTracker::TextureStage stage)
 
void recordTransitionPassResources (QVkCommandBuffer *cbD, const QRhiPassResourceTracker &tracker)
 
void activateTextureRenderTarget (QVkCommandBuffer *cbD, QVkTextureRenderTarget *rtD)
 
void executeDeferredReleases (bool forced=false)
 
void finishActiveReadbacks (bool forced=false)
 
void setObjectName (uint64_t object, VkObjectType type, const QByteArray &name, int slot=-1)
 
void trackedBufferBarrier (QVkCommandBuffer *cbD, QVkBuffer *bufD, int slot, VkAccessFlags access, VkPipelineStageFlags stage)
 
void trackedImageBarrier (QVkCommandBuffer *cbD, QVkTexture *texD, VkImageLayout layout, VkAccessFlags access, VkPipelineStageFlags stage)
 
void depthStencilExplicitBarrier (QVkCommandBuffer *cbD, QVkRenderBuffer *rbD)
 
void subresourceBarrier (QVkCommandBuffer *cbD, VkImage image, VkImageLayout oldLayout, VkImageLayout newLayout, VkAccessFlags srcAccess, VkAccessFlags dstAccess, VkPipelineStageFlags srcStage, VkPipelineStageFlags dstStage, int startLayer, int layerCount, int startLevel, int levelCount)
 
void updateShaderResourceBindings (QRhiShaderResourceBindings *srb, int descSetIdx=-1)
 
void ensureCommandPoolForNewFrame ()
 
double elapsedSecondsFromTimestamp (quint64 timestamp[2], bool *ok)
 
- 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

QVulkanInstanceinst = nullptr
 
QWindowmaybeWindow = nullptr
 
QByteArrayList requestedDeviceExtensions
 
bool importedDevice = false
 
VkPhysicalDevice physDev = VK_NULL_HANDLE
 
VkDevice dev = VK_NULL_HANDLE
 
VkCommandPool cmdPool [QVK_FRAMES_IN_FLIGHT] = {}
 
quint32 gfxQueueFamilyIdx = 0
 
quint32 gfxQueueIdx = 0
 
VkQueue gfxQueue = VK_NULL_HANDLE
 
quint32 timestampValidBits = 0
 
bool importedAllocator = false
 
QVkAllocator allocator = nullptr
 
QVulkanFunctionsf = nullptr
 
QVulkanDeviceFunctionsdf = nullptr
 
QRhi::Flags rhiFlags
 
VkPhysicalDeviceFeatures physDevFeatures
 
VkPhysicalDeviceProperties physDevProperties
 
VkDeviceSize ubufAlign
 
VkDeviceSize texbufAlign
 
bool deviceLost = false
 
bool releaseCachedResourcesCalledBeforeFrameStart = false
 
PFN_vkCreateSwapchainKHR vkCreateSwapchainKHR = nullptr
 
PFN_vkDestroySwapchainKHR vkDestroySwapchainKHR
 
PFN_vkGetSwapchainImagesKHR vkGetSwapchainImagesKHR
 
PFN_vkAcquireNextImageKHR vkAcquireNextImageKHR
 
PFN_vkQueuePresentKHR vkQueuePresentKHR
 
PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR vkGetPhysicalDeviceSurfaceCapabilitiesKHR
 
PFN_vkGetPhysicalDeviceSurfaceFormatsKHR vkGetPhysicalDeviceSurfaceFormatsKHR
 
PFN_vkGetPhysicalDeviceSurfacePresentModesKHR vkGetPhysicalDeviceSurfacePresentModesKHR
 
struct { 
 
   bool   compute = false 
 
   bool   wideLines = false 
 
   bool   debugUtils = false 
 
   bool   vertexAttribDivisor = false 
 
   bool   texture3DSliceAs2D = false 
 
   bool   tessellation = false 
 
   bool   geometryShader = false 
 
   bool   nonFillPolygonMode = false 
 
   bool   multiView = false 
 
   QVersionNumber   apiVersion 
 
caps 
 
VkPipelineCache pipelineCache = VK_NULL_HANDLE
 
QVarLengthArray< DescriptorPoolData, 8 > descriptorPools
 
QVarLengthArray< VkCommandBuffer, 4 > freeSecondaryCbs [QVK_FRAMES_IN_FLIGHT]
 
VkQueryPool timestampQueryPool = VK_NULL_HANDLE
 
QBitArray timestampQueryPoolMap
 
VkFormat optimalDsFormat = VK_FORMAT_UNDEFINED
 
QMatrix4x4 clipCorrectMatrix
 
QVkSwapChaincurrentSwapChain = nullptr
 
QSet< QVkSwapChain * > swapchains
 
QRhiVulkanNativeHandles nativeHandlesStruct
 
QRhiDriverInfo driverInfoStruct
 
struct QRhiVulkan::OffscreenFrame ofr
 
QVarLengthArray< TextureReadback, 2 > activeTextureReadbacks
 
QVarLengthArray< BufferReadback, 2 > activeBufferReadbacks
 
QList< DeferredReleaseEntryreleaseQueue
 
- 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 637 of file qrhivulkan_p.h.

Member Typedef Documentation

◆ BufferImageCopyList

using QRhiVulkan::BufferImageCopyList = QVarLengthArray<VkBufferImageCopy, 16>

Definition at line 783 of file qrhivulkan_p.h.

Constructor & Destructor Documentation

◆ QRhiVulkan()

QRhiVulkan::QRhiVulkan ( QRhiVulkanInitParams params,
QRhiVulkanNativeHandles importParams = nullptr 
)

Member Function Documentation

◆ activateTextureRenderTarget()

void QRhiVulkan::activateTextureRenderTarget ( QVkCommandBuffer cbD,
QVkTextureRenderTarget rtD 
)

◆ allocateDescriptorSet()

bool QRhiVulkan::allocateDescriptorSet ( VkDescriptorSetAllocateInfo *  allocInfo,
VkDescriptorSet *  result,
int *  resultPoolIndex 
)

Definition at line 908 of file qrhivulkan.cpp.

References createDescriptorPool(), descriptorPools, dev, df, i, pool, QVK_DESC_SETS_PER_POOL, and qWarning.

+ Here is the call graph for this function:

◆ beginComputePass()

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

◆ beginExternal()

◆ beginFrame()

◆ beginOffscreenFrame()

◆ beginPass()

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

Implements QRhiImplementation.

Definition at line 2467 of file qrhivulkan.cpp.

References activateTextureRenderTarget(), QVkCommandBuffer::activeSecondaryCbStack, QColor::alphaF(), QVarLengthArray< T, Prealloc >::append(), QVkCommandBuffer::Command::args, QVkCommandBuffer::Command::BeginRenderPass, QVkCommandBuffer::Command::Args::beginRenderPass, QColor::blueF(), cb, QVkCommandBuffer::clearValue, QVkCommandBuffer::Command::Args::clearValueIndex, QVkCommandBuffer::Command::cmd, QVkRenderTargetData::colorAttCount, QVkCommandBuffer::commands, QVarLengthArray< T, Prealloc >::constData(), QRhiImplementation::currentFrameSlot, QVkSwapChain::currentImageIndex, currentSwapChain, QVkCommandBuffer::currentTarget, QVkTextureRenderTarget::d, QRhiDepthStencilClearValue::depthClearValue(), QVkCommandBuffer::Command::Args::desc, QVkRenderTargetData::dsAttCount, enqueueResourceUpdates(), enqueueTransitionPassResources(), QRhiCommandBuffer::ExternalContent, QVkRenderTargetData::fb, QColor::greenF(), QSize::height(), i, QVkSwapChain::imageRes, QVkRenderPassDescriptor::lastActiveFrameSlot, QVkCommandBuffer::NoPass, QVkCommandBuffer::passUsesSecondaryCb, QVkRenderTargetData::pixelSize, QVkCommandBuffer::pools, Q_ASSERT, QRHI_RES, QVkCommandBuffer::recordingPass, QColor::redF(), QVkCommandBuffer::RenderPass, QVkCommandBuffer::resetCachedState(), QVkRenderTargetData::resolveAttCount, QRhiResource::resourceType(), QVkRenderPassDescriptor::rp, QVkRenderTargetData::rp, QVkSwapChain::ImageResources::ScImageUseRender, QVLABaseBase::size(), startSecondaryCommandBuffer(), QRhiDepthStencilClearValue::stencilClearValue(), QRhiResource::SwapChainRenderTarget, QRhiResource::TextureRenderTarget, QVkCommandBuffer::Command::Args::useSecondaryCb, and QSize::width().

+ Here is the call graph for this function:

◆ chooseTransientImageMemType()

uint32_t QRhiVulkan::chooseTransientImageMemType ( VkImage  img,
uint32_t  startIndex 
)

Definition at line 1102 of file qrhivulkan.cpp.

References dev, df, i, and physDev.

Referenced by createTransientImage().

+ Here is the caller graph for this function:

◆ clipSpaceCorrMatrix()

QMatrix4x4 QRhiVulkan::clipSpaceCorrMatrix ( ) const
overridevirtual

Implements QRhiImplementation.

Definition at line 4370 of file qrhivulkan.cpp.

◆ create()

◆ createBuffer()

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

Implements QRhiImplementation.

Definition at line 4345 of file qrhivulkan.cpp.

◆ createComputePipeline()

QRhiComputePipeline * QRhiVulkan::createComputePipeline ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 4740 of file qrhivulkan.cpp.

◆ createDefaultRenderPass()

bool QRhiVulkan::createDefaultRenderPass ( QVkRenderPassDescriptor rpD,
bool  hasDepthStencil,
VkSampleCountFlagBits  samples,
VkFormat  colorFormat 
)

◆ createDescriptorPool()

VkResult QRhiVulkan::createDescriptorPool ( VkDescriptorPool *  pool)

Definition at line 887 of file qrhivulkan.cpp.

References dev, df, pool, QVK_COMBINED_IMAGE_SAMPLERS_PER_POOL, QVK_DESC_SETS_PER_POOL, QVK_STORAGE_BUFFERS_PER_POOL, QVK_STORAGE_IMAGES_PER_POOL, and QVK_UNIFORM_BUFFERS_PER_POOL.

Referenced by allocateDescriptorSet().

+ Here is the caller graph for this function:

◆ createGraphicsPipeline()

QRhiGraphicsPipeline * QRhiVulkan::createGraphicsPipeline ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 4735 of file qrhivulkan.cpp.

◆ createOffscreenRenderPass()

bool QRhiVulkan::createOffscreenRenderPass ( QVkRenderPassDescriptor rpD,
const QRhiColorAttachment firstColorAttachment,
const QRhiColorAttachment lastColorAttachment,
bool  preserveColor,
bool  preserveDs,
QRhiRenderBuffer depthStencilBuffer,
QRhiTexture depthTexture 
)

◆ createRenderBuffer()

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

Implements QRhiImplementation.

Definition at line 4708 of file qrhivulkan.cpp.

◆ createSampler()

QRhiSampler * QRhiVulkan::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 4722 of file qrhivulkan.cpp.

◆ createShader()

VkShaderModule QRhiVulkan::createShader ( const QByteArray spirv)

Definition at line 2791 of file qrhivulkan.cpp.

References QByteArray::constData(), dev, df, qWarning, and QByteArray::size().

+ Here is the call graph for this function:

◆ createShaderResourceBindings()

QRhiShaderResourceBindings * QRhiVulkan::createShaderResourceBindings ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 4745 of file qrhivulkan.cpp.

◆ createSwapChain()

QRhiSwapChain * QRhiVulkan::createSwapChain ( )
overridevirtual

◆ createTexture()

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

Implements QRhiImplementation.

Definition at line 4715 of file qrhivulkan.cpp.

◆ createTextureRenderTarget()

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

Implements QRhiImplementation.

Definition at line 4729 of file qrhivulkan.cpp.

References desc.

◆ createTransientImage()

bool QRhiVulkan::createTransientImage ( VkFormat  format,
const QSize pixelSize,
VkImageUsageFlags  usage,
VkImageAspectFlags  aspectMask,
VkSampleCountFlagBits  samples,
VkDeviceMemory *  mem,
VkImage *  images,
VkImageView *  views,
int  count 
)

Definition at line 1134 of file qrhivulkan.cpp.

References aligned(), chooseTransientImageMemType(), dev, df, QSize::height(), i, images, qWarning, and QSize::width().

Referenced by recreateSwapChain().

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

◆ debugMarkBegin()

◆ debugMarkEnd()

void QRhiVulkan::debugMarkEnd ( QRhiCommandBuffer cb)
overridevirtual

◆ debugMarkMsg()

◆ depthStencilExplicitBarrier()

void QRhiVulkan::depthStencilExplicitBarrier ( QVkCommandBuffer cbD,
QVkRenderBuffer rbD 
)

◆ destroy()

void QRhiVulkan::destroy ( )
overridevirtual

◆ dispatch()

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

Implements QRhiImplementation.

Definition at line 2660 of file qrhivulkan.cpp.

References QVkCommandBuffer::activeSecondaryCbStack, QVarLengthArray< T, Prealloc >::append(), QVkCommandBuffer::Command::args, QVarLengthArray< T, Prealloc >::at(), QHash< Key, T >::begin(), QVkCommandBuffer::Command::BufferBarrier, QVkCommandBuffer::Command::Args::bufferBarrier, QVkCommandBuffer::bufferBarrier, QRhiShaderResourceBinding::BufferLoad, QRhiShaderResourceBinding::BufferLoadStore, QVkBuffer::buffers, QRhiShaderResourceBinding::BufferStore, cb, QVkCommandBuffer::Command::cmd, QVkCommandBuffer::commands, QVkCommandBuffer::ComputePass, QVkCommandBuffer::computePassState, QVarLengthArray< T, Prealloc >::constData(), QVkCommandBuffer::Command::Args::count, QVkCommandBuffer::currentComputeSrb, QRhiImplementation::currentFrameSlot, df, QVkCommandBuffer::Command::Dispatch, QVkCommandBuffer::Command::Args::dispatch, QVkCommandBuffer::Command::Args::dstStageMask, QRhiBuffer::Dynamic, QHash< Key, T >::end(), QHash< Key, T >::erase(), i, QVkTexture::image, QVkCommandBuffer::Command::ImageBarrier, QVkCommandBuffer::Command::Args::imageBarrier, QVkCommandBuffer::imageBarrier, QRhiShaderResourceBinding::ImageLoad, QRhiShaderResourceBinding::ImageLoadStore, QRhiShaderResourceBinding::ImageStore, QVkCommandBuffer::Command::Args::index, QVarLengthArray< T, Prealloc >::isEmpty(), it, QVarLengthArray< T, Prealloc >::last(), QVkTexture::UsageState::layout, QRhiShaderResourceBindings::m_bindings, QRhiBuffer::m_type, QVkCommandBuffer::passUsesSecondaryCb, QVkCommandBuffer::pools, Q_ASSERT, QRHI_RES, qrhivk_accumulateComputeResource(), QVkCommandBuffer::recordingPass, QRhiImplementation::shaderResourceBindingData(), QVLABaseBase::size(), QVkCommandBuffer::Command::Args::srcStageMask, QRhiResource::Texture, QVkTexture::usageState, QVkCommandBuffer::writtenResources, QVkCommandBuffer::Command::Args::x, QVkCommandBuffer::Command::Args::y, and QVkCommandBuffer::Command::Args::z.

+ Here is the call graph for this function:

◆ draw()

◆ drawIndexed()

◆ driverInfo()

QRhiDriverInfo QRhiVulkan::driverInfo ( ) const
overridevirtual

Implements QRhiImplementation.

Definition at line 4544 of file qrhivulkan.cpp.

References driverInfoStruct.

◆ effectiveSampleCount()

VkSampleCountFlagBits QRhiVulkan::effectiveSampleCount ( int  sampleCount)

Definition at line 3940 of file qrhivulkan.cpp.

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

+ Here is the call graph for this function:

◆ elapsedSecondsFromTimestamp()

double QRhiVulkan::elapsedSecondsFromTimestamp ( quint64  timestamp[2],
bool *  ok 
)

Definition at line 1826 of file qrhivulkan.cpp.

References i, ok, physDevProperties, qFuzzyIsNull(), and timestampValidBits.

Referenced by beginFrame(), and endOffscreenFrame().

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

◆ endAndEnqueueSecondaryCommandBuffer()

void QRhiVulkan::endAndEnqueueSecondaryCommandBuffer ( VkCommandBuffer  cb,
QVkCommandBuffer cbD 
)

◆ endAndSubmitPrimaryCommandBuffer()

QRhi::FrameOpResult QRhiVulkan::endAndSubmitPrimaryCommandBuffer ( VkCommandBuffer  cb,
VkFence  cmdFence,
VkSemaphore *  waitSem,
VkSemaphore *  signalSem 
)

Definition at line 2123 of file qrhivulkan.cpp.

References cb, deviceLost, df, QRhi::FrameOpDeviceLost, QRhi::FrameOpError, QRhi::FrameOpSuccess, gfxQueue, and qWarning.

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

+ Here is the caller graph for this function:

◆ endComputePass()

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

◆ endExternal()

◆ endFrame()

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

◆ endOffscreenFrame()

◆ endPass()

◆ enqueueResourceUpdates()

void QRhiVulkan::enqueueResourceUpdates ( QVkCommandBuffer cbD,
QRhiResourceUpdateBatch resourceUpdates 
)

Definition at line 3254 of file qrhivulkan.cpp.

References QVkTexture::UsageState::access, QRhiResourceUpdateBatchPrivate::activeBufferOpCount, activeBufferReadbacks, QRhiVulkan::TextureReadback::activeFrameSlot, QRhiVulkan::BufferReadback::activeFrameSlot, QRhiResourceUpdateBatchPrivate::activeTextureOpCount, activeTextureReadbacks, allocation, QVkBuffer::allocations, allocator, QVarLengthArray< T, Prealloc >::append(), QVkCommandBuffer::Command::args, QVkCommandBuffer::Command::BlitImage, QVkCommandBuffer::Command::Args::blitImage, QRhiResourceUpdateBatchPrivate::BufferOp::buf, QVkCommandBuffer::bufferImageCopy, QVkCommandBuffer::Command::Args::bufferImageCopyIndex, QRhiResourceUpdateBatchPrivate::bufferOps, QVkBuffer::buffers, QRhiVulkan::TextureReadback::byteSize, QRhiVulkan::BufferReadback::byteSize, QVkCommandBuffer::Command::cmd, QVkSwapChain::colorFormat, QVkCommandBuffer::commands, QRhiReadbackResult::completed, QVarLengthArray< T, Prealloc >::constData(), QRhiBufferData::constData(), QRhiResourceUpdateBatchPrivate::TextureOp::Copy, QVkCommandBuffer::Command::CopyBuffer, QVkCommandBuffer::Command::Args::copyBuffer, QVkCommandBuffer::Command::CopyBufferToImage, QVkCommandBuffer::Command::Args::copyBufferToImage, QVkCommandBuffer::Command::CopyImage, QVkCommandBuffer::Command::Args::copyImage, QVkCommandBuffer::Command::CopyImageToBuffer, QVkCommandBuffer::Command::Args::copyImageToBuffer, QVkCommandBuffer::Command::Args::count, QRhiTexture::CubeMap, QRhiImplementation::currentFrameSlot, QVkSwapChain::currentImageIndex, currentSwapChain, QByteArray::data(), QRhiReadbackResult::data, QRhiResourceUpdateBatchPrivate::BufferOp::data, QRhiResourceUpdateBatchPrivate::TextureOp::desc, QVkCommandBuffer::Command::Args::desc, QRhiVulkan::TextureReadback::desc, QRhiTextureCopyDescription::destinationLayer(), QRhiTextureCopyDescription::destinationLevel(), QRhiTextureCopyDescription::destinationTopLeft(), QRhiResourceUpdateBatchPrivate::TextureOp::dst, QVkCommandBuffer::Command::Args::dst, QVkCommandBuffer::Command::Args::dstLayout, QRhiBuffer::Dynamic, QRhiResourceUpdateBatchPrivate::BufferOp::DynamicUpdate, e, executeBufferHostWritesForSlot(), QVkCommandBuffer::Command::Args::filter, QRhiVulkan::TextureReadback::format, QRhiResourceUpdateBatchPrivate::free(), QRhiResourceUpdateBatchPrivate::TextureOp::GenMips, QRhiResourceUpdateBatchPrivate::get(), QSize::height(), i, QVkTexture::image, QVkSwapChain::ImageResources::image, QVkSwapChain::imageRes, QRhiBuffer::Immutable, QList< T >::isEmpty(), QSize::isEmpty(), QVkBuffer::lastActiveFrameSlot, QVkTexture::lastActiveFrameSlot, QVkSwapChain::ImageResources::lastUse, QRhiReadbackDescription::layer(), QVkTexture::UsageState::layout, QRhiReadbackDescription::level(), QRhiTexture::m_arraySize, QRhiTexture::m_depth, QRhiTexture::m_flags, QRhiTexture::m_format, QRhiTexture::m_pixelSize, QRhiBuffer::m_size, QRhiBuffer::m_type, QRhi::MAX_MIP_LEVELS, QVkTexture::mipLevelCount, QRhiResourceUpdateBatchPrivate::BufferOp::offset, QVkBuffer::pendingDynamicUpdates, QRhiTextureCopyDescription::pixelSize(), QVkSwapChain::pixelSize, QRhiVulkan::TextureReadback::pixelSize, QVkCommandBuffer::pools, prepareUploadSubres(), Q_ASSERT, qMax(), QRHI_RES, QVK_FRAMES_IN_FLIGHT, qWarning, QRhiResourceUpdateBatchPrivate::TextureOp::rb, QRhiResourceUpdateBatchPrivate::BufferOp::Read, QRhiResourceUpdateBatchPrivate::TextureOp::Read, QRhiResourceUpdateBatchPrivate::BufferOp::readSize, releaseQueue, QByteArray::resize(), QRhiResourceUpdateBatchPrivate::BufferOp::result, QRhiResourceUpdateBatchPrivate::TextureOp::result, QRhiVulkan::TextureReadback::result, QRhiVulkan::BufferReadback::result, QVkTexture::samples, QVkSwapChain::ImageResources::ScImageUseRender, QVkSwapChain::ImageResources::ScImageUseTransferSource, QRhiBufferData::size(), QVLABaseBase::size(), QRhiTextureCopyDescription::sourceLayer(), QRhiTextureCopyDescription::sourceLevel(), QRhiTextureCopyDescription::sourceTopLeft(), QRhiResourceUpdateBatchPrivate::TextureOp::src, QVkCommandBuffer::Command::Args::src, QVkCommandBuffer::Command::Args::srcLayout, QVkTexture::UsageState::stage, QRhiVulkan::TextureReadback::stagingAlloc, QRhiVulkan::BufferReadback::stagingAlloc, QVkBuffer::stagingAllocations, QVkTexture::stagingAllocations, QRhiVulkan::TextureReadback::stagingBuf, QRhiVulkan::BufferReadback::stagingBuf, QRhiVulkan::DeferredReleaseEntry::StagingBuffer, QVkBuffer::stagingBuffers, QVkTexture::stagingBuffers, QRhiResourceUpdateBatchPrivate::BufferOp::StaticUpload, QRhiResourceUpdateBatchPrivate::TextureOp::subresDesc, subresourceBarrier(), subresUploadByteSize(), QVkSwapChain::supportsReadback, swapchainReadbackTextureFormat(), QRhiReadbackDescription::texture(), QRhiTexture::TextureArray, QRhiImplementation::textureFormatInfo(), QRhiResourceUpdateBatchPrivate::textureOps, QRhiTexture::ThreeDimensional, toVmaAllocation(), toVmaAllocator(), trackedBufferBarrier(), trackedImageBarrier(), QRhiResourceUpdateBatchPrivate::BufferOp::type, QRhiResourceUpdateBatchPrivate::TextureOp::type, QRhiTexture::UnknownFormat, QRhiResourceUpdateBatchPrivate::TextureOp::Upload, QVkTexture::usageState, QRhiTexture::UsedWithGenerateMips, QSize::width(), QPoint::x(), and QPoint::y().

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

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

◆ enqueueTransitionPassResources()

void QRhiVulkan::enqueueTransitionPassResources ( QVkCommandBuffer cbD)

Definition at line 3958 of file qrhivulkan.cpp.

References QVarLengthArray< T, Prealloc >::append(), QVkCommandBuffer::Command::args, QVkCommandBuffer::Command::cmd, QVkCommandBuffer::commands, QVkCommandBuffer::currentPassResTrackerIndex, QVkCommandBuffer::passResTrackers, QVLABaseBase::size(), QVkCommandBuffer::Command::Args::trackerIndex, QVkCommandBuffer::Command::TransitionPassResources, and QVkCommandBuffer::Command::Args::transitionResources.

Referenced by beginComputePass(), and beginPass().

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

◆ ensureCommandPoolForNewFrame()

void QRhiVulkan::ensureCommandPoolForNewFrame ( )

Definition at line 1812 of file qrhivulkan.cpp.

References cmdPool, QRhiImplementation::currentFrameSlot, dev, df, and releaseCachedResourcesCalledBeforeFrameStart.

Referenced by beginFrame(), beginOffscreenFrame(), and finish().

+ Here is the caller graph for this function:

◆ ensurePipelineCache()

bool QRhiVulkan::ensurePipelineCache ( const void initialData = nullptr,
size_t  initialDataSize = 0 
)

Definition at line 2806 of file qrhivulkan.cpp.

References dev, df, pipelineCache, and qWarning.

Referenced by setPipelineCacheData().

+ Here is the caller graph for this function:

◆ executeBufferHostWritesForSlot()

void QRhiVulkan::executeBufferHostWritesForSlot ( QVkBuffer bufD,
int  slot 
)

Definition at line 3732 of file qrhivulkan.cpp.

References QVkBuffer::allocations, allocator, QRhiBuffer::Dynamic, QRhiBuffer::m_type, QVkBuffer::pendingDynamicUpdates, Q_ASSERT, qWarning, toVmaAllocation(), and toVmaAllocator().

Referenced by enqueueResourceUpdates(), setShaderResources(), and setVertexInput().

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

◆ executeDeferredReleases()

◆ finish()

◆ finishActiveReadbacks()

◆ isClipDepthZeroToOne()

bool QRhiVulkan::isClipDepthZeroToOne ( ) const
overridevirtual

Implements QRhiImplementation.

Definition at line 4365 of file qrhivulkan.cpp.

◆ isDeviceLost()

bool QRhiVulkan::isDeviceLost ( ) const
overridevirtual

Implements QRhiImplementation.

Definition at line 4580 of file qrhivulkan.cpp.

References deviceLost.

◆ isFeatureSupported()

◆ isTextureFormatSupported()

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

Implements QRhiImplementation.

Definition at line 4385 of file qrhivulkan.cpp.

References QRhiTexture::ASTC_12x12, QRhiTexture::ASTC_4x4, QRhiTexture::BC1, QRhiTexture::BC7, QRhiTexture::ETC2_RGB8, QRhiTexture::ETC2_RGBA8, physDev, physDevFeatures, and toVkTextureFormat().

+ Here is the call graph for this function:

◆ isYUpInFramebuffer()

bool QRhiVulkan::isYUpInFramebuffer ( ) const
overridevirtual

Implements QRhiImplementation.

Definition at line 4355 of file qrhivulkan.cpp.

◆ isYUpInNDC()

bool QRhiVulkan::isYUpInNDC ( ) const
overridevirtual

Implements QRhiImplementation.

Definition at line 4360 of file qrhivulkan.cpp.

◆ lastCompletedGpuTime()

double QRhiVulkan::lastCompletedGpuTime ( QRhiCommandBuffer cb)
overridevirtual

Implements QRhiImplementation.

Definition at line 5378 of file qrhivulkan.cpp.

References cb, QVkCommandBuffer::lastGpuTime, and QRHI_RES.

◆ makeThreadLocalNativeContextCurrent()

bool QRhiVulkan::makeThreadLocalNativeContextCurrent ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 4569 of file qrhivulkan.cpp.

◆ nativeHandles() [1/2]

const QRhiNativeHandles * QRhiVulkan::nativeHandles ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 4539 of file qrhivulkan.cpp.

References nativeHandlesStruct.

◆ nativeHandles() [2/2]

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

Implements QRhiImplementation.

Definition at line 5300 of file qrhivulkan.cpp.

References cb, and QRHI_RES.

◆ optimalDepthStencilFormat()

VkFormat QRhiVulkan::optimalDepthStencilFormat ( )

Definition at line 1223 of file qrhivulkan.cpp.

References optimalDsFormat, physDev, and qWarning.

Referenced by createDefaultRenderPass().

+ Here is the caller graph for this function:

◆ pipelineCacheData()

QByteArray QRhiVulkan::pipelineCacheData ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 4597 of file qrhivulkan.cpp.

References dev, df, QRhi::EnablePipelineCacheDataSave, header(), headerSize, physDevProperties, pipelineCache, QRhiImplementation::pipelineCacheRhiId(), Q_STATIC_ASSERT, qCDebug, and rhiFlags.

+ Here is the call graph for this function:

◆ prepareNewFrame()

void QRhiVulkan::prepareNewFrame ( QRhiCommandBuffer cb)

Definition at line 2062 of file qrhivulkan.cpp.

References cb, executeDeferredReleases(), finishActiveReadbacks(), QRHI_RES, and releaseCachedResourcesCalledBeforeFrameStart.

Referenced by beginFrame(), and beginOffscreenFrame().

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

◆ prepareUploadSubres()

◆ recordPrimaryCommandBuffer()

void QRhiVulkan::recordPrimaryCommandBuffer ( QVkCommandBuffer cbD)

Definition at line 3968 of file qrhivulkan.cpp.

References QVkCommandBuffer::Command::args, QVkCommandBuffer::Command::BeginRenderPass, QVkCommandBuffer::Command::Args::beginRenderPass, QVkCommandBuffer::Command::BindDescriptorSet, QVkCommandBuffer::Command::Args::bindDescriptorSet, QVkCommandBuffer::Command::BindIndexBuffer, QVkCommandBuffer::Command::Args::bindIndexBuffer, QVkCommandBuffer::Command::BindPipeline, QVkCommandBuffer::Command::Args::bindPipeline, QVkCommandBuffer::Command::Args::bindPoint, QVkCommandBuffer::Command::BindVertexBuffer, QVkCommandBuffer::Command::Args::bindVertexBuffer, QVkCommandBuffer::Command::BlitImage, QVkCommandBuffer::Command::Args::blitImage, QVkCommandBuffer::Command::Args::buf, QVkCommandBuffer::Command::BufferBarrier, QVkCommandBuffer::Command::Args::bufferBarrier, QVkCommandBuffer::bufferBarrier, QVkCommandBuffer::bufferImageCopy, QVkCommandBuffer::Command::Args::bufferImageCopyIndex, QVkCommandBuffer::Command::Args::c, QVkCommandBuffer::cb, QVkCommandBuffer::Command::Args::cb, QVkCommandBuffer::clearValue, QVkCommandBuffer::Command::Args::clearValueIndex, QVkCommandBuffer::Command::cmd, QVkCommandBuffer::commands, QVarLengthArray< T, Prealloc >::constData(), QVkCommandBuffer::Command::CopyBuffer, QVkCommandBuffer::Command::Args::copyBuffer, QVkCommandBuffer::Command::CopyBufferToImage, QVkCommandBuffer::Command::Args::copyBufferToImage, QVkCommandBuffer::Command::CopyImage, QVkCommandBuffer::Command::Args::copyImage, QVkCommandBuffer::Command::CopyImageToBuffer, QVkCommandBuffer::Command::Args::copyImageToBuffer, QVkCommandBuffer::Command::Args::count, QVkCommandBuffer::Command::DebugMarkerBegin, QVkCommandBuffer::Command::Args::debugMarkerBegin, QVkCommandBuffer::debugMarkerData, QVkCommandBuffer::Command::DebugMarkerEnd, QVkCommandBuffer::Command::DebugMarkerInsert, QVkCommandBuffer::Command::Args::debugMarkerInsert, QVkCommandBuffer::Command::Args::desc, QVkCommandBuffer::Command::Args::descSet, df, QVkCommandBuffer::Command::Dispatch, QVkCommandBuffer::Command::Args::dispatch, QVkCommandBuffer::Command::Draw, QVkCommandBuffer::Command::Args::draw, QVkCommandBuffer::Command::DrawIndexed, QVkCommandBuffer::Command::Args::drawIndexed, QVkCommandBuffer::Command::Args::dst, QVkCommandBuffer::Command::Args::dstLayout, QVkCommandBuffer::Command::Args::dstStageMask, QVkCommandBuffer::dynamicOffset, QVkCommandBuffer::Command::Args::dynamicOffsetCount, QVkCommandBuffer::Command::Args::dynamicOffsetIndex, QVkCommandBuffer::Command::EndRenderPass, QVkCommandBuffer::Command::ExecuteSecondary, QVkCommandBuffer::Command::Args::executeSecondary, QVkCommandBuffer::Command::Args::filter, QVkCommandBuffer::Command::Args::firstIndex, QVkCommandBuffer::Command::Args::firstInstance, QVkCommandBuffer::Command::Args::firstVertex, QVkCommandBuffer::Command::ImageBarrier, QVkCommandBuffer::Command::Args::imageBarrier, QVkCommandBuffer::imageBarrier, QVkCommandBuffer::Command::Args::index, QVkCommandBuffer::Command::Args::indexCount, QVkCommandBuffer::Command::Args::instanceCount, it, QVkCommandBuffer::NoPass, QVkCommandBuffer::Command::Args::ofs, QVkCommandBuffer::passResTrackers, QVkCommandBuffer::Command::Args::pipeline, QVkCommandBuffer::Command::Args::pipelineLayout, QVkCommandBuffer::pools, Q_ASSERT, QVkCommandBuffer::recordingPass, recordTransitionPassResources(), QVkCommandBuffer::Command::Args::ref, QVkCommandBuffer::Command::Args::scissor, QVkCommandBuffer::Command::SetBlendConstants, QVkCommandBuffer::Command::Args::setBlendConstants, QVkCommandBuffer::Command::SetScissor, QVkCommandBuffer::Command::Args::setScissor, QVkCommandBuffer::Command::SetStencilRef, QVkCommandBuffer::Command::Args::setStencilRef, QVkCommandBuffer::Command::SetViewport, QVkCommandBuffer::Command::Args::setViewport, QVkCommandBuffer::Command::Args::src, QVkCommandBuffer::Command::Args::srcLayout, QVkCommandBuffer::Command::Args::srcStageMask, QVkCommandBuffer::Command::Args::startBinding, QVkCommandBuffer::Command::Args::trackerIndex, QVkCommandBuffer::Command::TransitionPassResources, QVkCommandBuffer::Command::Args::transitionResources, QVkCommandBuffer::Command::Args::type, QVkCommandBuffer::Command::Args::useSecondaryCb, QVkCommandBuffer::vertexBuffer, QVkCommandBuffer::Command::Args::vertexBufferIndex, QVkCommandBuffer::vertexBufferOffset, QVkCommandBuffer::Command::Args::vertexBufferOffsetIndex, QVkCommandBuffer::Command::Args::vertexCount, QVkCommandBuffer::Command::Args::vertexOffset, QVkCommandBuffer::Command::Args::viewport, QVkCommandBuffer::Command::Args::x, QVkCommandBuffer::Command::Args::y, and QVkCommandBuffer::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:

◆ recordTransitionPassResources()

void QRhiVulkan::recordTransitionPassResources ( QVkCommandBuffer cbD,
const QRhiPassResourceTracker tracker 
)

Definition at line 4269 of file qrhivulkan.cpp.

References accessIsWrite(), aspectMaskForTextureFormat(), QVkBuffer::buffers, QVkCommandBuffer::cb, QRhiPassResourceTracker::cbeginBuffers(), QRhiPassResourceTracker::cbeginTextures(), QRhiPassResourceTracker::cendBuffers(), QRhiPassResourceTracker::cendTextures(), df, QVkTexture::image, QRhiPassResourceTracker::isEmpty(), it, layout, QRhiTexture::m_format, QRHI_RES, toVkAccess(), toVkBufferUsageState(), toVkLayout(), toVkPipelineStage(), and toVkTextureUsageState().

Referenced by recordPrimaryCommandBuffer().

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

◆ recreateSwapChain()

◆ releaseCachedResources()

void QRhiVulkan::releaseCachedResources ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 4575 of file qrhivulkan.cpp.

References releaseCachedResourcesCalledBeforeFrameStart.

◆ releaseSwapChainResources()

void QRhiVulkan::releaseSwapChainResources ( QRhiSwapChain swapChain)

Definition at line 1745 of file qrhivulkan.cpp.

References QVkSwapChain::bufferCount, dev, deviceLost, df, frame, QVkSwapChain::frameRes, i, QVkSwapChain::imageRes, QVkSwapChain::msaaImageMem, QRHI_RES, QVK_FRAMES_IN_FLIGHT, QVkSwapChain::sc, and vkDestroySwapchainKHR.

Referenced by recreateSwapChain().

+ Here is the caller graph for this function:

◆ resourceLimit()

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

◆ resourceUpdate()

void QRhiVulkan::resourceUpdate ( QRhiCommandBuffer cb,
QRhiResourceUpdateBatch resourceUpdates 
)
overridevirtual

Implements QRhiImplementation.

Definition at line 2400 of file qrhivulkan.cpp.

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

+ Here is the call graph for this function:

◆ setBlendConstants()

◆ setComputePipeline()

◆ setGraphicsPipeline()

◆ setObjectName()

void QRhiVulkan::setObjectName ( uint64_t  object,
VkObjectType  type,
const QByteArray name,
int  slot = -1 
)

Definition at line 5384 of file qrhivulkan.cpp.

References caps, QByteArray::constData(), QRhiImplementation::debugMarkers, dev, QByteArray::number(), and Q_UNUSED.

+ Here is the call graph for this function:

◆ setPipelineCacheData()

void QRhiVulkan::setPipelineCacheData ( const QByteArray data)
overridevirtual

Implements QRhiImplementation.

Definition at line 4634 of file qrhivulkan.cpp.

References QString::constData(), dev, df, ensurePipelineCache(), header(), headerSize, physDevProperties, pipelineCache, QRhiImplementation::pipelineCacheRhiId(), and qCDebug.

+ Here is the call graph for this function:

◆ setScissor()

◆ setShaderResources()

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

Implements QRhiImplementation.

Definition at line 4775 of file qrhivulkan.cpp.

References QVkCommandBuffer::activeSecondaryCbStack, QVarLengthArray< T, Prealloc >::append(), QVkCommandBuffer::Command::args, QVkCommandBuffer::Command::BindDescriptorSet, QVkCommandBuffer::Command::Args::bindDescriptorSet, QVkCommandBuffer::Command::Args::bindPoint, QVkShaderResourceBindings::boundResourceData, QRhiShaderResourceBinding::BufferLoad, QRhiShaderResourceBinding::BufferLoadStore, QRhiShaderResourceBinding::BufferStore, QRhiPassResourceTracker::BufStorageLoad, QRhiPassResourceTracker::BufStorageLoadStore, QRhiPassResourceTracker::BufStorageStore, QRhiPassResourceTracker::BufUniformRead, cb, QVkCommandBuffer::Command::cmd, QVkCommandBuffer::commands, QVarLengthArray< T, Prealloc >::constData(), QVkShaderResourceBindings::BoundSampledTextureData::count, QVkCommandBuffer::currentComputePipeline, QVkCommandBuffer::currentComputeSrb, QVkCommandBuffer::currentDescSetSlot, QRhiImplementation::currentFrameSlot, QVkCommandBuffer::currentGraphicsPipeline, QVkCommandBuffer::currentGraphicsSrb, QVkCommandBuffer::currentPassResTrackerIndex, QVkCommandBuffer::currentSrbGeneration, QVkShaderResourceBindings::BoundSampledTextureData::d, QVkCommandBuffer::Command::Args::descSet, QVkShaderResourceBindings::descSets, df, QRhiBuffer::Dynamic, QVkCommandBuffer::dynamicOffset, QVkCommandBuffer::Command::Args::dynamicOffsetCount, QVkCommandBuffer::Command::Args::dynamicOffsetIndex, executeBufferHostWritesForSlot(), QVkBuffer::generation, QVkTexture::generation, QVkSampler::generation, QVkShaderResourceBindings::generation, QVkShaderResourceBindings::BoundUniformBufferData::generation, QVkShaderResourceBindings::BoundStorageImageData::generation, QVkShaderResourceBindings::BoundStorageBufferData::generation, QVkShaderResourceBindings::hasDynamicOffset, QVkShaderResourceBindings::hasSlottedResource, i, QVkShaderResourceBindings::BoundUniformBufferData::id, QVkShaderResourceBindings::BoundStorageImageData::id, QVkShaderResourceBindings::BoundStorageBufferData::id, QRhiShaderResourceBinding::ImageLoad, QRhiShaderResourceBinding::ImageLoadStore, QRhiShaderResourceBinding::ImageStore, QVarLengthArray< T, Prealloc >::last(), QVkBuffer::lastActiveFrameSlot, QVkTexture::lastActiveFrameSlot, QVkSampler::lastActiveFrameSlot, QVkShaderResourceBindings::lastActiveFrameSlot, QVkGraphicsPipeline::layout, QVkComputePipeline::layout, QRhiTexture::m_flags, QRhiResource::m_id, QRhiGraphicsPipeline::m_shaderResourceBindings, QRhiComputePipeline::m_shaderResourceBindings, QRhiBuffer::m_type, QRhiBuffer::m_usage, QVkCommandBuffer::NoPass, QVkCommandBuffer::passResTrackers, QVkCommandBuffer::passUsesSecondaryCb, QVkCommandBuffer::Command::Args::pipelineLayout, QVkCommandBuffer::pools, Q_ASSERT, QRHI_RES, QVkCommandBuffer::recordingPass, QRhiShaderResourceBinding::SampledTexture, QRhiShaderResourceBinding::Sampler, QVkSampler::sampler, QVkShaderResourceBindings::BoundSampledTextureData::samplerGeneration, QVkShaderResourceBindings::BoundSampledTextureData::samplerId, QVkShaderResourceBindings::BoundResourceData::sbuf, QRhiImplementation::shaderResourceBindingData(), QVkShaderResourceBindings::BoundResourceData::simage, QVLABaseBase::size(), QVkShaderResourceBindings::sortedBindings, QVkShaderResourceBindings::BoundResourceData::stex, QRhiBuffer::StorageBuffer, QVkShaderResourceBindings::BoundSampledTextureData::texGeneration, QVkShaderResourceBindings::BoundSampledTextureData::texId, QRhiPassResourceTracker::TexSample, QRhiPassResourceTracker::TexStorageLoad, QRhiPassResourceTracker::TexStorageLoadStore, QRhiPassResourceTracker::TexStorageStore, QRhiShaderResourceBinding::Texture, QRhiPassResourceTracker::toPassTrackerBufferStage(), QRhiPassResourceTracker::toPassTrackerTextureStage(), trackedRegisterBuffer(), trackedRegisterTexture(), QVkShaderResourceBindings::BoundResourceData::ubuf, QRhiShaderResourceBinding::UniformBuffer, QRhiBuffer::UniformBuffer, updateShaderResourceBindings(), and QRhiTexture::UsedWithLoadStore.

+ Here is the call graph for this function:

◆ setStencilRef()

◆ setVertexInput()

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

Implements QRhiImplementation.

Definition at line 4995 of file qrhivulkan.cpp.

References QVkCommandBuffer::activeSecondaryCbStack, QVarLengthArray< T, Prealloc >::append(), QVkCommandBuffer::Command::args, QVkCommandBuffer::Command::BindIndexBuffer, QVkCommandBuffer::Command::Args::bindIndexBuffer, QVkCommandBuffer::Command::BindVertexBuffer, QVkCommandBuffer::Command::Args::bindVertexBuffer, QVkCommandBuffer::Command::Args::buf, QVkBuffer::buffers, QRhiPassResourceTracker::BufIndexRead, QRhiPassResourceTracker::BufVertexInput, QRhiPassResourceTracker::BufVertexInputStage, cb, QVkCommandBuffer::Command::cmd, QVkCommandBuffer::commands, QVarLengthArray< T, Prealloc >::constData(), QVkCommandBuffer::Command::Args::count, QRhiImplementation::currentFrameSlot, QVkCommandBuffer::currentIndexBuffer, QVkCommandBuffer::currentIndexFormat, QVkCommandBuffer::currentIndexOffset, QVkCommandBuffer::currentPassResTrackerIndex, QVkCommandBuffer::currentVertexBuffers, QVkCommandBuffer::currentVertexOffsets, df, QRhiBuffer::Dynamic, executeBufferHostWritesForSlot(), i, QRhiBuffer::IndexBuffer, QRhiCommandBuffer::IndexUInt16, QVarLengthArray< T, Prealloc >::last(), QVkBuffer::lastActiveFrameSlot, QRhiBuffer::m_type, QRhiBuffer::m_usage, QVkCommandBuffer::Command::Args::ofs, QVkCommandBuffer::passResTrackers, QVkCommandBuffer::passUsesSecondaryCb, QVkCommandBuffer::pools, Q_ASSERT, QRHI_RES, QVkCommandBuffer::recordingPass, QVkCommandBuffer::RenderPass, QVLABaseBase::size(), QVkCommandBuffer::Command::Args::startBinding, trackedRegisterBuffer(), QVkCommandBuffer::Command::Args::type, QRhiBuffer::VertexBuffer, QVkCommandBuffer::vertexBuffer, QVkCommandBuffer::Command::Args::vertexBufferIndex, QVkCommandBuffer::vertexBufferOffset, and QVkCommandBuffer::Command::Args::vertexBufferOffsetIndex.

+ Here is the call graph for this function:

◆ setViewport()

◆ startPrimaryCommandBuffer()

QRhi::FrameOpResult QRhiVulkan::startPrimaryCommandBuffer ( VkCommandBuffer *  cb)

Definition at line 2085 of file qrhivulkan.cpp.

References cb, cmdPool, QRhiImplementation::currentFrameSlot, dev, deviceLost, df, QRhi::FrameOpDeviceLost, QRhi::FrameOpError, QRhi::FrameOpSuccess, and qWarning.

Referenced by beginFrame(), beginOffscreenFrame(), and finish().

+ Here is the caller graph for this function:

◆ startSecondaryCommandBuffer()

VkCommandBuffer QRhiVulkan::startSecondaryCommandBuffer ( QVkRenderTargetData rtD = nullptr)

Definition at line 2408 of file qrhivulkan.cpp.

References cmdPool, QRhiImplementation::currentFrameSlot, dev, df, QVkRenderTargetData::fb, freeSecondaryCbs, QVarLengthArray< T, Prealloc >::last(), qWarning, QVarLengthArray< T, Prealloc >::removeLast(), QVkRenderPassDescriptor::rp, and QVkRenderTargetData::rp.

Referenced by beginComputePass(), beginExternal(), beginPass(), and endExternal().

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

◆ statistics()

QRhiStats QRhiVulkan::statistics ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 4549 of file qrhivulkan.cpp.

References allocator, i, statistics(), QRhiImplementation::totalPipelineCreationTime(), and toVmaAllocator().

Referenced by statistics().

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

◆ subresourceBarrier()

void QRhiVulkan::subresourceBarrier ( QVkCommandBuffer cbD,
VkImage  image,
VkImageLayout  oldLayout,
VkImageLayout  newLayout,
VkAccessFlags  srcAccess,
VkAccessFlags  dstAccess,
VkPipelineStageFlags  srcStage,
VkPipelineStageFlags  dstStage,
int  startLayer,
int  layerCount,
int  startLevel,
int  levelCount 
)

Definition at line 3106 of file qrhivulkan.cpp.

References QVarLengthArray< T, Prealloc >::append(), QVkCommandBuffer::Command::args, QVkCommandBuffer::Command::cmd, QVkCommandBuffer::commands, QVkCommandBuffer::Command::Args::count, QVkCommandBuffer::Command::Args::dstStageMask, QVkCommandBuffer::Command::ImageBarrier, QVkCommandBuffer::Command::Args::imageBarrier, QVkCommandBuffer::imageBarrier, QVkCommandBuffer::Command::Args::index, QVkCommandBuffer::NoPass, QVkCommandBuffer::pools, Q_ASSERT, QVkCommandBuffer::recordingPass, QVLABaseBase::size(), and QVkCommandBuffer::Command::Args::srcStageMask.

Referenced by enqueueResourceUpdates().

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

◆ subresUploadByteSize()

VkDeviceSize QRhiVulkan::subresUploadByteSize ( const QRhiTextureSubresourceUploadDescription subresDesc) const

Definition at line 3136 of file qrhivulkan.cpp.

References aligned(), QRhiTextureSubresourceUploadDescription::data(), QRhiTextureSubresourceUploadDescription::image(), QImage::isNull(), QByteArray::size(), QImage::sizeInBytes(), and texbufAlign.

Referenced by enqueueResourceUpdates().

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

◆ supportedSampleCounts()

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

Implements QRhiImplementation.

Definition at line 3920 of file qrhivulkan.cpp.

References physDevProperties, and qvk_sampleCounts.

Referenced by effectiveSampleCount().

+ Here is the caller graph for this function:

◆ trackedBufferBarrier()

void QRhiVulkan::trackedBufferBarrier ( QVkCommandBuffer cbD,
QVkBuffer bufD,
int  slot,
VkAccessFlags  access,
VkPipelineStageFlags  stage 
)

◆ trackedImageBarrier()

void QRhiVulkan::trackedImageBarrier ( QVkCommandBuffer cbD,
QVkTexture texD,
VkImageLayout  layout,
VkAccessFlags  access,
VkPipelineStageFlags  stage 
)

◆ trackedRegisterBuffer()

void QRhiVulkan::trackedRegisterBuffer ( QRhiPassResourceTracker passResTracker,
QVkBuffer bufD,
int  slot,
QRhiPassResourceTracker::BufferAccess  access,
QRhiPassResourceTracker::BufferStage  stage 
)

Definition at line 4232 of file qrhivulkan.cpp.

References QVkBuffer::UsageState::access, accessIsWrite(), QRhiPassResourceTracker::registerBuffer(), QVkBuffer::UsageState::stage, toPassTrackerUsageState(), toVkAccess(), toVkPipelineStage(), and QVkBuffer::usageState.

Referenced by setShaderResources(), and setVertexInput().

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

◆ trackedRegisterTexture()

void QRhiVulkan::trackedRegisterTexture ( QRhiPassResourceTracker passResTracker,
QVkTexture texD,
QRhiPassResourceTracker::TextureAccess  access,
QRhiPassResourceTracker::TextureStage  stage 
)

Definition at line 4250 of file qrhivulkan.cpp.

References QVkTexture::UsageState::access, accessIsWrite(), QVkTexture::UsageState::layout, QRhiPassResourceTracker::registerTexture(), QVkTexture::UsageState::stage, toPassTrackerUsageState(), toVkAccess(), toVkLayout(), toVkPipelineStage(), and QVkTexture::usageState.

Referenced by activateTextureRenderTarget(), and setShaderResources().

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

◆ ubufAlignment()

int QRhiVulkan::ubufAlignment ( ) const
overridevirtual

Implements QRhiImplementation.

Definition at line 4350 of file qrhivulkan.cpp.

References ubufAlign.

◆ updateShaderResourceBindings()

void QRhiVulkan::updateShaderResourceBindings ( QRhiShaderResourceBindings srb,
int  descSetIdx = -1 
)

Definition at line 2823 of file qrhivulkan.cpp.

References aligned(), QVarLengthArray< T, Prealloc >::append(), QVarLengthArray< T, Prealloc >::at(), QVkShaderResourceBindings::boundResourceData, QRhiShaderResourceBinding::BufferLoad, QRhiShaderResourceBinding::BufferLoadStore, QVkBuffer::buffers, QRhiShaderResourceBinding::BufferStore, QVarLengthArray< T, Prealloc >::constData(), QRhiShaderResourceBinding::Data::TextureAndOrSamplerData::count, QVkShaderResourceBindings::BoundSampledTextureData::count, QVkShaderResourceBindings::BoundSampledTextureData::d, QVkShaderResourceBindings::descSets, dev, df, QRhiBuffer::Dynamic, QVarLengthArray< T, Prealloc >::first(), QVkBuffer::generation, QVkTexture::generation, QVkSampler::generation, QVkShaderResourceBindings::BoundUniformBufferData::generation, QVkShaderResourceBindings::BoundStorageImageData::generation, QVkShaderResourceBindings::BoundStorageBufferData::generation, i, QVkShaderResourceBindings::BoundUniformBufferData::id, QVkShaderResourceBindings::BoundStorageImageData::id, QVkShaderResourceBindings::BoundStorageBufferData::id, QRhiShaderResourceBinding::ImageLoad, QRhiShaderResourceBinding::ImageLoadStore, QRhiShaderResourceBinding::ImageStore, QVkTexture::imageView, QVkTexture::imageViewForLevel(), QRhiResource::m_id, QRhiBuffer::m_size, QRhiBuffer::m_type, Q_ASSERT, QRHI_RES, QVK_FRAMES_IN_FLIGHT, QRhiShaderResourceBinding::SampledTexture, QRhiShaderResourceBinding::Sampler, QVkSampler::sampler, QVkShaderResourceBindings::BoundSampledTextureData::samplerGeneration, QVkShaderResourceBindings::BoundSampledTextureData::samplerId, QVkShaderResourceBindings::BoundResourceData::sbuf, QRhiImplementation::shaderResourceBindingData(), QVkShaderResourceBindings::BoundResourceData::simage, QVLABaseBase::size(), QVkShaderResourceBindings::sortedBindings, QVkShaderResourceBindings::BoundResourceData::stex, QVkShaderResourceBindings::BoundSampledTextureData::texGeneration, QVkShaderResourceBindings::BoundSampledTextureData::texId, QRhiShaderResourceBinding::Texture, QVkShaderResourceBindings::BoundResourceData::ubuf, ubufAlign, QRhiShaderResourceBinding::UniformBuffer, and view.

Referenced by setShaderResources().

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

◆ waitCommandCompletion()

void QRhiVulkan::waitCommandCompletion ( int  frameSlot)

Definition at line 2166 of file qrhivulkan.cpp.

References dev, df, frame, and swapchains.

Referenced by beginFrame(), and beginOffscreenFrame().

+ Here is the caller graph for this function:

Member Data Documentation

◆ activeBufferReadbacks

QVarLengthArray<BufferReadback, 2> QRhiVulkan::activeBufferReadbacks

Definition at line 940 of file qrhivulkan_p.h.

Referenced by enqueueResourceUpdates(), and finishActiveReadbacks().

◆ activeTextureReadbacks

QVarLengthArray<TextureReadback, 2> QRhiVulkan::activeTextureReadbacks

Definition at line 932 of file qrhivulkan_p.h.

Referenced by enqueueResourceUpdates(), and finishActiveReadbacks().

◆ allocator

◆ apiVersion

QVersionNumber QRhiVulkan::apiVersion

Definition at line 878 of file qrhivulkan_p.h.

◆ [struct]

◆ clipCorrectMatrix

QMatrix4x4 QRhiVulkan::clipCorrectMatrix

Definition at line 898 of file qrhivulkan_p.h.

◆ cmdPool

VkCommandPool QRhiVulkan::cmdPool[QVK_FRAMES_IN_FLIGHT] = {}

◆ compute

bool QRhiVulkan::compute = false

Definition at line 869 of file qrhivulkan_p.h.

◆ currentSwapChain

QVkSwapChain* QRhiVulkan::currentSwapChain = nullptr

Definition at line 900 of file qrhivulkan_p.h.

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

◆ debugUtils

bool QRhiVulkan::debugUtils = false

Definition at line 871 of file qrhivulkan_p.h.

◆ descriptorPools

QVarLengthArray<DescriptorPoolData, 8> QRhiVulkan::descriptorPools

Definition at line 891 of file qrhivulkan_p.h.

Referenced by allocateDescriptorSet(), destroy(), and executeDeferredReleases().

◆ dev

◆ deviceLost

◆ df

◆ driverInfoStruct

QRhiDriverInfo QRhiVulkan::driverInfoStruct

Definition at line 903 of file qrhivulkan_p.h.

Referenced by create(), and driverInfo().

◆ f

QVulkanFunctions* QRhiVulkan::f = nullptr

Definition at line 835 of file qrhivulkan_p.h.

Referenced by finishActiveReadbacks().

◆ freeSecondaryCbs

QVarLengthArray<VkCommandBuffer, 4> QRhiVulkan::freeSecondaryCbs[QVK_FRAMES_IN_FLIGHT]

Definition at line 892 of file qrhivulkan_p.h.

Referenced by destroy(), executeDeferredReleases(), and startSecondaryCommandBuffer().

◆ geometryShader

bool QRhiVulkan::geometryShader = false

Definition at line 875 of file qrhivulkan_p.h.

◆ gfxQueue

VkQueue QRhiVulkan::gfxQueue = VK_NULL_HANDLE

Definition at line 831 of file qrhivulkan_p.h.

Referenced by endAndSubmitPrimaryCommandBuffer(), endFrame(), and finish().

◆ gfxQueueFamilyIdx

quint32 QRhiVulkan::gfxQueueFamilyIdx = 0

Definition at line 829 of file qrhivulkan_p.h.

Referenced by QRhiVulkan(), and create().

◆ gfxQueueIdx

quint32 QRhiVulkan::gfxQueueIdx = 0

Definition at line 830 of file qrhivulkan_p.h.

Referenced by QRhiVulkan().

◆ importedAllocator

bool QRhiVulkan::importedAllocator = false

Definition at line 833 of file qrhivulkan_p.h.

Referenced by QRhiVulkan(), and destroy().

◆ importedDevice

bool QRhiVulkan::importedDevice = false

Definition at line 825 of file qrhivulkan_p.h.

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

◆ inst

QVulkanInstance* QRhiVulkan::inst = nullptr

Definition at line 822 of file qrhivulkan_p.h.

Referenced by QRhiVulkan(), beginFrame(), create(), destroy(), and endFrame().

◆ maybeWindow

QWindow* QRhiVulkan::maybeWindow = nullptr

Definition at line 823 of file qrhivulkan_p.h.

Referenced by QRhiVulkan(), and create().

◆ multiView

bool QRhiVulkan::multiView = false

Definition at line 877 of file qrhivulkan_p.h.

◆ nativeHandlesStruct

QRhiVulkanNativeHandles QRhiVulkan::nativeHandlesStruct

Definition at line 902 of file qrhivulkan_p.h.

Referenced by nativeHandles().

◆ nonFillPolygonMode

bool QRhiVulkan::nonFillPolygonMode = false

Definition at line 876 of file qrhivulkan_p.h.

◆ ofr

◆ optimalDsFormat

VkFormat QRhiVulkan::optimalDsFormat = VK_FORMAT_UNDEFINED

Definition at line 897 of file qrhivulkan_p.h.

Referenced by optimalDepthStencilFormat().

◆ physDev

VkPhysicalDevice QRhiVulkan::physDev = VK_NULL_HANDLE

◆ physDevFeatures

VkPhysicalDeviceFeatures QRhiVulkan::physDevFeatures

Definition at line 838 of file qrhivulkan_p.h.

Referenced by create(), and isTextureFormatSupported().

◆ physDevProperties

VkPhysicalDeviceProperties QRhiVulkan::physDevProperties

◆ pipelineCache

VkPipelineCache QRhiVulkan::pipelineCache = VK_NULL_HANDLE

◆ releaseCachedResourcesCalledBeforeFrameStart

bool QRhiVulkan::releaseCachedResourcesCalledBeforeFrameStart = false

◆ releaseQueue

◆ requestedDeviceExtensions

QByteArrayList QRhiVulkan::requestedDeviceExtensions

Definition at line 824 of file qrhivulkan_p.h.

Referenced by QRhiVulkan(), and create().

◆ rhiFlags

QRhi::Flags QRhiVulkan::rhiFlags

Definition at line 837 of file qrhivulkan_p.h.

Referenced by beginFrame(), beginOffscreenFrame(), create(), and pipelineCacheData().

◆ swapchains

QSet<QVkSwapChain *> QRhiVulkan::swapchains

Definition at line 901 of file qrhivulkan_p.h.

Referenced by waitCommandCompletion().

◆ tessellation

bool QRhiVulkan::tessellation = false

Definition at line 874 of file qrhivulkan_p.h.

◆ texbufAlign

VkDeviceSize QRhiVulkan::texbufAlign

Definition at line 848 of file qrhivulkan_p.h.

Referenced by prepareUploadSubres(), and subresUploadByteSize().

◆ texture3DSliceAs2D

bool QRhiVulkan::texture3DSliceAs2D = false

Definition at line 873 of file qrhivulkan_p.h.

◆ timestampQueryPool

VkQueryPool QRhiVulkan::timestampQueryPool = VK_NULL_HANDLE

Definition at line 894 of file qrhivulkan_p.h.

Referenced by beginFrame(), beginOffscreenFrame(), destroy(), endFrame(), and endOffscreenFrame().

◆ timestampQueryPoolMap

QBitArray QRhiVulkan::timestampQueryPoolMap

Definition at line 895 of file qrhivulkan_p.h.

Referenced by beginFrame(), beginOffscreenFrame(), and endOffscreenFrame().

◆ timestampValidBits

quint32 QRhiVulkan::timestampValidBits = 0

Definition at line 832 of file qrhivulkan_p.h.

Referenced by elapsedSecondsFromTimestamp(), and isFeatureSupported().

◆ ubufAlign

VkDeviceSize QRhiVulkan::ubufAlign

Definition at line 847 of file qrhivulkan_p.h.

Referenced by ubufAlignment(), and updateShaderResourceBindings().

◆ vertexAttribDivisor

bool QRhiVulkan::vertexAttribDivisor = false

Definition at line 872 of file qrhivulkan_p.h.

◆ vkAcquireNextImageKHR

PFN_vkAcquireNextImageKHR QRhiVulkan::vkAcquireNextImageKHR

Definition at line 862 of file qrhivulkan_p.h.

Referenced by beginFrame(), and recreateSwapChain().

◆ vkCreateSwapchainKHR

PFN_vkCreateSwapchainKHR QRhiVulkan::vkCreateSwapchainKHR = nullptr

Definition at line 859 of file qrhivulkan_p.h.

Referenced by recreateSwapChain().

◆ vkDestroySwapchainKHR

PFN_vkDestroySwapchainKHR QRhiVulkan::vkDestroySwapchainKHR

Definition at line 860 of file qrhivulkan_p.h.

Referenced by recreateSwapChain(), and releaseSwapChainResources().

◆ vkGetPhysicalDeviceSurfaceCapabilitiesKHR

PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR QRhiVulkan::vkGetPhysicalDeviceSurfaceCapabilitiesKHR

Definition at line 864 of file qrhivulkan_p.h.

Referenced by createSwapChain(), and recreateSwapChain().

◆ vkGetPhysicalDeviceSurfaceFormatsKHR

PFN_vkGetPhysicalDeviceSurfaceFormatsKHR QRhiVulkan::vkGetPhysicalDeviceSurfaceFormatsKHR

Definition at line 865 of file qrhivulkan_p.h.

Referenced by createSwapChain().

◆ vkGetPhysicalDeviceSurfacePresentModesKHR

PFN_vkGetPhysicalDeviceSurfacePresentModesKHR QRhiVulkan::vkGetPhysicalDeviceSurfacePresentModesKHR

Definition at line 866 of file qrhivulkan_p.h.

Referenced by createSwapChain().

◆ vkGetSwapchainImagesKHR

PFN_vkGetSwapchainImagesKHR QRhiVulkan::vkGetSwapchainImagesKHR

Definition at line 861 of file qrhivulkan_p.h.

Referenced by recreateSwapChain().

◆ vkQueuePresentKHR

PFN_vkQueuePresentKHR QRhiVulkan::vkQueuePresentKHR

Definition at line 863 of file qrhivulkan_p.h.

Referenced by endFrame(), and recreateSwapChain().

◆ wideLines

bool QRhiVulkan::wideLines = false

Definition at line 870 of file qrhivulkan_p.h.


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