![]() |
Qt 6.x
The Qt SDK
|
#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 const QRhiShaderResourceBinding::Data * | shaderResourceBindingData (const QRhiShaderResourceBinding &binding) |
static QRhiShaderResourceBinding::Data * | shaderResourceBindingData (QRhiShaderResourceBinding &binding) |
static bool | sortedBindingLessThan (const QRhiShaderResourceBinding &a, const QRhiShaderResourceBinding &b) |
![]() | |
static const int | MAX_SHADER_CACHE_ENTRIES = 128 |
Definition at line 637 of file qrhivulkan_p.h.
using QRhiVulkan::BufferImageCopyList = QVarLengthArray<VkBufferImageCopy, 16> |
Definition at line 783 of file qrhivulkan_p.h.
QRhiVulkan::QRhiVulkan | ( | QRhiVulkanInitParams * | params, |
QRhiVulkanNativeHandles * | importParams = nullptr |
||
) |
Definition at line 341 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 2350 of file qrhivulkan.cpp.
References QRhiTextureRenderTargetDescription::cbeginColorAttachments(), QRhiTextureRenderTargetDescription::cendColorAttachments(), QVkTextureRenderTarget::create(), QRhiImplementation::currentFrameSlot, QVkCommandBuffer::currentPassResTrackerIndex, QVkRenderTargetData::currentResIdList, QVkTextureRenderTarget::d, QRhiRenderBuffer::DepthStencil, QRhiTextureRenderTargetDescription::depthStencilBuffer(), depthStencilExplicitBarrier(), QRhiTextureRenderTargetDescription::depthTexture(), QRhiTextureRenderTarget::description(), it, QVkRenderBuffer::lastActiveFrameSlot, QVkTexture::lastActiveFrameSlot, QVkRenderPassDescriptor::lastActiveFrameSlot, QVkTextureRenderTarget::lastActiveFrameSlot, QRhiTextureRenderTarget::m_desc, QRhiRenderBuffer::m_type, QVkCommandBuffer::passResTrackers, Q_ASSERT, QRHI_RES, QVkRenderTargetData::rp, 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 908 of file qrhivulkan.cpp.
References createDescriptorPool(), descriptorPools, dev, df, i, pool, QVK_DESC_SETS_PER_POOL, and qWarning.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 2575 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 5325 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 1844 of file qrhivulkan.cpp.
References QVkSwapChain::bufferCount, QVkCommandBuffer::cb, QVkSwapChain::cbWrapper, QBitArray::clearBit(), QRhiImplementation::currentFrameSlot, QVkSwapChain::currentFrameSlot, QVkSwapChain::currentImageIndex, currentSwapChain, QVkSwapChainRenderTarget::d, dev, deviceLost, df, QVkSwapChain::ds, elapsedSecondsFromTimestamp(), QRhi::EnableTimestamps, ensureCommandPoolForNewFrame(), QVkRenderTargetData::fb, frame, QRhi::FrameOpDeviceLost, QRhi::FrameOpError, QRhi::FrameOpSuccess, QRhi::FrameOpSwapChainOutOfDate, QVkSwapChain::frameRes, i, QVkSwapChain::imageRes, inst, QVkRenderBuffer::lastActiveFrameSlot, QVkCommandBuffer::lastGpuTime, ok, prepareNewFrame(), QRHI_RES, qWarning, rhiFlags, QVkSwapChain::rtWrapper, QVkSwapChain::sc, QBitArray::setBit(), QBitArray::size(), startPrimaryCommandBuffer(), QBitArray::testBit(), timestampQueryPool, timestampQueryPoolMap, vkAcquireNextImageKHR, waitCommandCompletion(), and QVkSwapChain::window.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 2179 of file qrhivulkan.cpp.
References QRhiVulkan::OffscreenFrame::active, QVkCommandBuffer::cb, cb, QRhiVulkan::OffscreenFrame::cbWrapper, QRhiImplementation::currentFrameSlot, df, QRhi::EnableTimestamps, ensureCommandPoolForNewFrame(), QRhi::FrameOpSuccess, i, ofr, prepareNewFrame(), QVK_FRAMES_IN_FLIGHT, rhiFlags, QBitArray::setBit(), QBitArray::size(), startPrimaryCommandBuffer(), QBitArray::testBit(), QRhiVulkan::OffscreenFrame::timestampQueryIndex, timestampQueryPool, timestampQueryPoolMap, and waitCommandCompletion().
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 2467 of file qrhivulkan.cpp.
References activateTextureRenderTarget(), QVkCommandBuffer::activeSecondaryCbStack, QColor::alphaF(), QVarLengthArray< T, Prealloc >::append(), QVkCommandBuffer::Command::args, QVkCommandBuffer::Command::BeginRenderPass, QVkCommandBuffer::Command::Args::beginRenderPass, QColor::blueF(), cb, QVkCommandBuffer::clearValue, QVkCommandBuffer::Command::Args::clearValueIndex, QVkCommandBuffer::Command::cmd, QVkRenderTargetData::colorAttCount, QVkCommandBuffer::commands, QVarLengthArray< T, Prealloc >::constData(), QRhiImplementation::currentFrameSlot, QVkSwapChain::currentImageIndex, currentSwapChain, QVkCommandBuffer::currentTarget, QVkTextureRenderTarget::d, QRhiDepthStencilClearValue::depthClearValue(), QVkCommandBuffer::Command::Args::desc, QVkRenderTargetData::dsAttCount, enqueueResourceUpdates(), enqueueTransitionPassResources(), QRhiCommandBuffer::ExternalContent, QVkRenderTargetData::fb, QColor::greenF(), QSize::height(), i, QVkSwapChain::imageRes, QVkRenderPassDescriptor::lastActiveFrameSlot, QVkCommandBuffer::NoPass, QVkCommandBuffer::passUsesSecondaryCb, QVkRenderTargetData::pixelSize, QVkCommandBuffer::pools, Q_ASSERT, QRHI_RES, QVkCommandBuffer::recordingPass, QColor::redF(), QVkCommandBuffer::RenderPass, QVkCommandBuffer::resetCachedState(), QVkRenderTargetData::resolveAttCount, QRhiResource::resourceType(), QVkRenderPassDescriptor::rp, QVkRenderTargetData::rp, QVkSwapChain::ImageResources::ScImageUseRender, QVLABaseBase::size(), startSecondaryCommandBuffer(), QRhiDepthStencilClearValue::stencilClearValue(), QRhiResource::SwapChainRenderTarget, QRhiResource::TextureRenderTarget, QVkCommandBuffer::Command::Args::useSecondaryCb, and QSize::width().
uint32_t QRhiVulkan::chooseTransientImageMemType | ( | VkImage | img, |
uint32_t | startIndex | ||
) |
Definition at line 1102 of file qrhivulkan.cpp.
References dev, df, i, and physDev.
Referenced by createTransientImage().
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 4370 of file qrhivulkan.cpp.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 413 of file qrhivulkan.cpp.
References QList< T >::append(), caps, QString::constData(), QList< T >::constData(), QListSpecialMethodsBase< T >::contains(), QList< T >::data(), QVarLengthArray< T, Prealloc >::data(), dev, QRhiDriverInfo::deviceId, QRhiDriverInfo::deviceName, QRhiDriverInfo::deviceType, driverInfoStruct, ext, gfxQueueFamilyIdx, globalVulkanInstance, i, importedDevice, inst, QString::isEmpty(), maybeWindow, physDev, physDevFeatures, physDevProperties, QRhi::PreferSoftwareRenderer, Q_ASSERT, QByteArrayLiteral, qCDebug, qEnvironmentVariableIntValue(), qEnvironmentVariableIsSet(), qgetenv(), QtDebugMsg, qWarning, requestedDeviceExtensions, QList< T >::resize(), rhiFlags, QList< T >::size(), QByteArray::split(), toRhiDeviceType(), and QRhiDriverInfo::vendorId.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 4345 of file qrhivulkan.cpp.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 4740 of file qrhivulkan.cpp.
bool QRhiVulkan::createDefaultRenderPass | ( | QVkRenderPassDescriptor * | rpD, |
bool | hasDepthStencil, | ||
VkSampleCountFlagBits | samples, | ||
VkFormat | colorFormat | ||
) |
Definition at line 1270 of file qrhivulkan.cpp.
References QVarLengthArray< T, Prealloc >::append(), QVkRenderPassDescriptor::attDescs, QVkRenderPassDescriptor::colorRefs, dev, df, QVkRenderPassDescriptor::dsRef, fillRenderPassCreateInfo(), QVkRenderPassDescriptor::hasDepthStencil, QVkRenderPassDescriptor::multiViewCount, optimalDepthStencilFormat(), qWarning, QVkRenderPassDescriptor::resolveRefs, QVkRenderPassDescriptor::rp, and QVkRenderPassDescriptor::subpassDeps.
VkResult QRhiVulkan::createDescriptorPool | ( | VkDescriptorPool * | pool | ) |
Definition at line 887 of file qrhivulkan.cpp.
References dev, df, pool, QVK_COMBINED_IMAGE_SAMPLERS_PER_POOL, QVK_DESC_SETS_PER_POOL, QVK_STORAGE_BUFFERS_PER_POOL, QVK_STORAGE_IMAGES_PER_POOL, and QVK_UNIFORM_BUFFERS_PER_POOL.
Referenced by allocateDescriptorSet().
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 4735 of file qrhivulkan.cpp.
bool QRhiVulkan::createOffscreenRenderPass | ( | QVkRenderPassDescriptor * | rpD, |
const QRhiColorAttachment * | firstColorAttachment, | ||
const QRhiColorAttachment * | lastColorAttachment, | ||
bool | preserveColor, | ||
bool | preserveDs, | ||
QRhiRenderBuffer * | depthStencilBuffer, | ||
QRhiTexture * | depthTexture | ||
) |
Definition at line 1391 of file qrhivulkan.cpp.
References QVarLengthArray< T, Prealloc >::append(), QVkRenderPassDescriptor::attDescs, caps, QVkRenderPassDescriptor::colorRefs, dev, df, QVkRenderPassDescriptor::dsRef, fillRenderPassCreateInfo(), QRhiTexture::format(), QVkRenderPassDescriptor::hasDepthStencil, it, QVkRenderPassDescriptor::multiViewCount, MultiViewRenderPassSetupHelper::prepare(), Q_ASSERT, QRHI_RES, qWarning, QVkRenderPassDescriptor::resolveRefs, QVkRenderPassDescriptor::rp, QVkRenderBuffer::samples, QVkTexture::samples, QVLABaseBase::size(), QVkRenderBuffer::vkformat, and QVkTexture::vkformat.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 4708 of file qrhivulkan.cpp.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 4722 of file qrhivulkan.cpp.
VkShaderModule QRhiVulkan::createShader | ( | const QByteArray & | spirv | ) |
Definition at line 2791 of file qrhivulkan.cpp.
References QByteArray::constData(), dev, df, qWarning, and QByteArray::size().
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 4745 of file qrhivulkan.cpp.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 4332 of file qrhivulkan.cpp.
References qWarning, vkGetPhysicalDeviceSurfaceCapabilitiesKHR, vkGetPhysicalDeviceSurfaceFormatsKHR, and vkGetPhysicalDeviceSurfacePresentModesKHR.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 4715 of file qrhivulkan.cpp.
|
overridevirtual |
bool QRhiVulkan::createTransientImage | ( | VkFormat | format, |
const QSize & | pixelSize, | ||
VkImageUsageFlags | usage, | ||
VkImageAspectFlags | aspectMask, | ||
VkSampleCountFlagBits | samples, | ||
VkDeviceMemory * | mem, | ||
VkImage * | images, | ||
VkImageView * | views, | ||
int | count | ||
) |
Definition at line 1134 of file qrhivulkan.cpp.
References aligned(), chooseTransientImageMemType(), dev, df, QSize::height(), i, images, qWarning, and QSize::width().
Referenced by recreateSwapChain().
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 5230 of file qrhivulkan.cpp.
References QVkCommandBuffer::activeSecondaryCbStack, QVarLengthArray< T, Prealloc >::append(), QVkCommandBuffer::Command::args, caps, cb, QVkCommandBuffer::Command::cmd, QVkCommandBuffer::commands, QVkCommandBuffer::Command::DebugMarkerBegin, QVkCommandBuffer::Command::Args::debugMarkerBegin, QVkCommandBuffer::debugMarkerData, QRhiImplementation::debugMarkers, QVarLengthArray< T, Prealloc >::last(), QVkCommandBuffer::NoPass, QVkCommandBuffer::passUsesSecondaryCb, QVkCommandBuffer::pools, Q_UNUSED, QRHI_RES, QVkCommandBuffer::recordingPass, and QVLABaseBase::size().
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 5256 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 5274 of file qrhivulkan.cpp.
References QVkCommandBuffer::activeSecondaryCbStack, QVarLengthArray< T, Prealloc >::append(), QVkCommandBuffer::Command::args, caps, cb, QVkCommandBuffer::Command::cmd, QVkCommandBuffer::commands, QByteArray::constData(), QVkCommandBuffer::debugMarkerData, QVkCommandBuffer::Command::DebugMarkerInsert, QVkCommandBuffer::Command::Args::debugMarkerInsert, QRhiImplementation::debugMarkers, QVarLengthArray< T, Prealloc >::last(), QVkCommandBuffer::NoPass, QVkCommandBuffer::passUsesSecondaryCb, QVkCommandBuffer::pools, Q_UNUSED, QRHI_RES, QVkCommandBuffer::recordingPass, and QVLABaseBase::size().
void QRhiVulkan::depthStencilExplicitBarrier | ( | QVkCommandBuffer * | cbD, |
QVkRenderBuffer * | rbD | ||
) |
Definition at line 3076 of file qrhivulkan.cpp.
References QVarLengthArray< T, Prealloc >::append(), QVkCommandBuffer::Command::args, QVkCommandBuffer::Command::cmd, QVkCommandBuffer::commands, QVkCommandBuffer::Command::Args::count, QVkCommandBuffer::Command::Args::dstStageMask, QVkRenderBuffer::image, QVkCommandBuffer::Command::ImageBarrier, QVkCommandBuffer::Command::Args::imageBarrier, QVkCommandBuffer::imageBarrier, QVkCommandBuffer::Command::Args::index, QVkCommandBuffer::NoPass, QVkCommandBuffer::pools, Q_ASSERT, QVkCommandBuffer::recordingPass, QVLABaseBase::size(), and QVkCommandBuffer::Command::Args::srcStageMask.
Referenced by activateTextureRenderTarget().
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 832 of file qrhivulkan.cpp.
References allocator, QVkCommandBuffer::cb, QRhiVulkan::OffscreenFrame::cbWrapper, QVarLengthArray< T, Prealloc >::clear(), QRhiVulkan::OffscreenFrame::cmdFence, 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 2660 of file qrhivulkan.cpp.
References QVkCommandBuffer::activeSecondaryCbStack, QVarLengthArray< T, Prealloc >::append(), QVkCommandBuffer::Command::args, QVarLengthArray< T, Prealloc >::at(), QHash< Key, T >::begin(), QVkCommandBuffer::Command::BufferBarrier, QVkCommandBuffer::Command::Args::bufferBarrier, QVkCommandBuffer::bufferBarrier, QRhiShaderResourceBinding::BufferLoad, QRhiShaderResourceBinding::BufferLoadStore, QVkBuffer::buffers, QRhiShaderResourceBinding::BufferStore, cb, QVkCommandBuffer::Command::cmd, QVkCommandBuffer::commands, QVkCommandBuffer::ComputePass, QVkCommandBuffer::computePassState, QVarLengthArray< T, Prealloc >::constData(), QVkCommandBuffer::Command::Args::count, QVkCommandBuffer::currentComputeSrb, QRhiImplementation::currentFrameSlot, df, QVkCommandBuffer::Command::Dispatch, QVkCommandBuffer::Command::Args::dispatch, QVkCommandBuffer::Command::Args::dstStageMask, QRhiBuffer::Dynamic, QHash< Key, T >::end(), QHash< Key, T >::erase(), i, QVkTexture::image, QVkCommandBuffer::Command::ImageBarrier, QVkCommandBuffer::Command::Args::imageBarrier, QVkCommandBuffer::imageBarrier, QRhiShaderResourceBinding::ImageLoad, QRhiShaderResourceBinding::ImageLoadStore, QRhiShaderResourceBinding::ImageStore, QVkCommandBuffer::Command::Args::index, QVarLengthArray< T, Prealloc >::isEmpty(), it, QVarLengthArray< T, Prealloc >::last(), QVkTexture::UsageState::layout, QRhiShaderResourceBindings::m_bindings, QRhiBuffer::m_type, QVkCommandBuffer::passUsesSecondaryCb, QVkCommandBuffer::pools, Q_ASSERT, QRHI_RES, qrhivk_accumulateComputeResource(), QVkCommandBuffer::recordingPass, QRhiImplementation::shaderResourceBindingData(), QVLABaseBase::size(), QVkCommandBuffer::Command::Args::srcStageMask, QRhiResource::Texture, QVkTexture::usageState, QVkCommandBuffer::writtenResources, QVkCommandBuffer::Command::Args::x, QVkCommandBuffer::Command::Args::y, and QVkCommandBuffer::Command::Args::z.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 5192 of file qrhivulkan.cpp.
References QVkCommandBuffer::activeSecondaryCbStack, QVkCommandBuffer::Command::args, cb, QVkCommandBuffer::Command::cmd, QVkCommandBuffer::commands, df, QVkCommandBuffer::Command::Draw, QVkCommandBuffer::Command::Args::draw, QVkCommandBuffer::Command::Args::firstInstance, QVkCommandBuffer::Command::Args::firstVertex, instanceCount, QVkCommandBuffer::Command::Args::instanceCount, QVarLengthArray< T, Prealloc >::last(), QVkCommandBuffer::passUsesSecondaryCb, Q_ASSERT, QRHI_RES, QVkCommandBuffer::recordingPass, QVkCommandBuffer::RenderPass, and QVkCommandBuffer::Command::Args::vertexCount.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 5210 of file qrhivulkan.cpp.
References QVkCommandBuffer::activeSecondaryCbStack, QVkCommandBuffer::Command::args, cb, QVkCommandBuffer::Command::cmd, QVkCommandBuffer::commands, df, QVkCommandBuffer::Command::DrawIndexed, QVkCommandBuffer::Command::Args::drawIndexed, QVkCommandBuffer::Command::Args::firstIndex, QVkCommandBuffer::Command::Args::firstInstance, QVkCommandBuffer::Command::Args::indexCount, instanceCount, QVkCommandBuffer::Command::Args::instanceCount, QVarLengthArray< T, Prealloc >::last(), QVkCommandBuffer::passUsesSecondaryCb, Q_ASSERT, QRHI_RES, QVkCommandBuffer::recordingPass, QVkCommandBuffer::RenderPass, and QVkCommandBuffer::Command::Args::vertexOffset.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 4544 of file qrhivulkan.cpp.
References driverInfoStruct.
VkSampleCountFlagBits QRhiVulkan::effectiveSampleCount | ( | int | sampleCount | ) |
Definition at line 3940 of file qrhivulkan.cpp.
References contains(), qBound(), qvk_sampleCounts, qWarning, and supportedSampleCounts().
double QRhiVulkan::elapsedSecondsFromTimestamp | ( | quint64 | timestamp[2], |
bool * | ok | ||
) |
Definition at line 1826 of file qrhivulkan.cpp.
References i, ok, physDevProperties, qFuzzyIsNull(), and timestampValidBits.
Referenced by beginFrame(), and endOffscreenFrame().
void QRhiVulkan::endAndEnqueueSecondaryCommandBuffer | ( | VkCommandBuffer | cb, |
QVkCommandBuffer * | cbD | ||
) |
Definition at line 2450 of file qrhivulkan.cpp.
References QVkCommandBuffer::Command::args, QVkCommandBuffer::Command::Args::cb, cb, QVkCommandBuffer::Command::cmd, QVkCommandBuffer::commands, QRhiImplementation::currentFrameSlot, df, e, QVkCommandBuffer::Command::ExecuteSecondary, QVkCommandBuffer::Command::Args::executeSecondary, qWarning, releaseQueue, and QRhiVulkan::DeferredReleaseEntry::SecondaryCommandBuffer.
Referenced by beginExternal(), endComputePass(), endExternal(), and endPass().
QRhi::FrameOpResult QRhiVulkan::endAndSubmitPrimaryCommandBuffer | ( | VkCommandBuffer | cb, |
VkFence | cmdFence, | ||
VkSemaphore * | waitSem, | ||
VkSemaphore * | signalSem | ||
) |
Definition at line 2123 of file qrhivulkan.cpp.
References cb, deviceLost, df, QRhi::FrameOpDeviceLost, QRhi::FrameOpError, QRhi::FrameOpSuccess, gfxQueue, and qWarning.
Referenced by endFrame(), endOffscreenFrame(), and finish().
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 2598 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 5362 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 1955 of file qrhivulkan.cpp.
References QVkSwapChain::bufferCount, QVkSwapChain::cbWrapper, QVkSwapChain::currentFrameSlot, QVkSwapChain::currentImageIndex, currentSwapChain, deviceLost, df, endAndSubmitPrimaryCommandBuffer(), endFrame(), frame, QVkSwapChain::frameCount, QRhi::FrameOpDeviceLost, QRhi::FrameOpError, QRhi::FrameOpSuccess, QRhi::FrameOpSwapChainOutOfDate, QVkSwapChain::frameRes, gfxQueue, QVkSwapChain::imageRes, inst, Q_ASSERT, QRHI_RES, qScopeGuard(), QVK_FRAMES_IN_FLIGHT, qWarning, recordPrimaryCommandBuffer(), QVkSwapChain::sc, QVkSwapChain::ImageResources::ScImageUseNone, QVkSwapChain::ImageResources::ScImageUseRender, QVkSwapChain::ImageResources::ScImageUseTransferSource, QRhi::SkipPresent, timestampQueryPool, vkQueuePresentKHR, and QVkSwapChain::window.
Referenced by endFrame().
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 2226 of file qrhivulkan.cpp.
References QRhiVulkan::OffscreenFrame::active, QVkCommandBuffer::cb, QRhiVulkan::OffscreenFrame::cbWrapper, QBitArray::clearBit(), QRhiVulkan::OffscreenFrame::cmdFence, QRhiImplementation::currentFrameSlot, dev, df, elapsedSecondsFromTimestamp(), endAndSubmitPrimaryCommandBuffer(), finishActiveReadbacks(), QRhi::FrameOpError, QRhi::FrameOpSuccess, QVkCommandBuffer::lastGpuTime, ofr, ok, Q_ASSERT, Q_UNUSED, qWarning, recordPrimaryCommandBuffer(), QRhiVulkan::OffscreenFrame::timestampQueryIndex, timestampQueryPool, and timestampQueryPoolMap.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 2554 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 3254 of file qrhivulkan.cpp.
References QVkTexture::UsageState::access, QRhiResourceUpdateBatchPrivate::activeBufferOpCount, activeBufferReadbacks, QRhiVulkan::TextureReadback::activeFrameSlot, QRhiVulkan::BufferReadback::activeFrameSlot, QRhiResourceUpdateBatchPrivate::activeTextureOpCount, activeTextureReadbacks, allocation, QVkBuffer::allocations, allocator, QVarLengthArray< T, Prealloc >::append(), QVkCommandBuffer::Command::args, QVkCommandBuffer::Command::BlitImage, QVkCommandBuffer::Command::Args::blitImage, QRhiResourceUpdateBatchPrivate::BufferOp::buf, QVkCommandBuffer::bufferImageCopy, QVkCommandBuffer::Command::Args::bufferImageCopyIndex, QRhiResourceUpdateBatchPrivate::bufferOps, QVkBuffer::buffers, QRhiVulkan::TextureReadback::byteSize, QRhiVulkan::BufferReadback::byteSize, QVkCommandBuffer::Command::cmd, QVkSwapChain::colorFormat, QVkCommandBuffer::commands, QRhiReadbackResult::completed, QVarLengthArray< T, Prealloc >::constData(), QRhiBufferData::constData(), QRhiResourceUpdateBatchPrivate::TextureOp::Copy, QVkCommandBuffer::Command::CopyBuffer, QVkCommandBuffer::Command::Args::copyBuffer, QVkCommandBuffer::Command::CopyBufferToImage, QVkCommandBuffer::Command::Args::copyBufferToImage, QVkCommandBuffer::Command::CopyImage, QVkCommandBuffer::Command::Args::copyImage, QVkCommandBuffer::Command::CopyImageToBuffer, QVkCommandBuffer::Command::Args::copyImageToBuffer, QVkCommandBuffer::Command::Args::count, QRhiTexture::CubeMap, QRhiImplementation::currentFrameSlot, QVkSwapChain::currentImageIndex, currentSwapChain, QByteArray::data(), QRhiReadbackResult::data, QRhiResourceUpdateBatchPrivate::BufferOp::data, QRhiResourceUpdateBatchPrivate::TextureOp::desc, QVkCommandBuffer::Command::Args::desc, QRhiVulkan::TextureReadback::desc, QRhiTextureCopyDescription::destinationLayer(), QRhiTextureCopyDescription::destinationLevel(), QRhiTextureCopyDescription::destinationTopLeft(), QRhiResourceUpdateBatchPrivate::TextureOp::dst, QVkCommandBuffer::Command::Args::dst, QVkCommandBuffer::Command::Args::dstLayout, QRhiBuffer::Dynamic, QRhiResourceUpdateBatchPrivate::BufferOp::DynamicUpdate, e, executeBufferHostWritesForSlot(), QVkCommandBuffer::Command::Args::filter, QRhiVulkan::TextureReadback::format, QRhiResourceUpdateBatchPrivate::free(), QRhiResourceUpdateBatchPrivate::TextureOp::GenMips, QRhiResourceUpdateBatchPrivate::get(), QSize::height(), i, QVkTexture::image, QVkSwapChain::ImageResources::image, QVkSwapChain::imageRes, QRhiBuffer::Immutable, QList< T >::isEmpty(), QSize::isEmpty(), QVkBuffer::lastActiveFrameSlot, QVkTexture::lastActiveFrameSlot, QVkSwapChain::ImageResources::lastUse, QRhiReadbackDescription::layer(), QVkTexture::UsageState::layout, QRhiReadbackDescription::level(), QRhiTexture::m_arraySize, QRhiTexture::m_depth, QRhiTexture::m_flags, QRhiTexture::m_format, QRhiTexture::m_pixelSize, QRhiBuffer::m_size, QRhiBuffer::m_type, QRhi::MAX_MIP_LEVELS, QVkTexture::mipLevelCount, QRhiResourceUpdateBatchPrivate::BufferOp::offset, QVkBuffer::pendingDynamicUpdates, QRhiTextureCopyDescription::pixelSize(), QVkSwapChain::pixelSize, QRhiVulkan::TextureReadback::pixelSize, QVkCommandBuffer::pools, prepareUploadSubres(), Q_ASSERT, qMax(), QRHI_RES, QVK_FRAMES_IN_FLIGHT, qWarning, QRhiResourceUpdateBatchPrivate::TextureOp::rb, QRhiResourceUpdateBatchPrivate::BufferOp::Read, QRhiResourceUpdateBatchPrivate::TextureOp::Read, QRhiResourceUpdateBatchPrivate::BufferOp::readSize, releaseQueue, QByteArray::resize(), QRhiResourceUpdateBatchPrivate::BufferOp::result, QRhiResourceUpdateBatchPrivate::TextureOp::result, QRhiVulkan::TextureReadback::result, QRhiVulkan::BufferReadback::result, QVkTexture::samples, QVkSwapChain::ImageResources::ScImageUseRender, QVkSwapChain::ImageResources::ScImageUseTransferSource, QRhiBufferData::size(), QVLABaseBase::size(), QRhiTextureCopyDescription::sourceLayer(), QRhiTextureCopyDescription::sourceLevel(), QRhiTextureCopyDescription::sourceTopLeft(), QRhiResourceUpdateBatchPrivate::TextureOp::src, QVkCommandBuffer::Command::Args::src, QVkCommandBuffer::Command::Args::srcLayout, QVkTexture::UsageState::stage, QRhiVulkan::TextureReadback::stagingAlloc, QRhiVulkan::BufferReadback::stagingAlloc, QVkBuffer::stagingAllocations, QVkTexture::stagingAllocations, QRhiVulkan::TextureReadback::stagingBuf, QRhiVulkan::BufferReadback::stagingBuf, QRhiVulkan::DeferredReleaseEntry::StagingBuffer, QVkBuffer::stagingBuffers, QVkTexture::stagingBuffers, QRhiResourceUpdateBatchPrivate::BufferOp::StaticUpload, QRhiResourceUpdateBatchPrivate::TextureOp::subresDesc, subresourceBarrier(), subresUploadByteSize(), QVkSwapChain::supportsReadback, swapchainReadbackTextureFormat(), QRhiReadbackDescription::texture(), QRhiTexture::TextureArray, QRhiImplementation::textureFormatInfo(), QRhiResourceUpdateBatchPrivate::textureOps, QRhiTexture::ThreeDimensional, toVmaAllocation(), toVmaAllocator(), trackedBufferBarrier(), trackedImageBarrier(), QRhiResourceUpdateBatchPrivate::BufferOp::type, QRhiResourceUpdateBatchPrivate::TextureOp::type, QRhiTexture::UnknownFormat, QRhiResourceUpdateBatchPrivate::TextureOp::Upload, QVkTexture::usageState, QRhiTexture::UsedWithGenerateMips, QSize::width(), QPoint::x(), and QPoint::y().
Referenced by beginComputePass(), beginPass(), endComputePass(), endPass(), and resourceUpdate().
void QRhiVulkan::enqueueTransitionPassResources | ( | QVkCommandBuffer * | cbD | ) |
Definition at line 3958 of file qrhivulkan.cpp.
References QVarLengthArray< T, Prealloc >::append(), QVkCommandBuffer::Command::args, QVkCommandBuffer::Command::cmd, QVkCommandBuffer::commands, QVkCommandBuffer::currentPassResTrackerIndex, QVkCommandBuffer::passResTrackers, QVLABaseBase::size(), QVkCommandBuffer::Command::Args::trackerIndex, QVkCommandBuffer::Command::TransitionPassResources, and QVkCommandBuffer::Command::Args::transitionResources.
Referenced by beginComputePass(), and beginPass().
void QRhiVulkan::ensureCommandPoolForNewFrame | ( | ) |
Definition at line 1812 of file qrhivulkan.cpp.
References cmdPool, QRhiImplementation::currentFrameSlot, dev, df, and releaseCachedResourcesCalledBeforeFrameStart.
Referenced by beginFrame(), beginOffscreenFrame(), and finish().
bool QRhiVulkan::ensurePipelineCache | ( | const void * | initialData = nullptr , |
size_t | initialDataSize = 0 |
||
) |
Definition at line 2806 of file qrhivulkan.cpp.
References dev, df, pipelineCache, and qWarning.
Referenced by setPipelineCacheData().
Definition at line 3732 of file qrhivulkan.cpp.
References QVkBuffer::allocations, allocator, QRhiBuffer::Dynamic, QRhiBuffer::m_type, QVkBuffer::pendingDynamicUpdates, Q_ASSERT, qWarning, toVmaAllocation(), and toVmaAllocator().
Referenced by enqueueResourceUpdates(), setShaderResources(), and setVertexInput().
Definition at line 3796 of file qrhivulkan.cpp.
References allocator, QVarLengthArray< T, Prealloc >::append(), QRhiVulkan::DeferredReleaseEntry::Buffer, QRhiImplementation::currentFrameSlot, descriptorPools, dev, df, e, freeSecondaryCbs, i, QVkRenderTargetData::MAX_COLOR_ATTACHMENTS, QRhiVulkan::DeferredReleaseEntry::Pipeline, Q_ASSERT, qrhivk_releaseBuffer(), qrhivk_releaseRenderBuffer(), qrhivk_releaseSampler(), qrhivk_releaseTexture(), releaseQueue, QRhiVulkan::DeferredReleaseEntry::RenderBuffer, QRhiVulkan::DeferredReleaseEntry::RenderPass, QRhiVulkan::DeferredReleaseEntry::Sampler, QRhiVulkan::DeferredReleaseEntry::SecondaryCommandBuffer, QRhiVulkan::DeferredReleaseEntry::ShaderResourceBindings, QRhiVulkan::DeferredReleaseEntry::StagingBuffer, QRhiVulkan::DeferredReleaseEntry::Texture, QRhiVulkan::DeferredReleaseEntry::TextureRenderTarget, toVmaAllocation(), and toVmaAllocator().
Referenced by destroy(), finish(), and prepareNewFrame().
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 2284 of file qrhivulkan.cpp.
References QRhiVulkan::OffscreenFrame::active, QVkCommandBuffer::cb, cb, QVkSwapChain::cbWrapper, QRhiVulkan::OffscreenFrame::cbWrapper, QRhiImplementation::currentFrameSlot, QVkSwapChain::currentFrameSlot, currentSwapChain, df, endAndSubmitPrimaryCommandBuffer(), ensureCommandPoolForNewFrame(), executeDeferredReleases(), finishActiveReadbacks(), frame, QRhi::FrameOpSuccess, QVkSwapChain::frameRes, gfxQueue, QRhiImplementation::inFrame, QVkCommandBuffer::NoPass, ofr, Q_ASSERT, QVkCommandBuffer::recordingPass, recordPrimaryCommandBuffer(), QVkCommandBuffer::resetCommands(), and startPrimaryCommandBuffer().
Definition at line 3850 of file qrhivulkan.cpp.
References activeBufferReadbacks, QRhiVulkan::TextureReadback::activeFrameSlot, QRhiVulkan::BufferReadback::activeFrameSlot, activeTextureReadbacks, allocator, QRhiVulkan::TextureReadback::byteSize, QRhiVulkan::BufferReadback::byteSize, QRhiReadbackResult::completed, QRhiImplementation::currentFrameSlot, QByteArray::data(), QRhiReadbackResult::data, f, QRhiReadbackResult::format, QRhiVulkan::TextureReadback::format, i, QRhiReadbackResult::pixelSize, QRhiVulkan::TextureReadback::pixelSize, qWarning, QByteArray::resize(), QRhiVulkan::TextureReadback::result, QRhiVulkan::BufferReadback::result, QRhiVulkan::TextureReadback::stagingAlloc, QRhiVulkan::BufferReadback::stagingAlloc, QRhiVulkan::TextureReadback::stagingBuf, QRhiVulkan::BufferReadback::stagingBuf, toVmaAllocation(), toVmaAllocator(), and void.
Referenced by destroy(), endOffscreenFrame(), finish(), and prepareNewFrame().
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 4365 of file qrhivulkan.cpp.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 4580 of file qrhivulkan.cpp.
References deviceLost.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 4411 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::ScreenSpaceDerivatives, QRhi::Tessellation, QRhi::TexelFetch, QRhi::TextureArrayRange, QRhi::TextureArrays, QRhi::ThreeDimensionalTextureMipmaps, QRhi::ThreeDimensionalTextures, QRhi::Timestamps, timestampValidBits, QRhi::TriangleFanTopology, QRhi::VertexShaderPointSize, and QRhi::WideLines.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 4385 of file qrhivulkan.cpp.
References QRhiTexture::ASTC_12x12, QRhiTexture::ASTC_4x4, QRhiTexture::BC1, QRhiTexture::BC7, QRhiTexture::ETC2_RGB8, QRhiTexture::ETC2_RGBA8, physDev, physDevFeatures, and toVkTextureFormat().
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 4355 of file qrhivulkan.cpp.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 4360 of file qrhivulkan.cpp.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 5378 of file qrhivulkan.cpp.
References cb, QVkCommandBuffer::lastGpuTime, and QRHI_RES.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 4569 of file qrhivulkan.cpp.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 4539 of file qrhivulkan.cpp.
References nativeHandlesStruct.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 5300 of file qrhivulkan.cpp.
VkFormat QRhiVulkan::optimalDepthStencilFormat | ( | ) |
Definition at line 1223 of file qrhivulkan.cpp.
References optimalDsFormat, physDev, and qWarning.
Referenced by createDefaultRenderPass().
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 4597 of file qrhivulkan.cpp.
References dev, df, QRhi::EnablePipelineCacheDataSave, header(), headerSize, physDevProperties, pipelineCache, QRhiImplementation::pipelineCacheRhiId(), Q_STATIC_ASSERT, qCDebug, and rhiFlags.
void QRhiVulkan::prepareNewFrame | ( | QRhiCommandBuffer * | cb | ) |
Definition at line 2062 of file qrhivulkan.cpp.
References cb, executeDeferredReleases(), finishActiveReadbacks(), QRHI_RES, and releaseCachedResourcesCalledBeforeFrameStart.
Referenced by beginFrame(), and beginOffscreenFrame().
void QRhiVulkan::prepareUploadSubres | ( | QVkTexture * | texD, |
int | layer, | ||
int | level, | ||
const QRhiTextureSubresourceUploadDescription & | subresDesc, | ||
size_t * | curOfs, | ||
void * | mp, | ||
BufferImageCopyList * | copyInfos | ||
) |
Definition at line 3146 of file qrhivulkan.cpp.
References aligned(), QVarLengthArray< T, Prealloc >::append(), QRhiImplementation::compressedFormatInfo(), QByteArray::constData(), QRhiTextureSubresourceUploadDescription::data(), QRhiTextureSubresourceUploadDescription::dataStride(), QRhiTextureSubresourceUploadDescription::destinationTopLeft(), QSize::height(), QRhiTextureSubresourceUploadDescription::image(), QRhiImplementation::isCompressedFormat(), QByteArray::isEmpty(), QSize::isEmpty(), QPoint::isNull(), QRhiTexture::m_flags, QRhiTexture::m_format, QRhiTexture::m_pixelSize, 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::recordPrimaryCommandBuffer | ( | QVkCommandBuffer * | cbD | ) |
Definition at line 3968 of file qrhivulkan.cpp.
References QVkCommandBuffer::Command::args, QVkCommandBuffer::Command::BeginRenderPass, QVkCommandBuffer::Command::Args::beginRenderPass, QVkCommandBuffer::Command::BindDescriptorSet, QVkCommandBuffer::Command::Args::bindDescriptorSet, QVkCommandBuffer::Command::BindIndexBuffer, QVkCommandBuffer::Command::Args::bindIndexBuffer, QVkCommandBuffer::Command::BindPipeline, QVkCommandBuffer::Command::Args::bindPipeline, QVkCommandBuffer::Command::Args::bindPoint, QVkCommandBuffer::Command::BindVertexBuffer, QVkCommandBuffer::Command::Args::bindVertexBuffer, QVkCommandBuffer::Command::BlitImage, QVkCommandBuffer::Command::Args::blitImage, QVkCommandBuffer::Command::Args::buf, QVkCommandBuffer::Command::BufferBarrier, QVkCommandBuffer::Command::Args::bufferBarrier, QVkCommandBuffer::bufferBarrier, QVkCommandBuffer::bufferImageCopy, QVkCommandBuffer::Command::Args::bufferImageCopyIndex, QVkCommandBuffer::Command::Args::c, QVkCommandBuffer::cb, QVkCommandBuffer::Command::Args::cb, QVkCommandBuffer::clearValue, QVkCommandBuffer::Command::Args::clearValueIndex, QVkCommandBuffer::Command::cmd, QVkCommandBuffer::commands, QVarLengthArray< T, Prealloc >::constData(), QVkCommandBuffer::Command::CopyBuffer, QVkCommandBuffer::Command::Args::copyBuffer, QVkCommandBuffer::Command::CopyBufferToImage, QVkCommandBuffer::Command::Args::copyBufferToImage, QVkCommandBuffer::Command::CopyImage, QVkCommandBuffer::Command::Args::copyImage, QVkCommandBuffer::Command::CopyImageToBuffer, QVkCommandBuffer::Command::Args::copyImageToBuffer, QVkCommandBuffer::Command::Args::count, QVkCommandBuffer::Command::DebugMarkerBegin, QVkCommandBuffer::Command::Args::debugMarkerBegin, QVkCommandBuffer::debugMarkerData, QVkCommandBuffer::Command::DebugMarkerEnd, QVkCommandBuffer::Command::DebugMarkerInsert, QVkCommandBuffer::Command::Args::debugMarkerInsert, QVkCommandBuffer::Command::Args::desc, QVkCommandBuffer::Command::Args::descSet, df, QVkCommandBuffer::Command::Dispatch, QVkCommandBuffer::Command::Args::dispatch, QVkCommandBuffer::Command::Draw, QVkCommandBuffer::Command::Args::draw, QVkCommandBuffer::Command::DrawIndexed, QVkCommandBuffer::Command::Args::drawIndexed, QVkCommandBuffer::Command::Args::dst, QVkCommandBuffer::Command::Args::dstLayout, QVkCommandBuffer::Command::Args::dstStageMask, QVkCommandBuffer::dynamicOffset, QVkCommandBuffer::Command::Args::dynamicOffsetCount, QVkCommandBuffer::Command::Args::dynamicOffsetIndex, QVkCommandBuffer::Command::EndRenderPass, QVkCommandBuffer::Command::ExecuteSecondary, QVkCommandBuffer::Command::Args::executeSecondary, QVkCommandBuffer::Command::Args::filter, QVkCommandBuffer::Command::Args::firstIndex, QVkCommandBuffer::Command::Args::firstInstance, QVkCommandBuffer::Command::Args::firstVertex, QVkCommandBuffer::Command::ImageBarrier, QVkCommandBuffer::Command::Args::imageBarrier, QVkCommandBuffer::imageBarrier, QVkCommandBuffer::Command::Args::index, QVkCommandBuffer::Command::Args::indexCount, QVkCommandBuffer::Command::Args::instanceCount, it, QVkCommandBuffer::NoPass, QVkCommandBuffer::Command::Args::ofs, QVkCommandBuffer::passResTrackers, QVkCommandBuffer::Command::Args::pipeline, QVkCommandBuffer::Command::Args::pipelineLayout, QVkCommandBuffer::pools, Q_ASSERT, QVkCommandBuffer::recordingPass, recordTransitionPassResources(), QVkCommandBuffer::Command::Args::ref, QVkCommandBuffer::Command::Args::scissor, QVkCommandBuffer::Command::SetBlendConstants, QVkCommandBuffer::Command::Args::setBlendConstants, QVkCommandBuffer::Command::SetScissor, QVkCommandBuffer::Command::Args::setScissor, QVkCommandBuffer::Command::SetStencilRef, QVkCommandBuffer::Command::Args::setStencilRef, QVkCommandBuffer::Command::SetViewport, QVkCommandBuffer::Command::Args::setViewport, QVkCommandBuffer::Command::Args::src, QVkCommandBuffer::Command::Args::srcLayout, QVkCommandBuffer::Command::Args::srcStageMask, QVkCommandBuffer::Command::Args::startBinding, QVkCommandBuffer::Command::Args::trackerIndex, QVkCommandBuffer::Command::TransitionPassResources, QVkCommandBuffer::Command::Args::transitionResources, QVkCommandBuffer::Command::Args::type, QVkCommandBuffer::Command::Args::useSecondaryCb, QVkCommandBuffer::vertexBuffer, QVkCommandBuffer::Command::Args::vertexBufferIndex, QVkCommandBuffer::vertexBufferOffset, QVkCommandBuffer::Command::Args::vertexBufferOffsetIndex, QVkCommandBuffer::Command::Args::vertexCount, QVkCommandBuffer::Command::Args::vertexOffset, QVkCommandBuffer::Command::Args::viewport, QVkCommandBuffer::Command::Args::x, QVkCommandBuffer::Command::Args::y, and QVkCommandBuffer::Command::Args::z.
Referenced by beginExternal(), endFrame(), endOffscreenFrame(), and finish().
void QRhiVulkan::recordTransitionPassResources | ( | QVkCommandBuffer * | cbD, |
const QRhiPassResourceTracker & | tracker | ||
) |
Definition at line 4269 of file qrhivulkan.cpp.
References accessIsWrite(), aspectMaskForTextureFormat(), QVkBuffer::buffers, QVkCommandBuffer::cb, QRhiPassResourceTracker::cbeginBuffers(), QRhiPassResourceTracker::cbeginTextures(), QRhiPassResourceTracker::cendBuffers(), QRhiPassResourceTracker::cendTextures(), df, QVkTexture::image, QRhiPassResourceTracker::isEmpty(), it, layout, QRhiTexture::m_format, QRHI_RES, toVkAccess(), toVkBufferUsageState(), toVkLayout(), toVkPipelineStage(), and toVkTextureUsageState().
Referenced by recordPrimaryCommandBuffer().
bool QRhiVulkan::recreateSwapChain | ( | QRhiSwapChain * | swapChain | ) |
Definition at line 1517 of file qrhivulkan.cpp.
References QVkSwapChain::bufferCount, QVkSwapChain::colorFormat, QVkSwapChain::colorSpace, QVarLengthArray< T, Prealloc >::contains(), createTransientImage(), QVkSwapChain::currentFrameSlot, QVkSwapChain::currentImageIndex, QVarLengthArray< T, Prealloc >::data(), dev, df, frame, QVkSwapChain::frameRes, QSize::height(), i, QVkSwapChain::imageRes, QSize::isEmpty(), QVkSwapChain::lastConnectedSurface, QRhiSwapChain::m_flags, QRhiSwapChain::MinimalBufferCount, QVkSwapChain::msaaImageMem, QRhiSwapChain::NoVSync, physDev, QVkSwapChain::pixelSize, qCDebug, qMax(), QRHI_RES, QVK_FRAMES_IN_FLIGHT, qWarning, releaseSwapChainResources(), QVkSwapChain::samples, QVkSwapChain::sc, QVkSwapChain::ImageResources::ScImageUseNone, QVkSwapChain::supportedPresentationModes, QVkSwapChain::supportsReadback, QVkSwapChain::surface, QRhiSwapChain::SurfaceHasNonPreMulAlpha, QRhiSwapChain::SurfaceHasPreMulAlpha, QRhiSwapChain::UsedAsTransferSource, vkAcquireNextImageKHR, vkCreateSwapchainKHR, vkDestroySwapchainKHR, vkGetPhysicalDeviceSurfaceCapabilitiesKHR, vkGetSwapchainImagesKHR, vkQueuePresentKHR, and QSize::width().
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 4575 of file qrhivulkan.cpp.
References releaseCachedResourcesCalledBeforeFrameStart.
void QRhiVulkan::releaseSwapChainResources | ( | QRhiSwapChain * | swapChain | ) |
Definition at line 1745 of file qrhivulkan.cpp.
References QVkSwapChain::bufferCount, dev, deviceLost, df, frame, QVkSwapChain::frameRes, i, QVkSwapChain::imageRes, QVkSwapChain::msaaImageMem, QRHI_RES, QVK_FRAMES_IN_FLIGHT, QVkSwapChain::sc, and vkDestroySwapchainKHR.
Referenced by recreateSwapChain().
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 4501 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 2400 of file qrhivulkan.cpp.
References cb, enqueueResourceUpdates(), QVkCommandBuffer::NoPass, Q_ASSERT, QRHI_RES, and QVkCommandBuffer::recordingPass.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 5160 of file qrhivulkan.cpp.
References QVkCommandBuffer::activeSecondaryCbStack, QVkCommandBuffer::Command::args, QVkCommandBuffer::Command::Args::c, cb, QVkCommandBuffer::Command::cmd, QVkCommandBuffer::commands, df, QVarLengthArray< T, Prealloc >::last(), QVkCommandBuffer::passUsesSecondaryCb, Q_ASSERT, QRHI_RES, QVkCommandBuffer::recordingPass, QVkCommandBuffer::RenderPass, QVkCommandBuffer::Command::SetBlendConstants, and QVkCommandBuffer::Command::Args::setBlendConstants.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 2615 of file qrhivulkan.cpp.
References QVkCommandBuffer::activeSecondaryCbStack, QVkCommandBuffer::Command::args, QVkCommandBuffer::Command::BindPipeline, QVkCommandBuffer::Command::Args::bindPipeline, QVkCommandBuffer::Command::Args::bindPoint, cb, QVkCommandBuffer::Command::cmd, QVkCommandBuffer::commands, QVkCommandBuffer::ComputePass, QVkCommandBuffer::currentComputePipeline, QRhiImplementation::currentFrameSlot, QVkCommandBuffer::currentGraphicsPipeline, QVkCommandBuffer::currentPipelineGeneration, df, QVkComputePipeline::generation, QVarLengthArray< T, Prealloc >::last(), QVkComputePipeline::lastActiveFrameSlot, QVkCommandBuffer::passUsesSecondaryCb, QVkComputePipeline::pipeline, QVkCommandBuffer::Command::Args::pipeline, Q_ASSERT, QRHI_RES, and QVkCommandBuffer::recordingPass.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 4750 of file qrhivulkan.cpp.
References QVkCommandBuffer::activeSecondaryCbStack, QVkCommandBuffer::Command::args, QVkCommandBuffer::Command::BindPipeline, QVkCommandBuffer::Command::Args::bindPipeline, QVkCommandBuffer::Command::Args::bindPoint, cb, QVkCommandBuffer::Command::cmd, QVkCommandBuffer::commands, QVkCommandBuffer::currentComputePipeline, QRhiImplementation::currentFrameSlot, QVkCommandBuffer::currentGraphicsPipeline, QVkCommandBuffer::currentPipelineGeneration, df, QVkGraphicsPipeline::generation, QVarLengthArray< T, Prealloc >::last(), QVkGraphicsPipeline::lastActiveFrameSlot, QVkCommandBuffer::passUsesSecondaryCb, QVkGraphicsPipeline::pipeline, QVkCommandBuffer::Command::Args::pipeline, 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 5384 of file qrhivulkan.cpp.
References caps, QByteArray::constData(), QRhiImplementation::debugMarkers, dev, QByteArray::number(), and Q_UNUSED.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 4634 of file qrhivulkan.cpp.
References QString::constData(), dev, df, ensurePipelineCache(), header(), headerSize, physDevProperties, pipelineCache, QRhiImplementation::pipelineCacheRhiId(), and qCDebug.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 5133 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::Args::scissor, QVkCommandBuffer::Command::SetScissor, QVkCommandBuffer::Command::Args::setScissor, and QRhiGraphicsPipeline::UsesScissor.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 4775 of file qrhivulkan.cpp.
References QVkCommandBuffer::activeSecondaryCbStack, QVarLengthArray< T, Prealloc >::append(), QVkCommandBuffer::Command::args, QVkCommandBuffer::Command::BindDescriptorSet, QVkCommandBuffer::Command::Args::bindDescriptorSet, QVkCommandBuffer::Command::Args::bindPoint, QVkShaderResourceBindings::boundResourceData, QRhiShaderResourceBinding::BufferLoad, QRhiShaderResourceBinding::BufferLoadStore, QRhiShaderResourceBinding::BufferStore, QRhiPassResourceTracker::BufStorageLoad, QRhiPassResourceTracker::BufStorageLoadStore, QRhiPassResourceTracker::BufStorageStore, QRhiPassResourceTracker::BufUniformRead, cb, QVkCommandBuffer::Command::cmd, QVkCommandBuffer::commands, QVarLengthArray< T, Prealloc >::constData(), QVkShaderResourceBindings::BoundSampledTextureData::count, QVkCommandBuffer::currentComputePipeline, QVkCommandBuffer::currentComputeSrb, QVkCommandBuffer::currentDescSetSlot, QRhiImplementation::currentFrameSlot, QVkCommandBuffer::currentGraphicsPipeline, QVkCommandBuffer::currentGraphicsSrb, QVkCommandBuffer::currentPassResTrackerIndex, QVkCommandBuffer::currentSrbGeneration, QVkShaderResourceBindings::BoundSampledTextureData::d, QVkCommandBuffer::Command::Args::descSet, QVkShaderResourceBindings::descSets, df, QRhiBuffer::Dynamic, QVkCommandBuffer::dynamicOffset, QVkCommandBuffer::Command::Args::dynamicOffsetCount, QVkCommandBuffer::Command::Args::dynamicOffsetIndex, executeBufferHostWritesForSlot(), QVkBuffer::generation, QVkTexture::generation, QVkSampler::generation, QVkShaderResourceBindings::generation, QVkShaderResourceBindings::BoundUniformBufferData::generation, QVkShaderResourceBindings::BoundStorageImageData::generation, QVkShaderResourceBindings::BoundStorageBufferData::generation, QVkShaderResourceBindings::hasDynamicOffset, QVkShaderResourceBindings::hasSlottedResource, i, QVkShaderResourceBindings::BoundUniformBufferData::id, QVkShaderResourceBindings::BoundStorageImageData::id, QVkShaderResourceBindings::BoundStorageBufferData::id, QRhiShaderResourceBinding::ImageLoad, QRhiShaderResourceBinding::ImageLoadStore, QRhiShaderResourceBinding::ImageStore, QVarLengthArray< T, Prealloc >::last(), QVkBuffer::lastActiveFrameSlot, QVkTexture::lastActiveFrameSlot, QVkSampler::lastActiveFrameSlot, QVkShaderResourceBindings::lastActiveFrameSlot, QVkGraphicsPipeline::layout, QVkComputePipeline::layout, QRhiTexture::m_flags, QRhiResource::m_id, QRhiGraphicsPipeline::m_shaderResourceBindings, QRhiComputePipeline::m_shaderResourceBindings, QRhiBuffer::m_type, QRhiBuffer::m_usage, QVkCommandBuffer::NoPass, QVkCommandBuffer::passResTrackers, QVkCommandBuffer::passUsesSecondaryCb, QVkCommandBuffer::Command::Args::pipelineLayout, QVkCommandBuffer::pools, Q_ASSERT, QRHI_RES, QVkCommandBuffer::recordingPass, QRhiShaderResourceBinding::SampledTexture, QRhiShaderResourceBinding::Sampler, QVkSampler::sampler, QVkShaderResourceBindings::BoundSampledTextureData::samplerGeneration, QVkShaderResourceBindings::BoundSampledTextureData::samplerId, QVkShaderResourceBindings::BoundResourceData::sbuf, QRhiImplementation::shaderResourceBindingData(), QVkShaderResourceBindings::BoundResourceData::simage, QVLABaseBase::size(), QVkShaderResourceBindings::sortedBindings, QVkShaderResourceBindings::BoundResourceData::stex, QRhiBuffer::StorageBuffer, QVkShaderResourceBindings::BoundSampledTextureData::texGeneration, QVkShaderResourceBindings::BoundSampledTextureData::texId, QRhiPassResourceTracker::TexSample, QRhiPassResourceTracker::TexStorageLoad, QRhiPassResourceTracker::TexStorageLoadStore, QRhiPassResourceTracker::TexStorageStore, QRhiShaderResourceBinding::Texture, QRhiPassResourceTracker::toPassTrackerBufferStage(), QRhiPassResourceTracker::toPassTrackerTextureStage(), trackedRegisterBuffer(), trackedRegisterTexture(), QVkShaderResourceBindings::BoundResourceData::ubuf, QRhiShaderResourceBinding::UniformBuffer, QRhiBuffer::UniformBuffer, updateShaderResourceBindings(), and QRhiTexture::UsedWithLoadStore.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 5178 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::Command::Args::ref, QVkCommandBuffer::RenderPass, QVkCommandBuffer::Command::SetStencilRef, and QVkCommandBuffer::Command::Args::setStencilRef.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 4995 of file qrhivulkan.cpp.
References QVkCommandBuffer::activeSecondaryCbStack, QVarLengthArray< T, Prealloc >::append(), QVkCommandBuffer::Command::args, QVkCommandBuffer::Command::BindIndexBuffer, QVkCommandBuffer::Command::Args::bindIndexBuffer, QVkCommandBuffer::Command::BindVertexBuffer, QVkCommandBuffer::Command::Args::bindVertexBuffer, QVkCommandBuffer::Command::Args::buf, QVkBuffer::buffers, QRhiPassResourceTracker::BufIndexRead, QRhiPassResourceTracker::BufVertexInput, QRhiPassResourceTracker::BufVertexInputStage, cb, QVkCommandBuffer::Command::cmd, QVkCommandBuffer::commands, QVarLengthArray< T, Prealloc >::constData(), QVkCommandBuffer::Command::Args::count, QRhiImplementation::currentFrameSlot, QVkCommandBuffer::currentIndexBuffer, QVkCommandBuffer::currentIndexFormat, QVkCommandBuffer::currentIndexOffset, QVkCommandBuffer::currentPassResTrackerIndex, QVkCommandBuffer::currentVertexBuffers, QVkCommandBuffer::currentVertexOffsets, df, QRhiBuffer::Dynamic, executeBufferHostWritesForSlot(), i, QRhiBuffer::IndexBuffer, QRhiCommandBuffer::IndexUInt16, QVarLengthArray< T, Prealloc >::last(), QVkBuffer::lastActiveFrameSlot, QRhiBuffer::m_type, QRhiBuffer::m_usage, QVkCommandBuffer::Command::Args::ofs, QVkCommandBuffer::passResTrackers, QVkCommandBuffer::passUsesSecondaryCb, QVkCommandBuffer::pools, Q_ASSERT, QRHI_RES, QVkCommandBuffer::recordingPass, QVkCommandBuffer::RenderPass, QVLABaseBase::size(), QVkCommandBuffer::Command::Args::startBinding, trackedRegisterBuffer(), QVkCommandBuffer::Command::Args::type, QRhiBuffer::VertexBuffer, QVkCommandBuffer::vertexBuffer, QVkCommandBuffer::Command::Args::vertexBufferIndex, QVkCommandBuffer::vertexBufferOffset, and QVkCommandBuffer::Command::Args::vertexBufferOffsetIndex.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 5087 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::Args::scissor, QVkCommandBuffer::Command::SetScissor, QVkCommandBuffer::Command::Args::setScissor, QVkCommandBuffer::Command::SetViewport, QVkCommandBuffer::Command::Args::setViewport, QRhiGraphicsPipeline::UsesScissor, QVkCommandBuffer::Command::Args::viewport, and viewport().
QRhi::FrameOpResult QRhiVulkan::startPrimaryCommandBuffer | ( | VkCommandBuffer * | cb | ) |
Definition at line 2085 of file qrhivulkan.cpp.
References cb, cmdPool, QRhiImplementation::currentFrameSlot, dev, deviceLost, df, QRhi::FrameOpDeviceLost, QRhi::FrameOpError, QRhi::FrameOpSuccess, and qWarning.
Referenced by beginFrame(), beginOffscreenFrame(), and finish().
VkCommandBuffer QRhiVulkan::startSecondaryCommandBuffer | ( | QVkRenderTargetData * | rtD = nullptr | ) |
Definition at line 2408 of file qrhivulkan.cpp.
References cmdPool, QRhiImplementation::currentFrameSlot, dev, df, QVkRenderTargetData::fb, freeSecondaryCbs, QVarLengthArray< T, Prealloc >::last(), qWarning, QVarLengthArray< T, Prealloc >::removeLast(), QVkRenderPassDescriptor::rp, and QVkRenderTargetData::rp.
Referenced by beginComputePass(), beginExternal(), beginPass(), and endExternal().
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 4549 of file qrhivulkan.cpp.
References allocator, i, statistics(), QRhiImplementation::totalPipelineCreationTime(), and toVmaAllocator().
Referenced by 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 3106 of file qrhivulkan.cpp.
References QVarLengthArray< T, Prealloc >::append(), QVkCommandBuffer::Command::args, QVkCommandBuffer::Command::cmd, QVkCommandBuffer::commands, QVkCommandBuffer::Command::Args::count, QVkCommandBuffer::Command::Args::dstStageMask, QVkCommandBuffer::Command::ImageBarrier, QVkCommandBuffer::Command::Args::imageBarrier, QVkCommandBuffer::imageBarrier, QVkCommandBuffer::Command::Args::index, QVkCommandBuffer::NoPass, QVkCommandBuffer::pools, Q_ASSERT, QVkCommandBuffer::recordingPass, QVLABaseBase::size(), and QVkCommandBuffer::Command::Args::srcStageMask.
Referenced by enqueueResourceUpdates().
VkDeviceSize QRhiVulkan::subresUploadByteSize | ( | const QRhiTextureSubresourceUploadDescription & | subresDesc | ) | const |
Definition at line 3136 of file qrhivulkan.cpp.
References aligned(), QRhiTextureSubresourceUploadDescription::data(), QRhiTextureSubresourceUploadDescription::image(), QImage::isNull(), QByteArray::size(), QImage::sizeInBytes(), and texbufAlign.
Referenced by enqueueResourceUpdates().
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 3920 of file qrhivulkan.cpp.
References physDevProperties, and qvk_sampleCounts.
Referenced by effectiveSampleCount().
void QRhiVulkan::trackedBufferBarrier | ( | QVkCommandBuffer * | cbD, |
QVkBuffer * | bufD, | ||
int | slot, | ||
VkAccessFlags | access, | ||
VkPipelineStageFlags | stage | ||
) |
Definition at line 2994 of file qrhivulkan.cpp.
References accessIsWrite(), QVarLengthArray< T, Prealloc >::append(), QVkCommandBuffer::Command::args, QVkCommandBuffer::Command::BufferBarrier, QVkCommandBuffer::Command::Args::bufferBarrier, QVkCommandBuffer::bufferBarrier, QVkBuffer::buffers, QVkCommandBuffer::Command::cmd, QVkCommandBuffer::commands, QVkCommandBuffer::Command::Args::count, QVkCommandBuffer::Command::Args::dstStageMask, QVkCommandBuffer::Command::Args::index, QVkCommandBuffer::NoPass, QVkCommandBuffer::pools, Q_ASSERT, QVkCommandBuffer::recordingPass, QVLABaseBase::size(), QVkCommandBuffer::Command::Args::srcStageMask, and QVkBuffer::usageState.
Referenced by enqueueResourceUpdates().
void QRhiVulkan::trackedImageBarrier | ( | QVkCommandBuffer * | cbD, |
QVkTexture * | texD, | ||
VkImageLayout | layout, | ||
VkAccessFlags | access, | ||
VkPipelineStageFlags | stage | ||
) |
Definition at line 3034 of file qrhivulkan.cpp.
References accessIsWrite(), QVarLengthArray< T, Prealloc >::append(), QVkCommandBuffer::Command::args, aspectMaskForTextureFormat(), QVkCommandBuffer::Command::cmd, QVkCommandBuffer::commands, QVkCommandBuffer::Command::Args::count, QVkCommandBuffer::Command::Args::dstStageMask, QVkTexture::image, QVkCommandBuffer::Command::ImageBarrier, QVkCommandBuffer::Command::Args::imageBarrier, QVkCommandBuffer::imageBarrier, QVkCommandBuffer::Command::Args::index, layout, QRhiTexture::m_format, QVkCommandBuffer::NoPass, QVkCommandBuffer::pools, Q_ASSERT, QVkCommandBuffer::recordingPass, QVLABaseBase::size(), QVkCommandBuffer::Command::Args::srcStageMask, and QVkTexture::usageState.
Referenced by enqueueResourceUpdates().
void QRhiVulkan::trackedRegisterBuffer | ( | QRhiPassResourceTracker * | passResTracker, |
QVkBuffer * | bufD, | ||
int | slot, | ||
QRhiPassResourceTracker::BufferAccess | access, | ||
QRhiPassResourceTracker::BufferStage | stage | ||
) |
Definition at line 4232 of file qrhivulkan.cpp.
References QVkBuffer::UsageState::access, accessIsWrite(), QRhiPassResourceTracker::registerBuffer(), QVkBuffer::UsageState::stage, toPassTrackerUsageState(), toVkAccess(), toVkPipelineStage(), and QVkBuffer::usageState.
Referenced by setShaderResources(), and setVertexInput().
void QRhiVulkan::trackedRegisterTexture | ( | QRhiPassResourceTracker * | passResTracker, |
QVkTexture * | texD, | ||
QRhiPassResourceTracker::TextureAccess | access, | ||
QRhiPassResourceTracker::TextureStage | stage | ||
) |
Definition at line 4250 of file qrhivulkan.cpp.
References QVkTexture::UsageState::access, accessIsWrite(), QVkTexture::UsageState::layout, QRhiPassResourceTracker::registerTexture(), QVkTexture::UsageState::stage, toPassTrackerUsageState(), toVkAccess(), toVkLayout(), toVkPipelineStage(), and QVkTexture::usageState.
Referenced by activateTextureRenderTarget(), and setShaderResources().
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 4350 of file qrhivulkan.cpp.
References ubufAlign.
void QRhiVulkan::updateShaderResourceBindings | ( | QRhiShaderResourceBindings * | srb, |
int | descSetIdx = -1 |
||
) |
Definition at line 2823 of file qrhivulkan.cpp.
References aligned(), QVarLengthArray< T, Prealloc >::append(), QVarLengthArray< T, Prealloc >::at(), QVkShaderResourceBindings::boundResourceData, QRhiShaderResourceBinding::BufferLoad, QRhiShaderResourceBinding::BufferLoadStore, QVkBuffer::buffers, QRhiShaderResourceBinding::BufferStore, QVarLengthArray< T, Prealloc >::constData(), QRhiShaderResourceBinding::Data::TextureAndOrSamplerData::count, QVkShaderResourceBindings::BoundSampledTextureData::count, QVkShaderResourceBindings::BoundSampledTextureData::d, QVkShaderResourceBindings::descSets, dev, df, QRhiBuffer::Dynamic, QVarLengthArray< T, Prealloc >::first(), QVkBuffer::generation, QVkTexture::generation, QVkSampler::generation, QVkShaderResourceBindings::BoundUniformBufferData::generation, QVkShaderResourceBindings::BoundStorageImageData::generation, QVkShaderResourceBindings::BoundStorageBufferData::generation, i, QVkShaderResourceBindings::BoundUniformBufferData::id, QVkShaderResourceBindings::BoundStorageImageData::id, QVkShaderResourceBindings::BoundStorageBufferData::id, QRhiShaderResourceBinding::ImageLoad, QRhiShaderResourceBinding::ImageLoadStore, QRhiShaderResourceBinding::ImageStore, QVkTexture::imageView, QVkTexture::imageViewForLevel(), QRhiResource::m_id, QRhiBuffer::m_size, QRhiBuffer::m_type, Q_ASSERT, QRHI_RES, QVK_FRAMES_IN_FLIGHT, QRhiShaderResourceBinding::SampledTexture, QRhiShaderResourceBinding::Sampler, QVkSampler::sampler, QVkShaderResourceBindings::BoundSampledTextureData::samplerGeneration, QVkShaderResourceBindings::BoundSampledTextureData::samplerId, QVkShaderResourceBindings::BoundResourceData::sbuf, QRhiImplementation::shaderResourceBindingData(), QVkShaderResourceBindings::BoundResourceData::simage, QVLABaseBase::size(), QVkShaderResourceBindings::sortedBindings, QVkShaderResourceBindings::BoundResourceData::stex, QVkShaderResourceBindings::BoundSampledTextureData::texGeneration, QVkShaderResourceBindings::BoundSampledTextureData::texId, QRhiShaderResourceBinding::Texture, QVkShaderResourceBindings::BoundResourceData::ubuf, ubufAlign, QRhiShaderResourceBinding::UniformBuffer, and view.
Referenced by setShaderResources().
void QRhiVulkan::waitCommandCompletion | ( | int | frameSlot | ) |
Definition at line 2166 of file qrhivulkan.cpp.
References dev, df, frame, and swapchains.
Referenced by beginFrame(), and beginOffscreenFrame().
QVarLengthArray<BufferReadback, 2> QRhiVulkan::activeBufferReadbacks |
Definition at line 940 of file qrhivulkan_p.h.
Referenced by enqueueResourceUpdates(), and finishActiveReadbacks().
QVarLengthArray<TextureReadback, 2> QRhiVulkan::activeTextureReadbacks |
Definition at line 932 of file qrhivulkan_p.h.
Referenced by enqueueResourceUpdates(), and finishActiveReadbacks().
QVkAllocator QRhiVulkan::allocator = nullptr |
Definition at line 834 of file qrhivulkan_p.h.
Referenced by QRhiVulkan(), destroy(), enqueueResourceUpdates(), executeBufferHostWritesForSlot(), executeDeferredReleases(), finishActiveReadbacks(), and statistics().
QVersionNumber QRhiVulkan::apiVersion |
Definition at line 878 of file qrhivulkan_p.h.
struct { ... } QRhiVulkan::caps |
Referenced by create(), createOffscreenRenderPass(), debugMarkBegin(), debugMarkEnd(), debugMarkMsg(), isFeatureSupported(), and setObjectName().
QMatrix4x4 QRhiVulkan::clipCorrectMatrix |
Definition at line 898 of file qrhivulkan_p.h.
VkCommandPool QRhiVulkan::cmdPool[QVK_FRAMES_IN_FLIGHT] = {} |
Definition at line 828 of file qrhivulkan_p.h.
Referenced by destroy(), ensureCommandPoolForNewFrame(), startPrimaryCommandBuffer(), and startSecondaryCommandBuffer().
bool QRhiVulkan::compute = false |
Definition at line 869 of file qrhivulkan_p.h.
QVkSwapChain* QRhiVulkan::currentSwapChain = nullptr |
Definition at line 900 of file qrhivulkan_p.h.
Referenced by beginFrame(), beginPass(), endFrame(), enqueueResourceUpdates(), and finish().
bool QRhiVulkan::debugUtils = false |
Definition at line 871 of file qrhivulkan_p.h.
QVarLengthArray<DescriptorPoolData, 8> QRhiVulkan::descriptorPools |
Definition at line 891 of file qrhivulkan_p.h.
Referenced by allocateDescriptorSet(), destroy(), and executeDeferredReleases().
VkDevice QRhiVulkan::dev = VK_NULL_HANDLE |
Definition at line 827 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 849 of file qrhivulkan_p.h.
Referenced by beginFrame(), destroy(), endAndSubmitPrimaryCommandBuffer(), endFrame(), isDeviceLost(), releaseSwapChainResources(), and startPrimaryCommandBuffer().
QVulkanDeviceFunctions* QRhiVulkan::df = nullptr |
Definition at line 836 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 903 of file qrhivulkan_p.h.
Referenced by create(), and driverInfo().
QVulkanFunctions* QRhiVulkan::f = nullptr |
Definition at line 835 of file qrhivulkan_p.h.
Referenced by finishActiveReadbacks().
QVarLengthArray<VkCommandBuffer, 4> QRhiVulkan::freeSecondaryCbs[QVK_FRAMES_IN_FLIGHT] |
Definition at line 892 of file qrhivulkan_p.h.
Referenced by destroy(), executeDeferredReleases(), and startSecondaryCommandBuffer().
bool QRhiVulkan::geometryShader = false |
Definition at line 875 of file qrhivulkan_p.h.
VkQueue QRhiVulkan::gfxQueue = VK_NULL_HANDLE |
Definition at line 831 of file qrhivulkan_p.h.
Referenced by endAndSubmitPrimaryCommandBuffer(), endFrame(), and finish().
quint32 QRhiVulkan::gfxQueueFamilyIdx = 0 |
Definition at line 829 of file qrhivulkan_p.h.
Referenced by QRhiVulkan(), and create().
quint32 QRhiVulkan::gfxQueueIdx = 0 |
Definition at line 830 of file qrhivulkan_p.h.
Referenced by QRhiVulkan().
bool QRhiVulkan::importedAllocator = false |
Definition at line 833 of file qrhivulkan_p.h.
Referenced by QRhiVulkan(), and destroy().
bool QRhiVulkan::importedDevice = false |
Definition at line 825 of file qrhivulkan_p.h.
Referenced by QRhiVulkan(), create(), and destroy().
QVulkanInstance* QRhiVulkan::inst = nullptr |
Definition at line 822 of file qrhivulkan_p.h.
Referenced by QRhiVulkan(), beginFrame(), create(), destroy(), and endFrame().
Definition at line 823 of file qrhivulkan_p.h.
Referenced by QRhiVulkan(), and create().
bool QRhiVulkan::multiView = false |
Definition at line 877 of file qrhivulkan_p.h.
QRhiVulkanNativeHandles QRhiVulkan::nativeHandlesStruct |
Definition at line 902 of file qrhivulkan_p.h.
Referenced by nativeHandles().
bool QRhiVulkan::nonFillPolygonMode = false |
Definition at line 876 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 897 of file qrhivulkan_p.h.
Referenced by optimalDepthStencilFormat().
VkPhysicalDevice QRhiVulkan::physDev = VK_NULL_HANDLE |
Definition at line 826 of file qrhivulkan_p.h.
Referenced by QRhiVulkan(), chooseTransientImageMemType(), create(), isTextureFormatSupported(), optimalDepthStencilFormat(), and recreateSwapChain().
VkPhysicalDeviceFeatures QRhiVulkan::physDevFeatures |
Definition at line 838 of file qrhivulkan_p.h.
Referenced by create(), and isTextureFormatSupported().
VkPhysicalDeviceProperties QRhiVulkan::physDevProperties |
Definition at line 846 of file qrhivulkan_p.h.
Referenced by create(), elapsedSecondsFromTimestamp(), pipelineCacheData(), resourceLimit(), setPipelineCacheData(), and supportedSampleCounts().
VkPipelineCache QRhiVulkan::pipelineCache = VK_NULL_HANDLE |
Definition at line 881 of file qrhivulkan_p.h.
Referenced by destroy(), ensurePipelineCache(), pipelineCacheData(), and setPipelineCacheData().
bool QRhiVulkan::releaseCachedResourcesCalledBeforeFrameStart = false |
Definition at line 850 of file qrhivulkan_p.h.
Referenced by ensureCommandPoolForNewFrame(), prepareNewFrame(), and releaseCachedResources().
QList<DeferredReleaseEntry> QRhiVulkan::releaseQueue |
Definition at line 1005 of file qrhivulkan_p.h.
Referenced by endAndEnqueueSecondaryCommandBuffer(), enqueueResourceUpdates(), and executeDeferredReleases().
QByteArrayList QRhiVulkan::requestedDeviceExtensions |
Definition at line 824 of file qrhivulkan_p.h.
Referenced by QRhiVulkan(), and create().
QRhi::Flags QRhiVulkan::rhiFlags |
Definition at line 837 of file qrhivulkan_p.h.
Referenced by beginFrame(), beginOffscreenFrame(), create(), and pipelineCacheData().
QSet<QVkSwapChain *> QRhiVulkan::swapchains |
Definition at line 901 of file qrhivulkan_p.h.
Referenced by waitCommandCompletion().
bool QRhiVulkan::tessellation = false |
Definition at line 874 of file qrhivulkan_p.h.
VkDeviceSize QRhiVulkan::texbufAlign |
Definition at line 848 of file qrhivulkan_p.h.
Referenced by prepareUploadSubres(), and subresUploadByteSize().
bool QRhiVulkan::texture3DSliceAs2D = false |
Definition at line 873 of file qrhivulkan_p.h.
VkQueryPool QRhiVulkan::timestampQueryPool = VK_NULL_HANDLE |
Definition at line 894 of file qrhivulkan_p.h.
Referenced by beginFrame(), beginOffscreenFrame(), destroy(), endFrame(), and endOffscreenFrame().
QBitArray QRhiVulkan::timestampQueryPoolMap |
Definition at line 895 of file qrhivulkan_p.h.
Referenced by beginFrame(), beginOffscreenFrame(), and endOffscreenFrame().
quint32 QRhiVulkan::timestampValidBits = 0 |
Definition at line 832 of file qrhivulkan_p.h.
Referenced by elapsedSecondsFromTimestamp(), and isFeatureSupported().
VkDeviceSize QRhiVulkan::ubufAlign |
Definition at line 847 of file qrhivulkan_p.h.
Referenced by ubufAlignment(), and updateShaderResourceBindings().
bool QRhiVulkan::vertexAttribDivisor = false |
Definition at line 872 of file qrhivulkan_p.h.
PFN_vkAcquireNextImageKHR QRhiVulkan::vkAcquireNextImageKHR |
Definition at line 862 of file qrhivulkan_p.h.
Referenced by beginFrame(), and recreateSwapChain().
PFN_vkCreateSwapchainKHR QRhiVulkan::vkCreateSwapchainKHR = nullptr |
Definition at line 859 of file qrhivulkan_p.h.
Referenced by recreateSwapChain().
PFN_vkDestroySwapchainKHR QRhiVulkan::vkDestroySwapchainKHR |
Definition at line 860 of file qrhivulkan_p.h.
Referenced by recreateSwapChain(), and releaseSwapChainResources().
PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR QRhiVulkan::vkGetPhysicalDeviceSurfaceCapabilitiesKHR |
Definition at line 864 of file qrhivulkan_p.h.
Referenced by createSwapChain(), and recreateSwapChain().
PFN_vkGetPhysicalDeviceSurfaceFormatsKHR QRhiVulkan::vkGetPhysicalDeviceSurfaceFormatsKHR |
Definition at line 865 of file qrhivulkan_p.h.
Referenced by createSwapChain().
PFN_vkGetPhysicalDeviceSurfacePresentModesKHR QRhiVulkan::vkGetPhysicalDeviceSurfacePresentModesKHR |
Definition at line 866 of file qrhivulkan_p.h.
Referenced by createSwapChain().
PFN_vkGetSwapchainImagesKHR QRhiVulkan::vkGetSwapchainImagesKHR |
Definition at line 861 of file qrhivulkan_p.h.
Referenced by recreateSwapChain().
PFN_vkQueuePresentKHR QRhiVulkan::vkQueuePresentKHR |
Definition at line 863 of file qrhivulkan_p.h.
Referenced by endFrame(), and recreateSwapChain().
bool QRhiVulkan::wideLines = false |
Definition at line 870 of file qrhivulkan_p.h.