Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
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 effectiveSampleCountBits (int sampleCount)
 
bool createDefaultRenderPass (QVkRenderPassDescriptor *rpD, bool hasDepthStencil, VkSampleCountFlagBits samples, VkFormat colorFormat)
 
bool createOffscreenRenderPass (QVkRenderPassDescriptor *rpD, const QRhiColorAttachment *colorAttachmentsBegin, const QRhiColorAttachment *colorAttachmentsEnd, bool preserveColor, bool preserveDs, bool storeDs, QRhiRenderBuffer *depthStencilBuffer, QRhiTexture *depthTexture, QRhiTexture *depthResolveTexture)
 
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)
 
void printExtraErrorInfo (VkResult err)
 
- Public Member Functions inherited from QRhiImplementation
virtual ~QRhiImplementation ()
 
void prepareForCreate (QRhi *rhi, QRhi::Implementation impl, QRhi::Flags flags)
 
bool isCompressedFormat (QRhiTexture::Format format) const
 
void compressedFormatInfo (QRhiTexture::Format format, const QSize &size, quint32 *bpl, quint32 *byteSize, QSize *blockDim) const
 
void textureFormatInfo (QRhiTexture::Format format, const QSize &size, quint32 *bpl, quint32 *byteSize, quint32 *bytesPerPixel) const
 
bool isStencilSupportingFormat (QRhiTexture::Format format) const
 
void registerResource (QRhiResource *res, bool ownsNativeResources=true)
 
void unregisterResource (QRhiResource *res)
 
void addDeleteLater (QRhiResource *res)
 
void addCleanupCallback (const QRhi::CleanupCallback &callback)
 
void addCleanupCallback (const void *key, const QRhi::CleanupCallback &callback)
 
void removeCleanupCallback (const void *key)
 
bool sanityCheckGraphicsPipeline (QRhiGraphicsPipeline *ps)
 
bool sanityCheckShaderResourceBindings (QRhiShaderResourceBindings *srb)
 
void updateLayoutDesc (QRhiShaderResourceBindings *srb)
 
quint32 pipelineCacheRhiId () const
 
void pipelineCreationStart ()
 
void pipelineCreationEnd ()
 
qint64 totalPipelineCreationTime () const
 
QRhiVertexInputAttribute::Format shaderDescVariableFormatToVertexInputFormat (QShaderDescription::VariableType type) const
 
quint32 byteSizePerVertexForVertexInputFormat (QRhiVertexInputAttribute::Format format) const
 
int effectiveSampleCount (int sampleCount) const
 

Public Attributes

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 
 
   bool   renderPass2KHR = false 
 
   bool   depthStencilResolveKHR = 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 647 of file qrhivulkan_p.h.

Member Typedef Documentation

◆ BufferImageCopyList

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

Definition at line 795 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 )

Definition at line 2656 of file qrhivulkan.cpp.

References QRhiImplementation::currentFrameSlot, QVkCommandBuffer::currentPassResTrackerIndex, QRhiRenderBuffer::DepthStencil, depthStencilExplicitBarrier(), it, QVkCommandBuffer::passResTrackers, Q_ASSERT, QRHI_RES, QRhiPassResourceTracker::TexColorOutput, QRhiPassResourceTracker::TexColorOutputStage, QRhiPassResourceTracker::TexDepthOutput, QRhiPassResourceTracker::TexDepthOutputStage, and trackedRegisterTexture().

Referenced by beginPass().

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

◆ allocateDescriptorSet()

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

Definition at line 990 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()

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

◆ beginPass()

◆ chooseTransientImageMemType()

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

Definition at line 1184 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 4694 of file qrhivulkan.cpp.

◆ create()

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

◆ createBuffer()

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

Implements QRhiImplementation.

Definition at line 4669 of file qrhivulkan.cpp.

◆ createComputePipeline()

QRhiComputePipeline * QRhiVulkan::createComputePipeline ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 5069 of file qrhivulkan.cpp.

◆ createDefaultRenderPass()

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

Definition at line 1352 of file qrhivulkan.cpp.

References dev, df, fillRenderPassCreateInfo(), optimalDepthStencilFormat(), and qWarning.

+ Here is the call graph for this function:

◆ createDescriptorPool()

VkResult QRhiVulkan::createDescriptorPool ( VkDescriptorPool * pool)

Definition at line 969 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 5064 of file qrhivulkan.cpp.

◆ createOffscreenRenderPass()

