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>.
|
#include <qrhivulkan_p.h>
Classes | |
struct | BufferReadback |
struct | DeferredReleaseEntry |
struct | DescriptorPoolData |
struct | OffscreenFrame |
struct | TextureReadback |
Public Types | |
using | BufferImageCopyList = QVarLengthArray<VkBufferImageCopy, 16> |
Additional Inherited Members | |
Static Public Member Functions inherited from QRhiImplementation | |
static const QRhiShaderResourceBinding::Data * | shaderResourceBindingData (const QRhiShaderResourceBinding &binding) |
static QRhiShaderResourceBinding::Data * | shaderResourceBindingData (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 |
Definition at line 647 of file qrhivulkan_p.h.
using QRhiVulkan::BufferImageCopyList = QVarLengthArray<VkBufferImageCopy, 16> |
Definition at line 795 of file qrhivulkan_p.h.
QRhiVulkan::QRhiVulkan | ( | QRhiVulkanInitParams * | params, |
QRhiVulkanNativeHandles * | importParams = nullptr ) |
Definition at line 343 of file qrhivulkan.cpp.
References allocator, dev, gfxQueueFamilyIdx, gfxQueueIdx, importedAllocator, importedDevice, inst, maybeWindow, physDev, and requestedDeviceExtensions.
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().
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.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 2893 of file qrhivulkan.cpp.
References QVkCommandBuffer::activeSecondaryCbStack, QVarLengthArray< T, Prealloc >::append(), cb, QVkCommandBuffer::ComputePass, QVkCommandBuffer::computePassState, enqueueResourceUpdates(), enqueueTransitionPassResources(), QRhiCommandBuffer::ExternalContent, QVkCommandBuffer::NoPass, QVkCommandBuffer::passUsesSecondaryCb, Q_ASSERT, QRHI_RES, QVkCommandBuffer::recordingPass, QVkCommandBuffer::resetCachedState(), and startSecondaryCommandBuffer().
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 5654 of file qrhivulkan.cpp.
References QVkCommandBuffer::activeSecondaryCbStack, QVarLengthArray< T, Prealloc >::append(), cb, endAndEnqueueSecondaryCommandBuffer(), QVkCommandBuffer::inExternal, QVarLengthArray< T, Prealloc >::last(), maybeRenderTargetData(), QVkCommandBuffer::NoPass, QVkCommandBuffer::passUsesSecondaryCb, QRHI_RES, qWarning, QVkCommandBuffer::recordingPass, recordPrimaryCommandBuffer(), QVarLengthArray< T, Prealloc >::removeLast(), QVkCommandBuffer::resetCommands(), and startSecondaryCommandBuffer().
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 2144 of file qrhivulkan.cpp.
References QBitArray::clearBit(), QRhiImplementation::currentFrameSlot, currentSwapChain, dev, deviceLost, df, QVkSwapChain::ds, elapsedSecondsFromTimestamp(), QRhi::EnableTimestamps, ensureCommandPoolForNewFrame(), frame, QRhi::FrameOpDeviceLost, QRhi::FrameOpError, QRhi::FrameOpSuccess, QRhi::FrameOpSwapChainOutOfDate, i, inst, QVkRenderBuffer::lastActiveFrameSlot, ok, prepareNewFrame(), QRHI_RES, qWarning, rhiFlags, QBitArray::setBit(), QBitArray::size(), startPrimaryCommandBuffer(), QBitArray::testBit(), timestampQueryPool, timestampQueryPoolMap, vkAcquireNextImageKHR, and waitCommandCompletion().
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 2485 of file qrhivulkan.cpp.
References QVkCommandBuffer::cb, cb, QRhiImplementation::currentFrameSlot, df, QRhi::EnableTimestamps, ensureCommandPoolForNewFrame(), QRhi::FrameOpSuccess, i, ofr, prepareNewFrame(), QVK_FRAMES_IN_FLIGHT, rhiFlags, QBitArray::setBit(), QBitArray::size(), startPrimaryCommandBuffer(), QBitArray::testBit(), timestampQueryPool, timestampQueryPoolMap, and waitCommandCompletion().
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 2780 of file qrhivulkan.cpp.
References activateTextureRenderTarget(), QVkCommandBuffer::activeSecondaryCbStack, QVarLengthArray< T, Prealloc >::append(), QVkCommandBuffer::Command::args, QVkCommandBuffer::Command::BeginRenderPass, cb, QVkCommandBuffer::Command::cmd, QVkCommandBuffer::commands, QRhiImplementation::currentFrameSlot, QVkSwapChain::currentImageIndex, currentSwapChain, QVkCommandBuffer::currentTarget, enqueueResourceUpdates(), enqueueTransitionPassResources(), QRhiCommandBuffer::ExternalContent, i, QVkSwapChain::imageRes, QVkCommandBuffer::NoPass, QVkCommandBuffer::passUsesSecondaryCb, QVkCommandBuffer::pools, Q_ASSERT, QRHI_RES, QVkCommandBuffer::recordingPass, QVkCommandBuffer::RenderPass, QVkCommandBuffer::resetCachedState(), QRhiResource::resourceType(), QVkSwapChain::ImageResources::ScImageUseRender, startSecondaryCommandBuffer(), QRhiResource::SwapChainRenderTarget, and QRhiResource::TextureRenderTarget.
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().
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 4694 of file qrhivulkan.cpp.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 415 of file qrhivulkan.cpp.
References caps, dev, QRhiDriverInfo::deviceId, QRhiDriverInfo::deviceName, QRhiDriverInfo::deviceType, driverInfoStruct, gfxQueueFamilyIdx, globalVulkanInstance, i, importedDevice, inst, maybeWindow, physDev, physDevFeatures, physDevProperties, QRhi::PreferSoftwareRenderer, Q_ASSERT, QByteArray(), QByteArrayLiteral, qCDebug, qEnvironmentVariableIntValue(), qEnvironmentVariableIsSet(), qgetenv(), QtDebugMsg, qWarning, requestedDeviceExtensions, rhiFlags, toRhiDeviceType(), and QRhiDriverInfo::vendorId.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 4669 of file qrhivulkan.cpp.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 5069 of file qrhivulkan.cpp.
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.
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().
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 5064 of file qrhivulkan.cpp.
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.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 5037 of file qrhivulkan.cpp.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 5051 of file qrhivulkan.cpp.
VkShaderModule QRhiVulkan::createShader | ( | const QByteArray & | spirv | ) |
Definition at line 3109 of file qrhivulkan.cpp.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 5074 of file qrhivulkan.cpp.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 4656 of file qrhivulkan.cpp.
References qWarning, vkGetPhysicalDeviceSurfaceCapabilitiesKHR, vkGetPhysicalDeviceSurfaceFormatsKHR, and vkGetPhysicalDeviceSurfacePresentModesKHR.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 5044 of file qrhivulkan.cpp.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 5058 of file qrhivulkan.cpp.
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().
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 5559 of file qrhivulkan.cpp.
References QVkCommandBuffer::activeSecondaryCbStack, QVkCommandBuffer::Command::args, caps, cb, QVkCommandBuffer::Command::cmd, QVkCommandBuffer::commands, QVkCommandBuffer::Command::DebugMarkerBegin, QRhiImplementation::debugMarkers, QVarLengthArray< T, Prealloc >::last(), QVkCommandBuffer::NoPass, QVkCommandBuffer::passUsesSecondaryCb, QVkCommandBuffer::pools, Q_UNUSED, QRHI_RES, and QVkCommandBuffer::recordingPass.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 5585 of file qrhivulkan.cpp.
References QVkCommandBuffer::activeSecondaryCbStack, caps, cb, QVkCommandBuffer::Command::cmd, QVkCommandBuffer::commands, QVkCommandBuffer::Command::DebugMarkerEnd, QRhiImplementation::debugMarkers, QVarLengthArray< T, Prealloc >::last(), QVkCommandBuffer::NoPass, QVkCommandBuffer::passUsesSecondaryCb, Q_UNUSED, QRHI_RES, and QVkCommandBuffer::recordingPass.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 5603 of file qrhivulkan.cpp.
References QVkCommandBuffer::activeSecondaryCbStack, QVkCommandBuffer::Command::args, caps, cb, QVkCommandBuffer::Command::cmd, QVkCommandBuffer::commands, QByteArray::constData(), QVkCommandBuffer::Command::DebugMarkerInsert, QRhiImplementation::debugMarkers, QVarLengthArray< T, Prealloc >::last(), QVkCommandBuffer::NoPass, QVkCommandBuffer::passUsesSecondaryCb, QVkCommandBuffer::pools, Q_UNUSED, QRHI_RES, and QVkCommandBuffer::recordingPass.
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().
|
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().
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 2978 of file qrhivulkan.cpp.
References QVkCommandBuffer::activeSecondaryCbStack, QVkCommandBuffer::Command::args, QVkCommandBuffer::Command::BufferBarrier, QRhiShaderResourceBinding::BufferLoad, QRhiShaderResourceBinding::BufferLoadStore, QRhiShaderResourceBinding::BufferStore, cb, QVkCommandBuffer::Command::cmd, QVkCommandBuffer::commands, QVkCommandBuffer::ComputePass, QVkCommandBuffer::computePassState, QVkCommandBuffer::currentComputeSrb, QRhiImplementation::currentFrameSlot, df, QVkCommandBuffer::Command::Dispatch, QRhiBuffer::Dynamic, i, QVkCommandBuffer::Command::ImageBarrier, QRhiShaderResourceBinding::ImageLoad, QRhiShaderResourceBinding::ImageLoadStore, QRhiShaderResourceBinding::ImageStore, it, QVarLengthArray< T, Prealloc >::last(), QVkCommandBuffer::passUsesSecondaryCb, QVkCommandBuffer::pools, Q_ASSERT, QRHI_RES, qrhivk_accumulateComputeResource(), QVkCommandBuffer::recordingPass, QRhiImplementation::shaderResourceBindingData(), and QRhiResource::Texture.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 5521 of file qrhivulkan.cpp.
References QVkCommandBuffer::activeSecondaryCbStack, QVkCommandBuffer::Command::args, cb, QVkCommandBuffer::Command::cmd, QVkCommandBuffer::commands, df, QVkCommandBuffer::Command::Draw, instanceCount, QVarLengthArray< T, Prealloc >::last(), QVkCommandBuffer::passUsesSecondaryCb, Q_ASSERT, QRHI_RES, QVkCommandBuffer::recordingPass, and QVkCommandBuffer::RenderPass.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 5539 of file qrhivulkan.cpp.
References QVkCommandBuffer::activeSecondaryCbStack, QVkCommandBuffer::Command::args, cb, QVkCommandBuffer::Command::cmd, QVkCommandBuffer::commands, df, QVkCommandBuffer::Command::DrawIndexed, instanceCount, QVarLengthArray< T, Prealloc >::last(), QVkCommandBuffer::passUsesSecondaryCb, Q_ASSERT, QRHI_RES, QVkCommandBuffer::recordingPass, and QVkCommandBuffer::RenderPass.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 4872 of file qrhivulkan.cpp.
References driverInfoStruct.
VkSampleCountFlagBits QRhiVulkan::effectiveSampleCountBits | ( | int | sampleCount | ) |
Definition at line 4270 of file qrhivulkan.cpp.
References QRhiImplementation::effectiveSampleCount(), and qvk_sampleCounts.
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().
void QRhiVulkan::endAndEnqueueSecondaryCommandBuffer | ( | VkCommandBuffer | cb, |
QVkCommandBuffer * | cbD ) |
Definition at line 2763 of file qrhivulkan.cpp.
References QVkCommandBuffer::Command::args, cb, QVkCommandBuffer::Command::cmd, QVkCommandBuffer::commands, QRhiImplementation::currentFrameSlot, df, QVkCommandBuffer::Command::ExecuteSecondary, QRhiVulkan::DeferredReleaseEntry::lastActiveFrameSlot, qWarning, releaseQueue, QRhiVulkan::DeferredReleaseEntry::SecondaryCommandBuffer, QRhiVulkan::DeferredReleaseEntry::secondaryCommandBuffer, and QRhiVulkan::DeferredReleaseEntry::type.
Referenced by beginExternal(), endComputePass(), endExternal(), and endPass().
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().
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 2916 of file qrhivulkan.cpp.
References QVkCommandBuffer::activeSecondaryCbStack, cb, QVkCommandBuffer::ComputePass, endAndEnqueueSecondaryCommandBuffer(), enqueueResourceUpdates(), QVarLengthArray< T, Prealloc >::last(), QVkCommandBuffer::NoPass, QVkCommandBuffer::passUsesSecondaryCb, Q_ASSERT, QRHI_RES, QVkCommandBuffer::recordingPass, and QVarLengthArray< T, Prealloc >::removeLast().
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 5691 of file qrhivulkan.cpp.
References QVkCommandBuffer::activeSecondaryCbStack, QVarLengthArray< T, Prealloc >::append(), cb, QVkCommandBuffer::commands, QVkCommandBuffer::currentPassResTrackerIndex, endAndEnqueueSecondaryCommandBuffer(), QVkCommandBuffer::inExternal, QVarLengthArray< T, Prealloc >::last(), maybeRenderTargetData(), QVkCommandBuffer::NoPass, Q_ASSERT, QRHI_RES, QVkCommandBuffer::recordingPass, QVarLengthArray< T, Prealloc >::removeLast(), QVkCommandBuffer::resetCachedState(), and startSecondaryCommandBuffer().
|
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().
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 2532 of file qrhivulkan.cpp.
References QVkCommandBuffer::cb, QBitArray::clearBit(), QRhiImplementation::currentFrameSlot, dev, df, elapsedSecondsFromTimestamp(), endAndSubmitPrimaryCommandBuffer(), finishActiveReadbacks(), QRhi::FrameOpError, QRhi::FrameOpSuccess, QVkCommandBuffer::lastGpuTime, ofr, ok, Q_ASSERT, Q_UNUSED, qWarning, recordPrimaryCommandBuffer(), timestampQueryPool, and timestampQueryPoolMap.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 2872 of file qrhivulkan.cpp.
References QVkCommandBuffer::activeSecondaryCbStack, cb, QVkCommandBuffer::Command::cmd, QVkCommandBuffer::commands, QVkCommandBuffer::currentTarget, endAndEnqueueSecondaryCommandBuffer(), QVkCommandBuffer::Command::EndRenderPass, enqueueResourceUpdates(), QVarLengthArray< T, Prealloc >::last(), QVkCommandBuffer::NoPass, QVkCommandBuffer::passUsesSecondaryCb, Q_ASSERT, QRHI_RES, QVkCommandBuffer::recordingPass, QVarLengthArray< T, Prealloc >::removeLast(), and QVkCommandBuffer::RenderPass.
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().
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().
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().
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().
Definition at line 4060 of file qrhivulkan.cpp.
References allocator, QRhiBuffer::Dynamic, Q_ASSERT, qWarning, toVmaAllocation(), and toVmaAllocator().
Referenced by enqueueResourceUpdates(), setShaderResources(), and setVertexInput().
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().
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 2590 of file qrhivulkan.cpp.
References QVkCommandBuffer::cb, cb, QVkSwapChain::cbWrapper, QRhiImplementation::currentFrameSlot, currentSwapChain, df, endAndSubmitPrimaryCommandBuffer(), ensureCommandPoolForNewFrame(), executeDeferredReleases(), finishActiveReadbacks(), frame, QRhi::FrameOpSuccess, gfxQueue, QRhiImplementation::inFrame, QVkCommandBuffer::NoPass, ofr, Q_ASSERT, QVkCommandBuffer::recordingPass, recordPrimaryCommandBuffer(), QVkCommandBuffer::resetCommands(), and startPrimaryCommandBuffer().
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().
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 4689 of file qrhivulkan.cpp.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 4908 of file qrhivulkan.cpp.
References deviceLost.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 4735 of file qrhivulkan.cpp.
References QRhi::BaseInstance, QRhi::BaseVertex, caps, QRhi::Compute, QRhi::CustomInstanceStepRate, QRhi::DebugMarkers, QRhi::ElementIndexUint, QRhi::GeometryShader, QRhi::HalfAttributes, QRhi::ImageDataStride, QRhi::Instancing, QRhi::IntAttributes, QRhi::MultisampleRenderBuffer, QRhi::MultisampleTexture, QRhi::MultiView, QRhi::NonDynamicUniformBuffers, QRhi::NonFillPolygonMode, QRhi::NonFourAlignedEffectiveIndexBufferOffset, QRhi::NPOTTextureRepeat, QRhi::OneDimensionalTextureMipmaps, QRhi::OneDimensionalTextures, QRhi::PipelineCacheDataLoadSave, QRhi::PrimitiveRestart, QRhi::ReadBackAnyTextureFormat, QRhi::ReadBackNonBaseMipLevel, QRhi::ReadBackNonUniformBuffer, QRhi::RedOrAlpha8IsRed, QRhi::RenderBufferImport, QRhi::RenderTo3DTextureSlice, QRhi::RenderToNonBaseMipLevel, QRhi::RenderToOneDimensionalTexture, QRhi::ResolveDepthStencil, QRhi::ScreenSpaceDerivatives, QRhi::Tessellation, QRhi::TexelFetch, QRhi::TextureArrayRange, QRhi::TextureArrays, QRhi::TextureViewFormat, QRhi::ThreeDimensionalTextureMipmaps, QRhi::ThreeDimensionalTextures, QRhi::Timestamps, timestampValidBits, QRhi::TriangleFanTopology, QRhi::VertexShaderPointSize, and QRhi::WideLines.
|
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().
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 4679 of file qrhivulkan.cpp.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 4684 of file qrhivulkan.cpp.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 5707 of file qrhivulkan.cpp.
References cb, QVkCommandBuffer::lastGpuTime, and QRHI_RES.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 4897 of file qrhivulkan.cpp.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 4867 of file qrhivulkan.cpp.
References nativeHandlesStruct.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 5629 of file qrhivulkan.cpp.
VkFormat QRhiVulkan::optimalDepthStencilFormat | ( | ) |
Definition at line 1305 of file qrhivulkan.cpp.
References optimalDsFormat, physDev, and qWarning.
Referenced by createDefaultRenderPass().
|
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.
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().
void QRhiVulkan::prepareUploadSubres | ( | QVkTexture * | texD, |
int | layer, | ||
int | level, | ||
const QRhiTextureSubresourceUploadDescription & | subresDesc, | ||
size_t * | curOfs, | ||
void * | mp, | ||
BufferImageCopyList * | copyInfos ) |
Definition at line 3464 of file qrhivulkan.cpp.
References aligned(), QRhiImplementation::compressedFormatInfo(), QByteArray::constData(), QRhiTextureSubresourceUploadDescription::data(), QRhiTextureSubresourceUploadDescription::dataStride(), QRhiTextureSubresourceUploadDescription::destinationTopLeft(), QRhiTextureSubresourceUploadDescription::image(), QRhiImplementation::isCompressedFormat(), QByteArray::isEmpty(), QSize::isEmpty(), QPoint::isNull(), QRhiTexture::OneDimensional, qMax(), qWarning, QByteArray::size(), QRhiTextureSubresourceUploadDescription::sourceSize(), QRhiTextureSubresourceUploadDescription::sourceTopLeft(), texbufAlign, QRhiImplementation::textureFormatInfo(), QRhiTexture::ThreeDimensional, QSize::width(), QPoint::x(), and QPoint::y().
Referenced by enqueueResourceUpdates().
void QRhiVulkan::printExtraErrorInfo | ( | VkResult | err | ) |
Definition at line 3572 of file qrhivulkan.cpp.
References qWarning, and statistics().
Referenced by enqueueResourceUpdates().
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().
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().
bool QRhiVulkan::recreateSwapChain | ( | QRhiSwapChain * | swapChain | ) |
Definition at line 1778 of file qrhivulkan.cpp.
References createTransientImage(), dev, df, frame, i, QRhiSwapChain::MinimalBufferCount, QRhiSwapChain::NoVSync, physDev, qCDebug, qMax(), QRHI_RES, QVK_FRAMES_IN_FLIGHT, qWarning, releaseSwapChainResources(), QVkSwapChain::ImageResources::ScImageUseNone, QRhiSwapChain::SurfaceHasNonPreMulAlpha, QRhiSwapChain::SurfaceHasPreMulAlpha, QRhiSwapChain::UsedAsTransferSource, vkAcquireNextImageKHR, vkCreateSwapchainKHR, vkDestroySwapchainKHR, vkGetPhysicalDeviceSurfaceCapabilitiesKHR, vkGetSwapchainImagesKHR, and vkQueuePresentKHR.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 4903 of file qrhivulkan.cpp.
References releaseCachedResourcesCalledBeforeFrameStart.
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().
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 4829 of file qrhivulkan.cpp.
References QRhi::FramesInFlight, QRhi::MaxAsyncReadbackFrames, QRhi::MaxColorAttachments, QRhi::MaxThreadGroupsPerDimension, QRhi::MaxThreadGroupX, QRhi::MaxThreadGroupY, QRhi::MaxThreadGroupZ, QRhi::MaxThreadsPerThreadGroup, QRhi::MaxUniformBufferRange, QRhi::MaxVertexInputs, QRhi::MaxVertexOutputs, physDevProperties, qMin(), QVK_FRAMES_IN_FLIGHT, QRhi::TextureArraySizeMax, QRhi::TextureSizeMax, and QRhi::TextureSizeMin.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 2713 of file qrhivulkan.cpp.
References cb, enqueueResourceUpdates(), QVkCommandBuffer::NoPass, Q_ASSERT, QRHI_RES, and QVkCommandBuffer::recordingPass.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 5489 of file qrhivulkan.cpp.
References QVkCommandBuffer::activeSecondaryCbStack, QVkCommandBuffer::Command::args, cb, QVkCommandBuffer::Command::cmd, QVkCommandBuffer::commands, df, QVarLengthArray< T, Prealloc >::last(), QVkCommandBuffer::passUsesSecondaryCb, Q_ASSERT, QRHI_RES, QVkCommandBuffer::recordingPass, QVkCommandBuffer::RenderPass, and QVkCommandBuffer::Command::SetBlendConstants.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 2933 of file qrhivulkan.cpp.
References QVkCommandBuffer::activeSecondaryCbStack, QVkCommandBuffer::Command::args, QVkCommandBuffer::Command::BindPipeline, cb, QVkCommandBuffer::Command::cmd, QVkCommandBuffer::commands, QVkCommandBuffer::ComputePass, QVkCommandBuffer::currentComputePipeline, QRhiImplementation::currentFrameSlot, QVkCommandBuffer::currentGraphicsPipeline, QVkCommandBuffer::currentPipelineGeneration, df, QVarLengthArray< T, Prealloc >::last(), QVkCommandBuffer::passUsesSecondaryCb, Q_ASSERT, QRHI_RES, and QVkCommandBuffer::recordingPass.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 5079 of file qrhivulkan.cpp.
References QVkCommandBuffer::activeSecondaryCbStack, QVkCommandBuffer::Command::args, QVkCommandBuffer::Command::BindPipeline, cb, QVkCommandBuffer::Command::cmd, QVkCommandBuffer::commands, QVkCommandBuffer::currentComputePipeline, QRhiImplementation::currentFrameSlot, QVkCommandBuffer::currentGraphicsPipeline, QVkCommandBuffer::currentPipelineGeneration, df, QVarLengthArray< T, Prealloc >::last(), QVkCommandBuffer::passUsesSecondaryCb, Q_ASSERT, QRHI_RES, QVkCommandBuffer::recordingPass, and QVkCommandBuffer::RenderPass.
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.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 4963 of file qrhivulkan.cpp.
References dev, df, ensurePipelineCache(), header(), headerSize, physDevProperties, pipelineCache, QRhiImplementation::pipelineCacheRhiId(), and qCDebug.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 5462 of file qrhivulkan.cpp.
References QVkCommandBuffer::activeSecondaryCbStack, QVkCommandBuffer::Command::args, cb, QVkCommandBuffer::Command::cmd, QVkCommandBuffer::commands, QVkCommandBuffer::currentGraphicsPipeline, QVkCommandBuffer::currentTarget, df, QVarLengthArray< T, Prealloc >::last(), QVkCommandBuffer::passUsesSecondaryCb, QRhiRenderTarget::pixelSize(), Q_ASSERT, QRHI_RES, QVkCommandBuffer::recordingPass, QVkCommandBuffer::RenderPass, QRhiScissor::scissor(), QVkCommandBuffer::Command::SetScissor, and QRhiGraphicsPipeline::UsesScissor.
|
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.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 5507 of file qrhivulkan.cpp.
References QVkCommandBuffer::activeSecondaryCbStack, QVkCommandBuffer::Command::args, cb, QVkCommandBuffer::Command::cmd, QVkCommandBuffer::commands, df, QVarLengthArray< T, Prealloc >::last(), QVkCommandBuffer::passUsesSecondaryCb, Q_ASSERT, QRHI_RES, QVkCommandBuffer::recordingPass, QVkCommandBuffer::RenderPass, and QVkCommandBuffer::Command::SetStencilRef.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 5324 of file qrhivulkan.cpp.
References QVkCommandBuffer::activeSecondaryCbStack, QVkCommandBuffer::Command::args, QVkCommandBuffer::Command::BindIndexBuffer, QVkCommandBuffer::Command::BindVertexBuffer, QRhiPassResourceTracker::BufIndexRead, QRhiPassResourceTracker::BufVertexInput, QRhiPassResourceTracker::BufVertexInputStage, cb, QVkCommandBuffer::Command::cmd, QVkCommandBuffer::commands, 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(), QVkCommandBuffer::passResTrackers, QVkCommandBuffer::passUsesSecondaryCb, QVkCommandBuffer::pools, Q_ASSERT, QRHI_RES, QVkCommandBuffer::recordingPass, QVkCommandBuffer::RenderPass, trackedRegisterBuffer(), and QRhiBuffer::VertexBuffer.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 5416 of file qrhivulkan.cpp.
References QVkCommandBuffer::activeSecondaryCbStack, QVkCommandBuffer::Command::args, cb, QVkCommandBuffer::Command::cmd, QVkCommandBuffer::commands, QVkCommandBuffer::currentGraphicsPipeline, QVkCommandBuffer::currentTarget, df, QVarLengthArray< T, Prealloc >::last(), QVkCommandBuffer::passUsesSecondaryCb, QRhiRenderTarget::pixelSize(), Q_ASSERT, QRHI_RES, QVkCommandBuffer::recordingPass, QVkCommandBuffer::RenderPass, QVkCommandBuffer::Command::SetScissor, QVkCommandBuffer::Command::SetViewport, QRhiGraphicsPipeline::UsesScissor, and viewport().
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().
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().
|
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().
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().
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().
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 4250 of file qrhivulkan.cpp.
References physDevProperties, and qvk_sampleCounts.
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().
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().
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().
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().
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 4674 of file qrhivulkan.cpp.
References ubufAlign.
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().
void QRhiVulkan::waitCommandCompletion | ( | int | frameSlot | ) |
Definition at line 2472 of file qrhivulkan.cpp.
References dev, df, frame, and swapchains.
Referenced by beginFrame(), and beginOffscreenFrame().
QVarLengthArray<BufferReadback, 2> QRhiVulkan::activeBufferReadbacks |
Definition at line 962 of file qrhivulkan_p.h.
Referenced by enqueueResourceUpdates(), and finishActiveReadbacks().
QVarLengthArray<TextureReadback, 2> QRhiVulkan::activeTextureReadbacks |
Definition at line 954 of file qrhivulkan_p.h.
Referenced by enqueueResourceUpdates(), and finishActiveReadbacks().
QVkAllocator QRhiVulkan::allocator = nullptr |
Definition at line 847 of file qrhivulkan_p.h.
Referenced by QRhiVulkan(), destroy(), enqueueResourceUpdates(), executeBufferHostWritesForSlot(), executeDeferredReleases(), finishActiveReadbacks(), and statistics().
QVersionNumber QRhiVulkan::apiVersion |
Definition at line 900 of file qrhivulkan_p.h.
struct { ... } QRhiVulkan::caps |
Referenced by create(), createOffscreenRenderPass(), debugMarkBegin(), debugMarkEnd(), debugMarkMsg(), isFeatureSupported(), and setObjectName().
QMatrix4x4 QRhiVulkan::clipCorrectMatrix |
Definition at line 920 of file qrhivulkan_p.h.
VkCommandPool QRhiVulkan::cmdPool[QVK_FRAMES_IN_FLIGHT] = {} |
Definition at line 841 of file qrhivulkan_p.h.
Referenced by destroy(), ensureCommandPoolForNewFrame(), startPrimaryCommandBuffer(), and startSecondaryCommandBuffer().
bool QRhiVulkan::compute = false |
Definition at line 889 of file qrhivulkan_p.h.
QVkSwapChain* QRhiVulkan::currentSwapChain = nullptr |
Definition at line 922 of file qrhivulkan_p.h.
Referenced by beginFrame(), beginPass(), endFrame(), enqueueResourceUpdates(), and finish().
bool QRhiVulkan::debugUtils = false |
Definition at line 891 of file qrhivulkan_p.h.
bool QRhiVulkan::depthStencilResolveKHR = false |
Definition at line 899 of file qrhivulkan_p.h.
QVarLengthArray<DescriptorPoolData, 8> QRhiVulkan::descriptorPools |
Definition at line 913 of file qrhivulkan_p.h.
Referenced by allocateDescriptorSet(), destroy(), and executeDeferredReleases().
VkDevice QRhiVulkan::dev = VK_NULL_HANDLE |
Definition at line 840 of file qrhivulkan_p.h.
Referenced by QRhiVulkan(), allocateDescriptorSet(), beginFrame(), chooseTransientImageMemType(), create(), createDefaultRenderPass(), createDescriptorPool(), createOffscreenRenderPass(), createShader(), createTransientImage(), destroy(), endOffscreenFrame(), ensureCommandPoolForNewFrame(), ensurePipelineCache(), executeDeferredReleases(), pipelineCacheData(), recreateSwapChain(), releaseSwapChainResources(), setObjectName(), setPipelineCacheData(), startPrimaryCommandBuffer(), startSecondaryCommandBuffer(), updateShaderResourceBindings(), and waitCommandCompletion().
bool QRhiVulkan::deviceLost = false |
Definition at line 865 of file qrhivulkan_p.h.
Referenced by beginFrame(), destroy(), endAndSubmitPrimaryCommandBuffer(), endFrame(), isDeviceLost(), releaseSwapChainResources(), and startPrimaryCommandBuffer().
QVulkanDeviceFunctions* QRhiVulkan::df = nullptr |
Definition at line 849 of file qrhivulkan_p.h.
Referenced by allocateDescriptorSet(), beginFrame(), beginOffscreenFrame(), chooseTransientImageMemType(), createDefaultRenderPass(), createDescriptorPool(), createOffscreenRenderPass(), createShader(), createTransientImage(), destroy(), dispatch(), draw(), drawIndexed(), endAndEnqueueSecondaryCommandBuffer(), endAndSubmitPrimaryCommandBuffer(), endFrame(), endOffscreenFrame(), ensureCommandPoolForNewFrame(), ensurePipelineCache(), executeDeferredReleases(), finish(), pipelineCacheData(), recordPrimaryCommandBuffer(), recordTransitionPassResources(), recreateSwapChain(), releaseSwapChainResources(), setBlendConstants(), setComputePipeline(), setGraphicsPipeline(), setPipelineCacheData(), setScissor(), setShaderResources(), setStencilRef(), setVertexInput(), setViewport(), startPrimaryCommandBuffer(), startSecondaryCommandBuffer(), updateShaderResourceBindings(), and waitCommandCompletion().
QRhiDriverInfo QRhiVulkan::driverInfoStruct |
Definition at line 925 of file qrhivulkan_p.h.
Referenced by create(), and driverInfo().
QVulkanFunctions* QRhiVulkan::f = nullptr |
Definition at line 848 of file qrhivulkan_p.h.
Referenced by finishActiveReadbacks().
QVarLengthArray<VkCommandBuffer, 4> QRhiVulkan::freeSecondaryCbs[QVK_FRAMES_IN_FLIGHT] |
Definition at line 914 of file qrhivulkan_p.h.
Referenced by destroy(), executeDeferredReleases(), and startSecondaryCommandBuffer().
bool QRhiVulkan::geometryShader = false |
Definition at line 895 of file qrhivulkan_p.h.
VkQueue QRhiVulkan::gfxQueue = VK_NULL_HANDLE |
Definition at line 844 of file qrhivulkan_p.h.
Referenced by endAndSubmitPrimaryCommandBuffer(), endFrame(), and finish().
quint32 QRhiVulkan::gfxQueueFamilyIdx = 0 |
Definition at line 842 of file qrhivulkan_p.h.
Referenced by QRhiVulkan(), and create().
quint32 QRhiVulkan::gfxQueueIdx = 0 |
Definition at line 843 of file qrhivulkan_p.h.
Referenced by QRhiVulkan().
bool QRhiVulkan::importedAllocator = false |
Definition at line 846 of file qrhivulkan_p.h.
Referenced by QRhiVulkan(), and destroy().
bool QRhiVulkan::importedDevice = false |
Definition at line 838 of file qrhivulkan_p.h.
Referenced by QRhiVulkan(), create(), and destroy().
QVulkanInstance* QRhiVulkan::inst = nullptr |
Definition at line 835 of file qrhivulkan_p.h.
Referenced by QRhiVulkan(), beginFrame(), create(), destroy(), and endFrame().
Definition at line 836 of file qrhivulkan_p.h.
Referenced by QRhiVulkan(), and create().
bool QRhiVulkan::multiView = false |
Definition at line 897 of file qrhivulkan_p.h.
QRhiVulkanNativeHandles QRhiVulkan::nativeHandlesStruct |
Definition at line 924 of file qrhivulkan_p.h.
Referenced by nativeHandles().
bool QRhiVulkan::nonFillPolygonMode = false |
Definition at line 896 of file qrhivulkan_p.h.
struct QRhiVulkan::OffscreenFrame QRhiVulkan::ofr |
Referenced by beginOffscreenFrame(), destroy(), endOffscreenFrame(), and finish().
VkFormat QRhiVulkan::optimalDsFormat = VK_FORMAT_UNDEFINED |
Definition at line 919 of file qrhivulkan_p.h.
Referenced by optimalDepthStencilFormat().
VkPhysicalDevice QRhiVulkan::physDev = VK_NULL_HANDLE |
Definition at line 839 of file qrhivulkan_p.h.
Referenced by QRhiVulkan(), chooseTransientImageMemType(), create(), isTextureFormatSupported(), optimalDepthStencilFormat(), and recreateSwapChain().
VkPhysicalDeviceFeatures QRhiVulkan::physDevFeatures |
Definition at line 851 of file qrhivulkan_p.h.
Referenced by create(), and isTextureFormatSupported().
VkPhysicalDeviceProperties QRhiVulkan::physDevProperties |
Definition at line 862 of file qrhivulkan_p.h.
Referenced by create(), elapsedSecondsFromTimestamp(), pipelineCacheData(), resourceLimit(), setPipelineCacheData(), and supportedSampleCounts().
VkPipelineCache QRhiVulkan::pipelineCache = VK_NULL_HANDLE |
Definition at line 903 of file qrhivulkan_p.h.
Referenced by destroy(), ensurePipelineCache(), pipelineCacheData(), and setPipelineCacheData().
bool QRhiVulkan::releaseCachedResourcesCalledBeforeFrameStart = false |
Definition at line 866 of file qrhivulkan_p.h.
Referenced by ensureCommandPoolForNewFrame(), prepareNewFrame(), and releaseCachedResources().
QList<DeferredReleaseEntry> QRhiVulkan::releaseQueue |
Definition at line 1029 of file qrhivulkan_p.h.
Referenced by endAndEnqueueSecondaryCommandBuffer(), enqueueResourceUpdates(), and executeDeferredReleases().
bool QRhiVulkan::renderPass2KHR = false |
Definition at line 898 of file qrhivulkan_p.h.
QByteArrayList QRhiVulkan::requestedDeviceExtensions |
Definition at line 837 of file qrhivulkan_p.h.
Referenced by QRhiVulkan(), and create().
QRhi::Flags QRhiVulkan::rhiFlags |
Definition at line 850 of file qrhivulkan_p.h.
Referenced by beginFrame(), beginOffscreenFrame(), create(), and pipelineCacheData().
QSet<QVkSwapChain *> QRhiVulkan::swapchains |
Definition at line 923 of file qrhivulkan_p.h.
Referenced by waitCommandCompletion().
bool QRhiVulkan::tessellation = false |
Definition at line 894 of file qrhivulkan_p.h.
VkDeviceSize QRhiVulkan::texbufAlign |
Definition at line 864 of file qrhivulkan_p.h.
Referenced by prepareUploadSubres(), and subresUploadByteSize().
bool QRhiVulkan::texture3DSliceAs2D = false |
Definition at line 893 of file qrhivulkan_p.h.
VkQueryPool QRhiVulkan::timestampQueryPool = VK_NULL_HANDLE |
Definition at line 916 of file qrhivulkan_p.h.
Referenced by beginFrame(), beginOffscreenFrame(), destroy(), endFrame(), and endOffscreenFrame().
QBitArray QRhiVulkan::timestampQueryPoolMap |
Definition at line 917 of file qrhivulkan_p.h.
Referenced by beginFrame(), beginOffscreenFrame(), and endOffscreenFrame().
quint32 QRhiVulkan::timestampValidBits = 0 |
Definition at line 845 of file qrhivulkan_p.h.
Referenced by elapsedSecondsFromTimestamp(), and isFeatureSupported().
VkDeviceSize QRhiVulkan::ubufAlign |
Definition at line 863 of file qrhivulkan_p.h.
Referenced by ubufAlignment(), and updateShaderResourceBindings().
bool QRhiVulkan::vertexAttribDivisor = false |
Definition at line 892 of file qrhivulkan_p.h.
PFN_vkAcquireNextImageKHR QRhiVulkan::vkAcquireNextImageKHR |
Definition at line 878 of file qrhivulkan_p.h.
Referenced by beginFrame(), and recreateSwapChain().
PFN_vkCreateSwapchainKHR QRhiVulkan::vkCreateSwapchainKHR = nullptr |
Definition at line 875 of file qrhivulkan_p.h.
Referenced by recreateSwapChain().
PFN_vkDestroySwapchainKHR QRhiVulkan::vkDestroySwapchainKHR |
Definition at line 876 of file qrhivulkan_p.h.
Referenced by recreateSwapChain(), and releaseSwapChainResources().
PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR QRhiVulkan::vkGetPhysicalDeviceSurfaceCapabilitiesKHR |
Definition at line 880 of file qrhivulkan_p.h.
Referenced by createSwapChain(), and recreateSwapChain().
PFN_vkGetPhysicalDeviceSurfaceFormatsKHR QRhiVulkan::vkGetPhysicalDeviceSurfaceFormatsKHR |
Definition at line 881 of file qrhivulkan_p.h.
Referenced by createSwapChain().
PFN_vkGetPhysicalDeviceSurfacePresentModesKHR QRhiVulkan::vkGetPhysicalDeviceSurfacePresentModesKHR |
Definition at line 882 of file qrhivulkan_p.h.
Referenced by createSwapChain().
PFN_vkGetSwapchainImagesKHR QRhiVulkan::vkGetSwapchainImagesKHR |
Definition at line 877 of file qrhivulkan_p.h.
Referenced by recreateSwapChain().
PFN_vkQueuePresentKHR QRhiVulkan::vkQueuePresentKHR |
Definition at line 879 of file qrhivulkan_p.h.
Referenced by endFrame(), and recreateSwapChain().
bool QRhiVulkan::wideLines = false |
Definition at line 890 of file qrhivulkan_p.h.