bool QRhiVulkan::createOffscreenRenderPass ( QVkRenderPassDescriptor * rpD,
const QRhiColorAttachment * colorAttachmentsBegin,
const QRhiColorAttachment * colorAttachmentsEnd,
bool preserveColor,
bool preserveDs,
bool storeDs,
QRhiRenderBuffer * depthStencilBuffer,
QRhiTexture * depthTexture,
QRhiTexture * depthResolveTexture )

Definition at line 1600 of file qrhivulkan.cpp.

References QRhiTexture::arraySize(), caps, dev, df, fillRenderPassCreateInfo(), it, Q_ASSERT, QRHI_RES, and qWarning.

+ Here is the call graph for this function:

◆ createRenderBuffer()

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

Implements QRhiImplementation.

Definition at line 5037 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 5051 of file qrhivulkan.cpp.

◆ createShader()

VkShaderModule QRhiVulkan::createShader ( const QByteArray & spirv)

Definition at line 3109 of file qrhivulkan.cpp.

References dev, df, and qWarning.

◆ createShaderResourceBindings()

QRhiShaderResourceBindings * QRhiVulkan::createShaderResourceBindings ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 5074 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 5044 of file qrhivulkan.cpp.

◆ createTextureRenderTarget()

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

Implements QRhiImplementation.

Definition at line 5058 of file qrhivulkan.cpp.

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

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

◆ debugMarkEnd()

void QRhiVulkan::debugMarkEnd ( QRhiCommandBuffer * cb)
overridevirtual

◆ debugMarkMsg()

◆ depthStencilExplicitBarrier()

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

Definition at line 3394 of file qrhivulkan.cpp.

References QVkCommandBuffer::Command::args, QVkCommandBuffer::Command::cmd, QVkCommandBuffer::commands, QVkCommandBuffer::Command::ImageBarrier, QVkCommandBuffer::NoPass, QVkCommandBuffer::pools, Q_ASSERT, and QVkCommandBuffer::recordingPass.

Referenced by activateTextureRenderTarget().

+ Here is the caller graph for this function:

◆ destroy()

void QRhiVulkan::destroy ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 914 of file qrhivulkan.cpp.

References allocator, QVarLengthArray< T, Prealloc >::clear(), cmdPool, descriptorPools, dev, deviceLost, df, executeDeferredReleases(), finishActiveReadbacks(), freeSecondaryCbs, i, importedAllocator, importedDevice, inst, ofr, pipelineCache, pool, QVK_FRAMES_IN_FLIGHT, timestampQueryPool, and toVmaAllocator().

+ Here is the call graph for this function:

◆ dispatch()

◆ draw()

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

◆ drawIndexed()

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

◆ driverInfo()

QRhiDriverInfo QRhiVulkan::driverInfo ( ) const
overridevirtual

Implements QRhiImplementation.

Definition at line 4872 of file qrhivulkan.cpp.

References driverInfoStruct.

◆ effectiveSampleCountBits()

VkSampleCountFlagBits QRhiVulkan::effectiveSampleCountBits ( int sampleCount)

Definition at line 4270 of file qrhivulkan.cpp.

References QRhiImplementation::effectiveSampleCount(), and qvk_sampleCounts.

+ Here is the call graph for this function:

◆ elapsedSecondsFromTimestamp()

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

Definition at line 2126 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()

◆ endAndSubmitPrimaryCommandBuffer()

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

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

Implements QRhiImplementation.

Definition at line 2261 of file qrhivulkan.cpp.

References currentSwapChain, deviceLost, df, endAndSubmitPrimaryCommandBuffer(), endFrame(), frame, QRhi::FrameOpDeviceLost, QRhi::FrameOpError, QRhi::FrameOpSuccess, QRhi::FrameOpSwapChainOutOfDate, gfxQueue, inst, Q_ASSERT, QRHI_RES, qScopeGuard(), QVK_FRAMES_IN_FLIGHT, qWarning, recordPrimaryCommandBuffer(), QVkSwapChain::ImageResources::ScImageUseNone, QVkSwapChain::ImageResources::ScImageUseRender, QVkSwapChain::ImageResources::ScImageUseTransferSource, QRhi::SkipPresent, timestampQueryPool, and vkQueuePresentKHR.

Referenced by endFrame().

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

◆ endOffscreenFrame()

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

◆ endPass()

◆ enqueueResourceUpdates()

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

Definition at line 3578 of file qrhivulkan.cpp.

References activeBufferReadbacks, QRhiVulkan::TextureReadback::activeFrameSlot, QRhiVulkan::BufferReadback::activeFrameSlot, activeTextureReadbacks, allocation, allocator, QVkCommandBuffer::Command::args, QVkCommandBuffer::Command::BlitImage, QRhiResourceUpdateBatchPrivate::BufferOp::buf, QVkCommandBuffer::Command::cmd, QVkCommandBuffer::commands, QRhiReadbackResult::completed, QRhiBufferData::constData(), QRhiResourceUpdateBatchPrivate::TextureOp::Copy, QVkCommandBuffer::Command::CopyBuffer, QVkCommandBuffer::Command::CopyBufferToImage, QVkCommandBuffer::Command::CopyImage, QVkCommandBuffer::Command::CopyImageToBuffer, QRhiTexture::CubeMap, QRhiImplementation::currentFrameSlot, currentSwapChain, QByteArray::data(), QRhiReadbackResult::data, QRhiResourceUpdateBatchPrivate::BufferOp::data, QRhiResourceUpdateBatchPrivate::TextureOp::desc, QRhiTextureCopyDescription::destinationLayer(), QRhiTextureCopyDescription::destinationLevel(), QRhiTextureCopyDescription::destinationTopLeft(), QRhiResourceUpdateBatchPrivate::TextureOp::dst, QRhiBuffer::Dynamic, QRhiResourceUpdateBatchPrivate::BufferOp::DynamicUpdate, executeBufferHostWritesForSlot(), QRhiResourceUpdateBatchPrivate::TextureOp::GenMips, QRhiResourceUpdateBatchPrivate::get(), i, QVkSwapChain::ImageResources::image, QRhiBuffer::Immutable, QSize::isEmpty(), QRhiVulkan::DeferredReleaseEntry::lastActiveFrameSlot, QVkSwapChain::ImageResources::lastUse, QRhiReadbackDescription::layer(), QRhiReadbackDescription::level(), QRhi::MAX_MIP_LEVELS, QRhiResourceUpdateBatchPrivate::BufferOp::offset, QRhiTextureCopyDescription::pixelSize(), QVkCommandBuffer::pools, prepareUploadSubres(), printExtraErrorInfo(), 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, QVkSwapChain::ImageResources::ScImageUseRender, QVkSwapChain::ImageResources::ScImageUseTransferSource, QRhiBufferData::size(), QVLABaseBase::size(), QRhiTextureCopyDescription::sourceLayer(), QRhiTextureCopyDescription::sourceLevel(), QRhiTextureCopyDescription::sourceTopLeft(), QRhiResourceUpdateBatchPrivate::TextureOp::src, QRhiVulkan::DeferredReleaseEntry::StagingBuffer, QRhiVulkan::DeferredReleaseEntry::stagingBuffer, QRhiResourceUpdateBatchPrivate::BufferOp::StaticUpload, QRhiResourceUpdateBatchPrivate::TextureOp::subresDesc, subresourceBarrier(), subresUploadByteSize(), swapchainReadbackTextureFormat(), QRhiReadbackDescription::texture(), QRhiTexture::TextureArray, QRhiImplementation::textureFormatInfo(), QRhiTexture::ThreeDimensional, toVmaAllocation(), toVmaAllocator(), trackedBufferBarrier(), trackedImageBarrier(), QRhiResourceUpdateBatchPrivate::BufferOp::type, QRhiResourceUpdateBatchPrivate::TextureOp::type, QRhiVulkan::DeferredReleaseEntry::type, QRhiTexture::UnknownFormat, QRhiResourceUpdateBatchPrivate::TextureOp::Upload, QRhiTexture::UsedWithGenerateMips, 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 4282 of file qrhivulkan.cpp.

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

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 2112 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 3124 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 4060 of file qrhivulkan.cpp.

References allocator, QRhiBuffer::Dynamic, 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()

void QRhiVulkan::executeDeferredReleases ( bool forced = false)

Definition at line 4124 of file qrhivulkan.cpp.

References allocator, QVarLengthArray< T, Prealloc >::append(), QRhiVulkan::DeferredReleaseEntry::Buffer, QRhiImplementation::currentFrameSlot, descriptorPools, dev, df, freeSecondaryCbs, i, QRhiVulkan::DeferredReleaseEntry::lastActiveFrameSlot, QVkRenderTargetData::MAX_COLOR_ATTACHMENTS, QRhiVulkan::DeferredReleaseEntry::Pipeline, QRhiVulkan::DeferredReleaseEntry::pipelineState, Q_ASSERT, qrhivk_releaseBuffer(), qrhivk_releaseRenderBuffer(), qrhivk_releaseSampler(), qrhivk_releaseTexture(), releaseQueue, QRhiVulkan::DeferredReleaseEntry::RenderBuffer, QRhiVulkan::DeferredReleaseEntry::RenderPass, QRhiVulkan::DeferredReleaseEntry::renderPass, QRhiVulkan::DeferredReleaseEntry::Sampler, QRhiVulkan::DeferredReleaseEntry::SecondaryCommandBuffer, QRhiVulkan::DeferredReleaseEntry::secondaryCommandBuffer, QRhiVulkan::DeferredReleaseEntry::ShaderResourceBindings, QRhiVulkan::DeferredReleaseEntry::shaderResourceBindings, QRhiVulkan::DeferredReleaseEntry::StagingBuffer, QRhiVulkan::DeferredReleaseEntry::stagingBuffer, QRhiVulkan::DeferredReleaseEntry::Texture, QRhiVulkan::DeferredReleaseEntry::TextureRenderTarget, QRhiVulkan::DeferredReleaseEntry::textureRenderTarget, toVmaAllocation(), toVmaAllocator(), and QRhiVulkan::DeferredReleaseEntry::type.

Referenced by destroy(), finish(), and prepareNewFrame().

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

◆ finish()

◆ finishActiveReadbacks()

void QRhiVulkan::finishActiveReadbacks ( bool forced = false)

Definition at line 4180 of file qrhivulkan.cpp.

References activeBufferReadbacks, activeTextureReadbacks, allocator, QRhiImplementation::currentFrameSlot, f, i, qWarning, toVmaAllocation(), toVmaAllocator(), and void.

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

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

◆ isClipDepthZeroToOne()

bool QRhiVulkan::isClipDepthZeroToOne ( ) const
overridevirtual

Implements QRhiImplementation.

Definition at line 4689 of file qrhivulkan.cpp.

◆ isDeviceLost()

bool QRhiVulkan::isDeviceLost ( ) const
overridevirtual

Implements QRhiImplementation.

Definition at line 4908 of file qrhivulkan.cpp.

References deviceLost.

◆ isFeatureSupported()

◆ isTextureFormatSupported()

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

Implements QRhiImplementation.

Definition at line 4709 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 4679 of file qrhivulkan.cpp.

◆ isYUpInNDC()

bool QRhiVulkan::isYUpInNDC ( ) const
overridevirtual

Implements QRhiImplementation.

Definition at line 4684 of file qrhivulkan.cpp.

◆ lastCompletedGpuTime()

double QRhiVulkan::lastCompletedGpuTime ( QRhiCommandBuffer * cb)
overridevirtual

Implements QRhiImplementation.

Definition at line 5707 of file qrhivulkan.cpp.

References cb, QVkCommandBuffer::lastGpuTime, and QRHI_RES.

◆ makeThreadLocalNativeContextCurrent()

bool QRhiVulkan::makeThreadLocalNativeContextCurrent ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 4897 of file qrhivulkan.cpp.

◆ nativeHandles() [1/2]

const QRhiNativeHandles * QRhiVulkan::nativeHandles ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 4867 of file qrhivulkan.cpp.

References nativeHandlesStruct.

◆ nativeHandles() [2/2]

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

Implements QRhiImplementation.

Definition at line 5629 of file qrhivulkan.cpp.

References cb, and QRHI_RES.

◆ optimalDepthStencilFormat()

VkFormat QRhiVulkan::optimalDepthStencilFormat ( )

Definition at line 1305 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 4925 of file qrhivulkan.cpp.

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

+ Here is the call graph for this function:

◆ prepareNewFrame()

void QRhiVulkan::prepareNewFrame ( QRhiCommandBuffer * cb)

Definition at line 2368 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()

void QRhiVulkan::prepareUploadSubres ( QVkTexture * texD,
int layer,
int level,
const QRhiTextureSubresourceUploadDescription & subresDesc,
size_t * curOfs,
void * mp,
BufferImageCopyList * copyInfos )

◆ printExtraErrorInfo()

void QRhiVulkan::printExtraErrorInfo ( VkResult err)

Definition at line 3572 of file qrhivulkan.cpp.

References qWarning, and statistics().

Referenced by enqueueResourceUpdates().

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

◆ recordPrimaryCommandBuffer()

void QRhiVulkan::recordPrimaryCommandBuffer ( QVkCommandBuffer * cbD)

Definition at line 4292 of file qrhivulkan.cpp.

References QVkCommandBuffer::Command::args, QVkCommandBuffer::Command::BeginRenderPass, QVkCommandBuffer::Command::BindDescriptorSet, QVkCommandBuffer::Command::BindIndexBuffer, QVkCommandBuffer::Command::BindPipeline, QVkCommandBuffer::Command::BindVertexBuffer, QVkCommandBuffer::Command::BlitImage, QVkCommandBuffer::Command::BufferBarrier, QVkCommandBuffer::cb, QVkCommandBuffer::Command::cmd, QVkCommandBuffer::commands, QVkCommandBuffer::Command::CopyBuffer, QVkCommandBuffer::Command::CopyBufferToImage, QVkCommandBuffer::Command::CopyImage, QVkCommandBuffer::Command::CopyImageToBuffer, QVkCommandBuffer::Command::DebugMarkerBegin, QVkCommandBuffer::Command::DebugMarkerEnd, QVkCommandBuffer::Command::DebugMarkerInsert, df, QVkCommandBuffer::Command::Dispatch, QVkCommandBuffer::Command::Draw, QVkCommandBuffer::Command::DrawIndexed, QVkCommandBuffer::Command::EndRenderPass, QVkCommandBuffer::Command::ExecuteSecondary, QVkCommandBuffer::Command::ImageBarrier, it, QVkCommandBuffer::NoPass, QVkCommandBuffer::passResTrackers, QVkCommandBuffer::pools, Q_ASSERT, QVkCommandBuffer::recordingPass, recordTransitionPassResources(), QVkCommandBuffer::Command::SetBlendConstants, QVkCommandBuffer::Command::SetScissor, QVkCommandBuffer::Command::SetStencilRef, QVkCommandBuffer::Command::SetViewport, and QVkCommandBuffer::Command::TransitionPassResources.

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 4593 of file qrhivulkan.cpp.

References accessIsWrite(), aspectMaskForTextureFormat(), QVkCommandBuffer::cb, df, it, layout, 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 4903 of file qrhivulkan.cpp.

References releaseCachedResourcesCalledBeforeFrameStart.

◆ releaseSwapChainResources()

void QRhiVulkan::releaseSwapChainResources ( QRhiSwapChain * swapChain)

Definition at line 2045 of file qrhivulkan.cpp.

References dev, deviceLost, df, frame, i, QRHI_RES, QVK_FRAMES_IN_FLIGHT, 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 2713 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()

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

◆ setComputePipeline()

◆ setGraphicsPipeline()

◆ setObjectName()

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

Definition at line 5713 of file qrhivulkan.cpp.

References caps, 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 4963 of file qrhivulkan.cpp.

References 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 5104 of file qrhivulkan.cpp.

References QVkCommandBuffer::activeSecondaryCbStack, QVkCommandBuffer::Command::args, QVkCommandBuffer::Command::BindDescriptorSet, QRhiShaderResourceBinding::BufferLoad, QRhiShaderResourceBinding::BufferLoadStore, QRhiShaderResourceBinding::BufferStore, QRhiPassResourceTracker::BufStorageLoad, QRhiPassResourceTracker::BufStorageLoadStore, QRhiPassResourceTracker::BufStorageStore, QRhiPassResourceTracker::BufUniformRead, cb, QVkCommandBuffer::Command::cmd, QVkCommandBuffer::commands, QRhiShaderResourceBinding::Data::TextureAndOrSamplerData::count, QVkCommandBuffer::currentComputePipeline, QVkCommandBuffer::currentComputeSrb, QVkCommandBuffer::currentDescSetSlot, QRhiImplementation::currentFrameSlot, QVkCommandBuffer::currentGraphicsPipeline, QVkCommandBuffer::currentGraphicsSrb, QVkCommandBuffer::currentPassResTrackerIndex, QVkCommandBuffer::currentSrbGeneration, df, QRhiBuffer::Dynamic, executeBufferHostWritesForSlot(), i, QRhiShaderResourceBinding::ImageLoad, QRhiShaderResourceBinding::ImageLoadStore, QRhiShaderResourceBinding::ImageStore, QVarLengthArray< T, Prealloc >::last(), QVkCommandBuffer::NoPass, QVkCommandBuffer::passResTrackers, QVkCommandBuffer::passUsesSecondaryCb, QVkCommandBuffer::pools, Q_ASSERT, QRHI_RES, QVkCommandBuffer::recordingPass, QRhiShaderResourceBinding::SampledTexture, QRhiShaderResourceBinding::Sampler, QVkSampler::sampler, QRhiImplementation::shaderResourceBindingData(), QRhiBuffer::StorageBuffer, QRhiPassResourceTracker::TexSample, QRhiPassResourceTracker::TexStorageLoad, QRhiPassResourceTracker::TexStorageLoadStore, QRhiPassResourceTracker::TexStorageStore, QRhiShaderResourceBinding::Texture, QRhiPassResourceTracker::toPassTrackerBufferStage(), QRhiPassResourceTracker::toPassTrackerTextureStage(), trackedRegisterBuffer(), trackedRegisterTexture(), QRhiShaderResourceBinding::UniformBuffer, QRhiBuffer::UniformBuffer, updateShaderResourceBindings(), and QRhiTexture::UsedWithLoadStore.

+ Here is the call graph for this function:

◆ setStencilRef()

void QRhiVulkan::setStencilRef ( QRhiCommandBuffer * cb,
quint32 refValue )
overridevirtual

◆ setVertexInput()

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

◆ setViewport()

◆ startPrimaryCommandBuffer()

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

Definition at line 2391 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 2721 of file qrhivulkan.cpp.

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

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 4877 of file qrhivulkan.cpp.

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

Referenced by printExtraErrorInfo(), and 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 3424 of file qrhivulkan.cpp.

References QVkCommandBuffer::Command::args, QVkCommandBuffer::Command::cmd, QVkCommandBuffer::commands, QVkCommandBuffer::Command::ImageBarrier, QVkCommandBuffer::NoPass, QVkCommandBuffer::pools, Q_ASSERT, and QVkCommandBuffer::recordingPass.

Referenced by enqueueResourceUpdates().

+ Here is the caller graph for this function:

◆ subresUploadByteSize()

VkDeviceSize QRhiVulkan::subresUploadByteSize ( const QRhiTextureSubresourceUploadDescription & subresDesc) const

Definition at line 3454 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 4250 of file qrhivulkan.cpp.

References physDevProperties, and qvk_sampleCounts.

◆ trackedBufferBarrier()

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

Definition at line 3312 of file qrhivulkan.cpp.

References accessIsWrite(), QVkCommandBuffer::Command::args, QVkCommandBuffer::Command::BufferBarrier, QVkCommandBuffer::Command::cmd, QVkCommandBuffer::commands, QVkCommandBuffer::NoPass, QVkCommandBuffer::pools, Q_ASSERT, and QVkCommandBuffer::recordingPass.

Referenced by enqueueResourceUpdates().

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

◆ trackedImageBarrier()

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

Definition at line 3352 of file qrhivulkan.cpp.

References accessIsWrite(), QVkCommandBuffer::Command::args, aspectMaskForTextureFormat(), QVkCommandBuffer::Command::cmd, QVkCommandBuffer::commands, QVkCommandBuffer::Command::ImageBarrier, layout, QVkCommandBuffer::NoPass, QVkCommandBuffer::pools, Q_ASSERT, and QVkCommandBuffer::recordingPass.

Referenced by enqueueResourceUpdates().

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

◆ trackedRegisterBuffer()

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

Definition at line 4556 of file qrhivulkan.cpp.

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

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 4574 of file qrhivulkan.cpp.

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

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 4674 of file qrhivulkan.cpp.

References ubufAlign.

◆ updateShaderResourceBindings()

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

Definition at line 3141 of file qrhivulkan.cpp.

References aligned(), QRhiShaderResourceBinding::BufferLoad, QRhiShaderResourceBinding::BufferLoadStore, QRhiShaderResourceBinding::BufferStore, dev, df, QRhiBuffer::Dynamic, i, QRhiShaderResourceBinding::ImageLoad, QRhiShaderResourceBinding::ImageLoadStore, QRhiShaderResourceBinding::ImageStore, Q_ASSERT, QRHI_RES, QVK_FRAMES_IN_FLIGHT, QRhiShaderResourceBinding::SampledTexture, QRhiShaderResourceBinding::Sampler, QVkSampler::sampler, QRhiImplementation::shaderResourceBindingData(), QRhiShaderResourceBinding::Texture, 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 2472 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 962 of file qrhivulkan_p.h.

Referenced by enqueueResourceUpdates(), and finishActiveReadbacks().

◆ activeTextureReadbacks

QVarLengthArray<TextureReadback, 2> QRhiVulkan::activeTextureReadbacks

Definition at line 954 of file qrhivulkan_p.h.

Referenced by enqueueResourceUpdates(), and finishActiveReadbacks().

◆ allocator

◆ apiVersion

QVersionNumber QRhiVulkan::apiVersion

Definition at line 900 of file qrhivulkan_p.h.

◆ [struct]

◆ clipCorrectMatrix

QMatrix4x4 QRhiVulkan::clipCorrectMatrix

Definition at line 920 of file qrhivulkan_p.h.

◆ cmdPool

VkCommandPool QRhiVulkan::cmdPool[QVK_FRAMES_IN_FLIGHT] = {}

◆ compute

bool QRhiVulkan::compute = false

Definition at line 889 of file qrhivulkan_p.h.

◆ currentSwapChain

QVkSwapChain* QRhiVulkan::currentSwapChain = nullptr

Definition at line 922 of file qrhivulkan_p.h.

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

◆ debugUtils

bool QRhiVulkan::debugUtils = false

Definition at line 891 of file qrhivulkan_p.h.

◆ depthStencilResolveKHR

bool QRhiVulkan::depthStencilResolveKHR = false

Definition at line 899 of file qrhivulkan_p.h.

◆ descriptorPools

QVarLengthArray<DescriptorPoolData, 8> QRhiVulkan::descriptorPools

Definition at line 913 of file qrhivulkan_p.h.

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

◆ dev

◆ deviceLost

◆ df

◆ driverInfoStruct

QRhiDriverInfo QRhiVulkan::driverInfoStruct

Definition at line 925 of file qrhivulkan_p.h.

Referenced by create(), and driverInfo().

◆ f

QVulkanFunctions* QRhiVulkan::f = nullptr

Definition at line 848 of file qrhivulkan_p.h.

Referenced by finishActiveReadbacks().

◆ freeSecondaryCbs

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

Definition at line 914 of file qrhivulkan_p.h.

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

◆ geometryShader

bool QRhiVulkan::geometryShader = false

Definition at line 895 of file qrhivulkan_p.h.

◆ gfxQueue

VkQueue QRhiVulkan::gfxQueue = VK_NULL_HANDLE

Definition at line 844 of file qrhivulkan_p.h.

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

◆ gfxQueueFamilyIdx

quint32 QRhiVulkan::gfxQueueFamilyIdx = 0

Definition at line 842 of file qrhivulkan_p.h.

Referenced by QRhiVulkan(), and create().

◆ gfxQueueIdx

quint32 QRhiVulkan::gfxQueueIdx = 0

Definition at line 843 of file qrhivulkan_p.h.

Referenced by QRhiVulkan().

◆ importedAllocator

bool QRhiVulkan::importedAllocator = false

Definition at line 846 of file qrhivulkan_p.h.

Referenced by QRhiVulkan(), and destroy().

◆ importedDevice

bool QRhiVulkan::importedDevice = false

Definition at line 838 of file qrhivulkan_p.h.

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

◆ inst

QVulkanInstance* QRhiVulkan::inst = nullptr

Definition at line 835 of file qrhivulkan_p.h.

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

◆ maybeWindow

QWindow* QRhiVulkan::maybeWindow = nullptr

Definition at line 836 of file qrhivulkan_p.h.

Referenced by QRhiVulkan(), and create().

◆ multiView

bool QRhiVulkan::multiView = false

Definition at line 897 of file qrhivulkan_p.h.

◆ nativeHandlesStruct

QRhiVulkanNativeHandles QRhiVulkan::nativeHandlesStruct

Definition at line 924 of file qrhivulkan_p.h.

Referenced by nativeHandles().

◆ nonFillPolygonMode

bool QRhiVulkan::nonFillPolygonMode = false

Definition at line 896 of file qrhivulkan_p.h.

◆ ofr

◆ optimalDsFormat

VkFormat QRhiVulkan::optimalDsFormat = VK_FORMAT_UNDEFINED

Definition at line 919 of file qrhivulkan_p.h.

Referenced by optimalDepthStencilFormat().

◆ physDev

VkPhysicalDevice QRhiVulkan::physDev = VK_NULL_HANDLE

◆ physDevFeatures

VkPhysicalDeviceFeatures QRhiVulkan::physDevFeatures

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

◆ renderPass2KHR

bool QRhiVulkan::renderPass2KHR = false

Definition at line 898 of file qrhivulkan_p.h.

◆ requestedDeviceExtensions

QByteArrayList QRhiVulkan::requestedDeviceExtensions

Definition at line 837 of file qrhivulkan_p.h.

Referenced by QRhiVulkan(), and create().

◆ rhiFlags

QRhi::Flags QRhiVulkan::rhiFlags

Definition at line 850 of file qrhivulkan_p.h.

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

◆ swapchains

QSet<QVkSwapChain *> QRhiVulkan::swapchains

Definition at line 923 of file qrhivulkan_p.h.

Referenced by waitCommandCompletion().

◆ tessellation

bool QRhiVulkan::tessellation = false

Definition at line 894 of file qrhivulkan_p.h.

◆ texbufAlign

VkDeviceSize QRhiVulkan::texbufAlign

Definition at line 864 of file qrhivulkan_p.h.

Referenced by prepareUploadSubres(), and subresUploadByteSize().

◆ texture3DSliceAs2D

bool QRhiVulkan::texture3DSliceAs2D = false

Definition at line 893 of file qrhivulkan_p.h.

◆ timestampQueryPool

VkQueryPool QRhiVulkan::timestampQueryPool = VK_NULL_HANDLE

Definition at line 916 of file qrhivulkan_p.h.

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

◆ timestampQueryPoolMap

QBitArray QRhiVulkan::timestampQueryPoolMap

Definition at line 917 of file qrhivulkan_p.h.

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

◆ timestampValidBits

quint32 QRhiVulkan::timestampValidBits = 0

Definition at line 845 of file qrhivulkan_p.h.

Referenced by elapsedSecondsFromTimestamp(), and isFeatureSupported().

◆ ubufAlign

VkDeviceSize QRhiVulkan::ubufAlign

Definition at line 863 of file qrhivulkan_p.h.

Referenced by ubufAlignment(), and updateShaderResourceBindings().

◆ vertexAttribDivisor

bool QRhiVulkan::vertexAttribDivisor = false

Definition at line 892 of file qrhivulkan_p.h.

◆ vkAcquireNextImageKHR

PFN_vkAcquireNextImageKHR QRhiVulkan::vkAcquireNextImageKHR

Definition at line 878 of file qrhivulkan_p.h.

Referenced by beginFrame(), and recreateSwapChain().

◆ vkCreateSwapchainKHR

PFN_vkCreateSwapchainKHR QRhiVulkan::vkCreateSwapchainKHR = nullptr

Definition at line 875 of file qrhivulkan_p.h.

Referenced by recreateSwapChain().

◆ vkDestroySwapchainKHR

PFN_vkDestroySwapchainKHR QRhiVulkan::vkDestroySwapchainKHR

Definition at line 876 of file qrhivulkan_p.h.

Referenced by recreateSwapChain(), and releaseSwapChainResources().

◆ vkGetPhysicalDeviceSurfaceCapabilitiesKHR

PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR QRhiVulkan::vkGetPhysicalDeviceSurfaceCapabilitiesKHR

Definition at line 880 of file qrhivulkan_p.h.

Referenced by createSwapChain(), and recreateSwapChain().

◆ vkGetPhysicalDeviceSurfaceFormatsKHR

PFN_vkGetPhysicalDeviceSurfaceFormatsKHR QRhiVulkan::vkGetPhysicalDeviceSurfaceFormatsKHR

Definition at line 881 of file qrhivulkan_p.h.

Referenced by createSwapChain().

◆ vkGetPhysicalDeviceSurfacePresentModesKHR

PFN_vkGetPhysicalDeviceSurfacePresentModesKHR QRhiVulkan::vkGetPhysicalDeviceSurfacePresentModesKHR

Definition at line 882 of file qrhivulkan_p.h.

Referenced by createSwapChain().

◆ vkGetSwapchainImagesKHR

PFN_vkGetSwapchainImagesKHR QRhiVulkan::vkGetSwapchainImagesKHR

Definition at line 877 of file qrhivulkan_p.h.

Referenced by recreateSwapChain().

◆ vkQueuePresentKHR

PFN_vkQueuePresentKHR QRhiVulkan::vkQueuePresentKHR

Definition at line 879 of file qrhivulkan_p.h.

Referenced by endFrame(), and recreateSwapChain().

◆ wideLines

bool QRhiVulkan::wideLines = false

Definition at line 890 of file qrhivulkan_p.h.


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