Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qrhivulkan_p.h
Go to the documentation of this file.
1// Copyright (C) 2023 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#ifndef QRHIVULKAN_P_H
6#define QRHIVULKAN_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include "qrhi_p.h"
20
21#ifdef Q_OS_WIN
22#include "qdxgihdrinfo_p.h"
23#endif
24
26
27class QVulkanFunctions;
28class QVulkanDeviceFunctions;
29
30static const int QVK_FRAMES_IN_FLIGHT = 2;
31
32static const int QVK_DESC_SETS_PER_POOL = 128;
33static const int QVK_UNIFORM_BUFFERS_PER_POOL = 256;
35static const int QVK_SAMPLED_IMAGES_PER_POOL = 256;
36static const int QVK_SAMPLERS_PER_POOL = 256;
37static const int QVK_STORAGE_BUFFERS_PER_POOL = 128;
38static const int QVK_STORAGE_IMAGES_PER_POOL = 128;
39
40static const int QVK_MAX_ACTIVE_TIMESTAMP_PAIRS = 16;
41
42// no vk_mem_alloc.h available here, void* is good enough
43typedef void * QVkAlloc;
44typedef void * QVkAllocator;
45
74
76
77struct QVkTexture;
78
80{
81 QVkRenderBuffer(QRhiImplementation *rhi, Type type, const QSize &pixelSize,
82 int sampleCount, Flags flags,
83 QRhiTexture::Format backingFormatHint);
85 void destroy() override;
86 bool create() override;
87 QRhiTexture::Format backingFormat() const override;
88
97 friend class QRhiVulkan;
98};
99
100struct QVkTexture : public QRhiTexture
101{
102 QVkTexture(QRhiImplementation *rhi, Format format, const QSize &pixelSize, int depth,
103 int arraySize, int sampleCount, Flags flags);
104 ~QVkTexture();
105 void destroy() override;
106 bool create() override;
107 bool createFrom(NativeTexture src) override;
108 NativeTexture nativeTexture() override;
109 void setNativeLayout(int layout) override;
110
111 bool prepareCreate(QSize *adjustedSize = nullptr);
112 bool finishCreate();
114
121 bool owns = true;
122 struct UsageState {
123 // no tracking of subresource layouts (some operations can keep
124 // subresources in different layouts for some time, but that does not
125 // need to be kept track of)
129 };
138 friend class QRhiVulkan;
139};
140
141struct QVkSampler : public QRhiSampler
142{
143 QVkSampler(QRhiImplementation *rhi, Filter magFilter, Filter minFilter, Filter mipmapMode,
144 AddressMode u, AddressMode v, AddressMode w);
145 ~QVkSampler();
146 void destroy() override;
147 bool create() override;
148
152 friend class QRhiVulkan;
153};
154
156{
157 QVkShadingRateMap(QRhiImplementation *rhi);
159 void destroy() override;
160 bool createFrom(QRhiTexture *src) override;
161
162 QVkTexture *texture = nullptr; // not owned
163 friend class QRhiVulkan;
164};
165
195
212
214{
215 QVkSwapChainRenderTarget(QRhiImplementation *rhi, QRhiSwapChain *swapchain);
217 void destroy() override;
218
219 QSize pixelSize() const override;
220 float devicePixelRatio() const override;
221 int sampleCount() const override;
222
224};
225
248
250{
251 QVkShaderResourceBindings(QRhiImplementation *rhi);
253 void destroy() override;
254 bool create() override;
255 void updateResources(UpdateFlags flags) override;
256
258 bool hasDynamicOffset = false;
259 int poolIndex = -1;
261 VkDescriptorSet descSets[QVK_FRAMES_IN_FLIGHT]; // multiple sets to support dynamic buffers
264
265 // Keep track of the generation number of each referenced QRhi* to be able
266 // to detect that the underlying descriptor set became out of date and they
267 // need to be written again with the up-to-date VkBuffer etc. objects.
273 int count;
274 struct {
279 } d[QRhiShaderResourceBinding::Data::MAX_TEX_SAMPLER_ARRAY_SIZE];
280 };
298
299 friend class QRhiVulkan;
300};
301
303
317
331
333{
334 QVkCommandBuffer(QRhiImplementation *rhi);
336 void destroy() override;
337
339
342
348
349 void resetState() {
351 passUsesSecondaryCb = false;
352 lastGpuTime = 0;
353 currentTarget = nullptr;
354 activeSecondaryCbStack.clear();
357 }
358
360 currentGraphicsPipeline = nullptr;
361 currentComputePipeline = nullptr;
362 currentPipelineGeneration = 0;
363 currentGraphicsSrb = nullptr;
364 currentComputeSrb = nullptr;
365 currentSrbGeneration = 0;
367 currentIndexBuffer = VK_NULL_HANDLE;
368 currentIndexOffset = 0;
369 currentIndexFormat = VK_INDEX_TYPE_UINT16;
370 memset(currentVertexBuffers, 0, sizeof(currentVertexBuffers));
371 memset(currentVertexOffsets, 0, sizeof(currentVertexOffsets));
372 inExternal = false;
373 hasShadingRateSet = false;
374 hasCustomScissorSet = false;
375 currentViewport = {};
376 }
377
380 double lastGpuTime = 0;
392 static const int VERTEX_INPUT_RESOURCE_SLOT_COUNT = 32;
400
407 void reset() {
408 writtenResources.clear();
409 }
410 } computePassState;
411
412 struct Command {
445
446 union Args {
447 struct {
451 } copyBuffer;
452 struct {
453 VkBuffer src;
456 int count;
458 } copyBufferToImage;
459 struct {
462 VkImage dst;
463 VkImageLayout dstLayout;
465 } copyImage;
466 struct {
467 VkImage src;
468 VkImageLayout srcLayout;
469 VkBuffer dst;
471 } copyImageToBuffer;
472 struct {
475 int count;
476 int index;
477 } imageBarrier;
478 struct {
479 VkPipelineStageFlags srcStageMask;
480 VkPipelineStageFlags dstStageMask;
484 } memoryBarrier;
485 struct {
486 VkPipelineStageFlags srcStageMask;
487 VkPipelineStageFlags dstStageMask;
488 int count;
489 int index;
490 } bufferBarrier;
491 struct {
492 VkImage src;
493 VkImageLayout srcLayout;
494 VkImage dst;
495 VkImageLayout dstLayout;
498 } blitImage;
499 struct {
503 } beginRenderPass;
504 struct {
505 } endRenderPass;
506 struct {
509 } bindPipeline;
510 struct {
511 VkPipelineBindPoint bindPoint;
516 } bindDescriptorSet;
517 struct {
519 int count;
522 } bindVertexBuffer;
523 struct {
527 } bindIndexBuffer;
528 struct {
530 } setViewport;
531 struct {
533 } setScissor;
534 struct {
535 float c[4];
536 } setBlendConstants;
537 struct {
539 } setStencilRef;
540 struct {
545 } draw;
546 struct {
548 uint32_t instanceCount;
551 uint32_t firstInstance;
552 } drawIndexed;
553 struct {
558 } drawIndirect;
559 struct {
560 VkBuffer indirectBuffer;
561 VkDeviceSize indirectBufferOffset;
562 uint32_t drawCount;
563 uint32_t stride;
564 } drawIndexedIndirect;
565 struct {
566#ifdef VK_EXT_debug_utils
567 VkDebugUtilsLabelEXT label;
568 int labelNameIndex;
569#endif
570 } debugMarkerBegin;
571 struct {
572 } debugMarkerEnd;
573 struct {
574#ifdef VK_EXT_debug_utils
575 VkDebugUtilsLabelEXT label;
576 int labelNameIndex;
577#endif
578 } debugMarkerInsert;
579 struct {
581 } transitionResources;
582 struct {
583 int x, y, z;
584 } dispatch;
585 struct {
587 } executeSecondary;
588 struct {
591 } setShadingRate;
592 } args;
593 };
594
598
600 commands.reset();
602
603 passResTrackers.clear();
605 }
606
607 void resetPools() {
608 pools.clearValue.clear();
609 pools.bufferImageCopy.clear();
610 pools.dynamicOffset.clear();
611 pools.vertexBuffer.clear();
612 pools.vertexBufferOffset.clear();
613 pools.debugMarkerData.clear();
614 pools.imageBarrier.clear();
615 pools.bufferBarrier.clear();
616 }
617
618 struct {
627 } pools;
628
629 friend class QRhiVulkan;
630};
631
633
635{
636 QVkSwapChain(QRhiImplementation *rhi);
637 ~QVkSwapChain();
638 void destroy() override;
639
640 QRhiCommandBuffer *currentFrameCommandBuffer() override;
642 QRhiRenderTarget *currentFrameRenderTarget(StereoTargetBuffer targetBuffer) override;
643
644 QSize surfacePixelSize() override;
645 bool isFormatSupported(Format f) override;
647
650
651 bool ensureSurface();
652
654
655 QWindow *window = nullptr;
657 bool supportsReadback = false;
658 bool stereo = false;
660 int bufferCount = 0;
667 QVkRenderBuffer *ds = nullptr;
675
691
701
702 quint32 currentImageIndex = 0; // index in imageRes
703 quint32 currentFrameSlot = 0; // index in frameRes
704 int frameCount = 0;
705
706 friend class QRhiVulkan;
707};
708
710{
711public:
712 QRhiDriverInfo info() const override;
713
716};
717
719{
720public:
721 QRhiVulkan(QRhiVulkanInitParams *params, QRhiVulkanNativeHandles *importParams = nullptr);
722
723 bool create(QRhi::Flags flags) override;
724 void destroy() override;
725 QRhi::AdapterList enumerateAdaptersBeforeCreate(QRhiNativeHandles *nativeHandles) const override;
726
730 QRhiBuffer *createBuffer(QRhiBuffer::Type type,
731 QRhiBuffer::UsageFlags usage,
732 quint32 size) override;
733 QRhiRenderBuffer *createRenderBuffer(QRhiRenderBuffer::Type type,
734 const QSize &pixelSize,
735 int sampleCount,
736 QRhiRenderBuffer::Flags flags,
737 QRhiTexture::Format backingFormatHint) override;
738 QRhiTexture *createTexture(QRhiTexture::Format format,
739 const QSize &pixelSize,
740 int depth,
741 int arraySize,
742 int sampleCount,
743 QRhiTexture::Flags flags) override;
744 QRhiSampler *createSampler(QRhiSampler::Filter magFilter,
745 QRhiSampler::Filter minFilter,
746 QRhiSampler::Filter mipmapMode,
747 QRhiSampler:: AddressMode u,
748 QRhiSampler::AddressMode v,
749 QRhiSampler::AddressMode w) override;
750
751 QRhiTextureRenderTarget *createTextureRenderTarget(const QRhiTextureRenderTargetDescription &desc,
752 QRhiTextureRenderTarget::Flags flags) override;
753
754 QRhiShadingRateMap *createShadingRateMap() override;
755
756 QRhiSwapChain *createSwapChain() override;
757 QRhi::FrameOpResult beginFrame(QRhiSwapChain *swapChain, QRhi::BeginFrameFlags flags) override;
758 QRhi::FrameOpResult endFrame(QRhiSwapChain *swapChain, QRhi::EndFrameFlags flags) override;
759 QRhi::FrameOpResult beginOffscreenFrame(QRhiCommandBuffer **cb, QRhi::BeginFrameFlags flags) override;
760 QRhi::FrameOpResult endOffscreenFrame(QRhi::EndFrameFlags flags) override;
761 QRhi::FrameOpResult finish() override;
762
763 void resourceUpdate(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override;
764
765 void beginPass(QRhiCommandBuffer *cb,
766 QRhiRenderTarget *rt,
767 const QColor &colorClearValue,
768 const QRhiDepthStencilClearValue &depthStencilClearValue,
769 QRhiResourceUpdateBatch *resourceUpdates,
770 QRhiCommandBuffer::BeginPassFlags flags) override;
771 void endPass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override;
772
773 void setGraphicsPipeline(QRhiCommandBuffer *cb,
774 QRhiGraphicsPipeline *ps) override;
775
776 void setShaderResources(QRhiCommandBuffer *cb,
777 QRhiShaderResourceBindings *srb,
778 int dynamicOffsetCount,
779 const QRhiCommandBuffer::DynamicOffset *dynamicOffsets) override;
780
781 void setVertexInput(QRhiCommandBuffer *cb,
782 int startBinding, int bindingCount, const QRhiCommandBuffer::VertexInput *bindings,
783 QRhiBuffer *indexBuf, quint32 indexOffset,
784 QRhiCommandBuffer::IndexFormat indexFormat) override;
785
786 void setViewport(QRhiCommandBuffer *cb, const QRhiViewport &viewport) override;
787 void setScissor(QRhiCommandBuffer *cb, const QRhiScissor &scissor) override;
788 void setBlendConstants(QRhiCommandBuffer *cb, const QColor &c) override;
789 void setStencilRef(QRhiCommandBuffer *cb, quint32 refValue) override;
790 void setShadingRate(QRhiCommandBuffer *cb, const QSize &coarsePixelSize) override;
791
792 void draw(QRhiCommandBuffer *cb, quint32 vertexCount,
793 quint32 instanceCount, quint32 firstVertex, quint32 firstInstance) override;
794
795 void drawIndexed(QRhiCommandBuffer *cb, quint32 indexCount,
796 quint32 instanceCount, quint32 firstIndex,
797 qint32 vertexOffset, quint32 firstInstance) override;
798
799 void drawIndirect(QRhiCommandBuffer *cb, QRhiBuffer *indirectBuffer,
800 quint32 indirectBufferOffset, quint32 drawCount, quint32 stride) override;
801
802 void drawIndexedIndirect(QRhiCommandBuffer *cb, QRhiBuffer *indirectBuffer,
803 quint32 indirectBufferOffset, quint32 drawCount, quint32 stride) override;
804
805 void debugMarkBegin(QRhiCommandBuffer *cb, const QByteArray &name) override;
806 void debugMarkEnd(QRhiCommandBuffer *cb) override;
807 void debugMarkMsg(QRhiCommandBuffer *cb, const QByteArray &msg) override;
808
809 void beginComputePass(QRhiCommandBuffer *cb,
810 QRhiResourceUpdateBatch *resourceUpdates,
811 QRhiCommandBuffer::BeginPassFlags flags) override;
812 void endComputePass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override;
813 void setComputePipeline(QRhiCommandBuffer *cb, QRhiComputePipeline *ps) override;
814 void dispatch(QRhiCommandBuffer *cb, int x, int y, int z) override;
815
816 const QRhiNativeHandles *nativeHandles(QRhiCommandBuffer *cb) override;
817 void beginExternal(QRhiCommandBuffer *cb) override;
818 void endExternal(QRhiCommandBuffer *cb) override;
819 double lastCompletedGpuTime(QRhiCommandBuffer *cb) override;
820
821 QList<int> supportedSampleCounts() const override;
822 QList<QSize> supportedShadingRates(int sampleCount) const override;
823 int ubufAlignment() const override;
824 bool isYUpInFramebuffer() const override;
825 bool isYUpInNDC() const override;
826 bool isClipDepthZeroToOne() const override;
827 QMatrix4x4 clipSpaceCorrMatrix() const override;
828 bool isTextureFormatSupported(QRhiTexture::Format format, QRhiTexture::Flags flags) const override;
829 bool isFeatureSupported(QRhi::Feature feature) const override;
830 int resourceLimit(QRhi::ResourceLimit limit) const override;
831 const QRhiNativeHandles *nativeHandles() override;
832 QRhiDriverInfo driverInfo() const override;
833 QRhiStats statistics() override;
835 void setQueueSubmitParams(QRhiNativeHandles *params) override;
837 bool isDeviceLost() const override;
838
839 QByteArray pipelineCacheData() override;
840 void setPipelineCacheData(const QByteArray &data) override;
841
842 VkResult createDescriptorPool(VkDescriptorPool *pool);
843 bool allocateDescriptorSet(VkDescriptorSetAllocateInfo *allocInfo, VkDescriptorSet *result, int *resultPoolIndex);
844 uint32_t chooseTransientImageMemType(VkImage img, uint32_t startIndex);
845 bool createTransientImage(VkFormat format, const QSize &pixelSize, VkImageUsageFlags usage,
846 VkImageAspectFlags aspectMask, VkSampleCountFlagBits samples,
847 VkDeviceMemory *mem, VkImage *images, VkImageView *views, int count);
848
849 bool recreateSwapChain(QRhiSwapChain *swapChain);
850 void releaseSwapChainResources(QRhiSwapChain *swapChain);
851
855 bool hasDepthStencil,
856 VkSampleCountFlagBits samples,
857 VkFormat colorFormat,
858 QRhiShadingRateMap *shadingRateMap);
860 const QRhiColorAttachment *colorAttachmentsBegin,
861 const QRhiColorAttachment *colorAttachmentsEnd,
862 bool preserveColor,
863 bool preserveDs,
864 bool storeDs,
865 QRhiRenderBuffer *depthStencilBuffer,
866 QRhiTexture *depthTexture,
867 QRhiTexture *depthResolveTexture,
868 QRhiShadingRateMap *shadingRateMap);
869 bool ensurePipelineCache(const void *initialData = nullptr, size_t initialDataSize = 0);
870 VkShaderModule createShader(const QByteArray &spirv);
871
872 void prepareNewFrame(QRhiCommandBuffer *cb);
874 void endAndEnqueueSecondaryCommandBuffer(VkCommandBuffer cb, QVkCommandBuffer *cbD);
875 QRhi::FrameOpResult startPrimaryCommandBuffer(VkCommandBuffer *cb);
876 QRhi::FrameOpResult endAndSubmitPrimaryCommandBuffer(VkCommandBuffer cb, VkFence cmdFence,
877 VkSemaphore *waitSem, VkSemaphore *signalSem);
879 VkDeviceSize subresUploadByteSize(const QRhiTextureSubresourceUploadDescription &subresDesc) const;
881 void prepareUploadSubres(QVkTexture *texD, int layer, int level,
882 const QRhiTextureSubresourceUploadDescription &subresDesc,
883 size_t *curOfs, void *mp,
884 BufferImageCopyList *copyInfos);
885 void enqueueResourceUpdates(QVkCommandBuffer *cbD, QRhiResourceUpdateBatch *resourceUpdates);
886 void executeBufferHostWritesForSlot(QVkBuffer *bufD, int slot);
890 QVkBuffer *bufD,
891 int slot,
895 QVkTexture *texD,
900 void executeDeferredReleases(bool forced = false);
901 void finishActiveReadbacks(bool forced = false);
902
903 void setAllocationName(QVkAlloc allocation, const QByteArray &name, int slot = -1);
904 void setObjectName(uint64_t object, VkObjectType type, const QByteArray &name, int slot = -1);
905 void trackedBufferBarrier(QVkCommandBuffer *cbD, QVkBuffer *bufD, int slot,
906 VkAccessFlags access, VkPipelineStageFlags stage);
908 VkImageLayout layout, VkAccessFlags access, VkPipelineStageFlags stage);
910 void subresourceBarrier(QVkCommandBuffer *cbD, VkImage image,
911 VkImageLayout oldLayout, VkImageLayout newLayout,
912 VkAccessFlags srcAccess, VkAccessFlags dstAccess,
913 VkPipelineStageFlags srcStage, VkPipelineStageFlags dstStage,
914 int startLayer, int layerCount,
915 int startLevel, int levelCount);
916 void updateShaderResourceBindings(QRhiShaderResourceBindings *srb);
918 double elapsedSecondsFromTimestamp(quint64 timestamp[2], bool *ok);
919 void printExtraErrorInfo(VkResult err);
920 void printDeviceLossErrorInfo() const;
922
924 QWindow *maybeWindow = nullptr;
926 bool importedDevice = false;
934 bool importedAllocator = false;
936 QVulkanFunctions *f = nullptr;
937 QVulkanDeviceFunctions *df = nullptr;
940#ifdef VK_VERSION_1_1
942#endif
943#ifdef VK_VERSION_1_2
946#endif
947#ifdef VK_VERSION_1_3
949#endif
950#ifdef VK_VERSION_1_4
952#endif
956 bool deviceLost = false;
958
959#ifdef Q_OS_WIN
960 bool adapterLuidValid = false;
962 QDxgiHdrInfo *dxgiHdrInfo = nullptr;
963#endif
964
965#ifdef VK_EXT_debug_utils
970#endif
971
980
981#ifdef VK_KHR_create_renderpass2
983#endif
984
985#ifdef VK_EXT_device_fault
987#endif
988
989 struct {
990 bool compute = false;
991 bool depthClamp = false;
992 bool wideLines = false;
993 bool debugUtils = false;
994 bool deviceFault = false;
996 bool texture3DSliceAs2D = false;
997 bool tessellation = false;
998 bool geometryShader = false;
999 bool nonFillPolygonMode = false;
1000 bool multiView = false;
1001 bool renderPass2KHR = false;
1007 bool drawIndirectMulti = false;
1008 } caps;
1009
1022
1025
1028
1033
1035 OffscreenFrame(QRhiImplementation *rhi)
1036 {
1037 for (int i = 0; i < QVK_FRAMES_IN_FLIGHT; ++i)
1038 cbWrapper[i] = new QVkCommandBuffer(rhi);
1039 }
1041 {
1042 for (int i = 0; i < QVK_FRAMES_IN_FLIGHT; ++i)
1043 delete cbWrapper[i];
1044 }
1045 bool active = false;
1049 } ofr;
1050
1070
1085 int lastActiveFrameSlot; // -1 if not used otherwise 0..FRAMES_IN_FLIGHT-1
1086 union {
1087 struct {
1090 } pipelineState;
1091 struct {
1094 } shaderResourceBindings;
1095 struct {
1100 } buffer;
1101 struct {
1105 } renderBuffer;
1106 struct {
1107 VkImage image;
1108 VkImageView imageView;
1110 VkBuffer stagingBuffers[QVK_FRAMES_IN_FLIGHT];
1111 QVkAlloc stagingAllocations[QVK_FRAMES_IN_FLIGHT];
1112 VkImageView extraImageViews[QRhi::MAX_MIP_LEVELS];
1113 } texture;
1114 struct {
1116 } sampler;
1117 struct {
1124 } textureRenderTarget;
1125 struct {
1127 } renderPass;
1128 struct {
1131 } stagingBuffer;
1132 struct {
1134 } secondaryCommandBuffer;
1135 };
1136 };
1138
1139#ifdef VK_KHR_fragment_shading_rate
1142#endif
1143
1148};
1149
1154
1155QT_END_NAMESPACE
1156
1157#endif
const char * constData() const
Definition qrhi_p.h:372
bool isEmpty() const
Definition qrhi.cpp:11979
void registerBuffer(QRhiBuffer *buf, int slot, BufferAccess *access, BufferStage *stage, const UsageState &state)
Definition qrhi.cpp:11996
void registerTexture(QRhiTexture *tex, TextureAccess *access, TextureStage *stage, const UsageState &state)
Definition qrhi.cpp:12036
static QRhiResourceUpdateBatchPrivate * get(QRhiResourceUpdateBatch *b)
Definition qrhi_p.h:597
QVarLengthArray< DescriptorPoolData, 8 > descriptorPools
void recordTransitionPassResources(QVkCommandBuffer *cbD, const QRhiPassResourceTracker &tracker)
QVulkanFunctions * f
quint32 gfxQueueFamilyIdx
VkCommandBuffer startSecondaryCommandBuffer(QVkRenderTargetData *rtD=nullptr)
QRhiSwapChain * createSwapChain() override
PFN_vkGetSwapchainImagesKHR vkGetSwapchainImagesKHR
void debugMarkMsg(QRhiCommandBuffer *cb, const QByteArray &msg) override
int resourceLimit(QRhi::ResourceLimit limit) const override
bool isDeviceLost() const override
void prepareUploadSubres(QVkTexture *texD, int layer, int level, const QRhiTextureSubresourceUploadDescription &subresDesc, size_t *curOfs, void *mp, BufferImageCopyList *copyInfos)
VkPhysicalDeviceProperties physDevProperties
void executeDeferredReleases(bool forced=false)
uint32_t chooseTransientImageMemType(VkImage img, uint32_t startIndex)
QRhi::FrameOpResult finish() override
quint32 timestampValidBits
QRhiTextureRenderTarget * createTextureRenderTarget(const QRhiTextureRenderTargetDescription &desc, QRhiTextureRenderTarget::Flags flags) override
bool createTransientImage(VkFormat format, const QSize &pixelSize, VkImageUsageFlags usage, VkImageAspectFlags aspectMask, VkSampleCountFlagBits samples, VkDeviceMemory *mem, VkImage *images, VkImageView *views, int count)
void setScissor(QRhiCommandBuffer *cb, const QRhiScissor &scissor) override
void releaseCachedResources() override
QVkSwapChain * currentSwapChain
bool geometryShader
bool importedDevice
QByteArrayList requestedDeviceExtensions
QRhiVulkan(QRhiVulkanInitParams *params, QRhiVulkanNativeHandles *importParams=nullptr)
void draw(QRhiCommandBuffer *cb, quint32 vertexCount, quint32 instanceCount, quint32 firstVertex, quint32 firstInstance) override
void setStencilRef(QRhiCommandBuffer *cb, quint32 refValue) override
void endComputePass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override
QList< int > supportedSampleCounts() const override
void destroy() override
QRhiRenderBuffer * createRenderBuffer(QRhiRenderBuffer::Type type, const QSize &pixelSize, int sampleCount, QRhiRenderBuffer::Flags flags, QRhiTexture::Format backingFormatHint) override
QRhi::FrameOpResult endOffscreenFrame(QRhi::EndFrameFlags flags) override
QBitArray timestampQueryPoolMap
void updateShaderResourceBindings(QRhiShaderResourceBindings *srb)
double elapsedSecondsFromTimestamp(quint64 timestamp[2], bool *ok)
VkFormat optimalDsFormat
QRhi::FrameOpResult beginOffscreenFrame(QRhiCommandBuffer **cb, QRhi::BeginFrameFlags flags) override
bool imageBasedShadingRate
bool createOffscreenRenderPass(QVkRenderPassDescriptor *rpD, const QRhiColorAttachment *colorAttachmentsBegin, const QRhiColorAttachment *colorAttachmentsEnd, bool preserveColor, bool preserveDs, bool storeDs, QRhiRenderBuffer *depthStencilBuffer, QRhiTexture *depthTexture, QRhiTexture *depthResolveTexture, QRhiShadingRateMap *shadingRateMap)
QVarLengthArray< VkSemaphore, 4 > waitSemaphoresForPresent
void trackedBufferBarrier(QVkCommandBuffer *cbD, QVkBuffer *bufD, int slot, VkAccessFlags access, VkPipelineStageFlags stage)
QRhi::FrameOpResult waitCommandCompletion(int frameSlot)
void endExternal(QRhiCommandBuffer *cb) override
QWindow * maybeWindow
void dispatch(QRhiCommandBuffer *cb, int x, int y, int z) override
VkPhysicalDeviceFeatures physDevFeatures
bool perDrawShadingRate
QRhiVulkanNativeHandles nativeHandlesStruct
bool allocateDescriptorSet(VkDescriptorSetAllocateInfo *allocInfo, VkDescriptorSet *result, int *resultPoolIndex)
bool drawIndirectMulti
bool isTextureFormatSupported(QRhiTexture::Format format, QRhiTexture::Flags flags) const override
VkDevice dev
QVersionNumber apiVersion
void drawIndexedIndirect(QRhiCommandBuffer *cb, QRhiBuffer *indirectBuffer, quint32 indirectBufferOffset, quint32 drawCount, quint32 stride) override
VkResult createDescriptorPool(VkDescriptorPool *pool)
void prepareNewFrame(QRhiCommandBuffer *cb)
void subresourceBarrier(QVkCommandBuffer *cbD, VkImage image, VkImageLayout oldLayout, VkImageLayout newLayout, VkAccessFlags srcAccess, VkAccessFlags dstAccess, VkPipelineStageFlags srcStage, VkPipelineStageFlags dstStage, int startLayer, int layerCount, int startLevel, int levelCount)
QList< QSize > supportedShadingRates(int sampleCount) const override
void printExtraErrorInfo(VkResult err)
void setComputePipeline(QRhiCommandBuffer *cb, QRhiComputePipeline *ps) override
QRhi::FrameOpResult beginFrame(QRhiSwapChain *swapChain, QRhi::BeginFrameFlags flags) override
QRhi::FrameOpResult startPrimaryCommandBuffer(VkCommandBuffer *cb)
bool renderPass2KHR
double lastCompletedGpuTime(QRhiCommandBuffer *cb) override
bool depthStencilResolveKHR
void trackedRegisterTexture(QRhiPassResourceTracker *passResTracker, QVkTexture *texD, QRhiPassResourceTracker::TextureAccess access, QRhiPassResourceTracker::TextureStage stage)
bool releaseCachedResourcesCalledBeforeFrameStart
QRhi::Flags rhiFlags
PFN_vkCreateSwapchainKHR vkCreateSwapchainKHR
QRhiGraphicsPipeline * createGraphicsPipeline() override
QRhiComputePipeline * createComputePipeline() override
bool nonFillPolygonMode
void setAllocationName(QVkAlloc allocation, const QByteArray &name, int slot=-1)
QRhiTexture * createTexture(QRhiTexture::Format format, const QSize &pixelSize, int depth, int arraySize, int sampleCount, QRhiTexture::Flags flags) override
void debugMarkBegin(QRhiCommandBuffer *cb, const QByteArray &name) override
const QRhiNativeHandles * nativeHandles(QRhiCommandBuffer *cb) override
PFN_vkGetPhysicalDeviceSurfacePresentModesKHR vkGetPhysicalDeviceSurfacePresentModesKHR
bool recreateSwapChain(QRhiSwapChain *swapChain)
PFN_vkQueuePresentKHR vkQueuePresentKHR
void printDeviceLossErrorInfo() const
bool ensurePipelineCache(const void *initialData=nullptr, size_t initialDataSize=0)
QRhiDriverInfo driverInfoStruct
void resourceUpdate(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override
QVarLengthArray< TextureReadback, 2 > activeTextureReadbacks
bool texture3DSliceAs2D
void depthStencilExplicitBarrier(QVkCommandBuffer *cbD, QVkRenderBuffer *rbD)
void trackedImageBarrier(QVkCommandBuffer *cbD, QVkTexture *texD, VkImageLayout layout, VkAccessFlags access, VkPipelineStageFlags stage)
VkCommandPool cmdPool[QVK_FRAMES_IN_FLIGHT]
VkShaderModule createShader(const QByteArray &spirv)
void enqueueTransitionPassResources(QVkCommandBuffer *cbD)
void beginComputePass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates, QRhiCommandBuffer::BeginPassFlags flags) override
bool create(QRhi::Flags flags) override
QVulkanDeviceFunctions * df
void setObjectName(uint64_t object, VkObjectType type, const QByteArray &name, int slot=-1)
bool isFeatureSupported(QRhi::Feature feature) const override
PFN_vkGetPhysicalDeviceSurfaceFormatsKHR vkGetPhysicalDeviceSurfaceFormatsKHR
QVarLengthArray< BufferReadback, 2 > activeBufferReadbacks
void recordPrimaryCommandBuffer(QVkCommandBuffer *cbD)
bool isYUpInFramebuffer() const override
int imageBasedShadingRateTileSize
void setShadingRate(QRhiCommandBuffer *cb, const QSize &coarsePixelSize) override
void debugMarkEnd(QRhiCommandBuffer *cb) override
QVulkanInstance * inst
QRhiSampler * createSampler(QRhiSampler::Filter magFilter, QRhiSampler::Filter minFilter, QRhiSampler::Filter mipmapMode, QRhiSampler::AddressMode u, QRhiSampler::AddressMode v, QRhiSampler::AddressMode w) override
PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR vkGetPhysicalDeviceSurfaceCapabilitiesKHR
void releaseSwapChainResources(QRhiSwapChain *swapChain)
QVarLengthArray< VkSemaphore, 4 > signalSemaphoresForQueueSubmit
void drawIndexed(QRhiCommandBuffer *cb, quint32 indexCount, quint32 instanceCount, quint32 firstIndex, qint32 vertexOffset, quint32 firstInstance) override
VkDeviceSize subresUploadByteSize(const QRhiTextureSubresourceUploadDescription &subresDesc) const
void endPass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override
VkQueryPool timestampQueryPool
void trackedRegisterBuffer(QRhiPassResourceTracker *passResTracker, QVkBuffer *bufD, int slot, QRhiPassResourceTracker::BufferAccess access, QRhiPassResourceTracker::BufferStage stage)
VkFormat optimalDepthStencilFormat()
QRhiStats statistics() override
void setGraphicsPipeline(QRhiCommandBuffer *cb, QRhiGraphicsPipeline *ps) override
void drawIndirect(QRhiCommandBuffer *cb, QRhiBuffer *indirectBuffer, quint32 indirectBufferOffset, quint32 drawCount, quint32 stride) override
void activateTextureRenderTarget(QVkCommandBuffer *cbD, QVkTextureRenderTarget *rtD)
PFN_vkDestroySwapchainKHR vkDestroySwapchainKHR
QRhi::AdapterList enumerateAdaptersBeforeCreate(QRhiNativeHandles *nativeHandles) const override
bool vertexAttribDivisor
QMatrix4x4 clipCorrectMatrix
void executeBufferHostWritesForSlot(QVkBuffer *bufD, int slot)
void setQueueSubmitParams(QRhiNativeHandles *params) override
void setDefaultScissor(QVkCommandBuffer *cbD)
bool isYUpInNDC() const override
const QRhiNativeHandles * nativeHandles() override
QVarLengthArray< VkPipelineStageFlags, 4 > semaphoresWaitMasksForQueueSubmit
QRhiShadingRateMap * createShadingRateMap() override
void setPipelineCacheData(const QByteArray &data) override
void setVertexInput(QRhiCommandBuffer *cb, int startBinding, int bindingCount, const QRhiCommandBuffer::VertexInput *bindings, QRhiBuffer *indexBuf, quint32 indexOffset, QRhiCommandBuffer::IndexFormat indexFormat) override
QRhiShaderResourceBindings * createShaderResourceBindings() override
VkPipelineCache pipelineCache
VkDeviceSize ubufAlign
void finishActiveReadbacks(bool forced=false)
void ensureCommandPoolForNewFrame()
QByteArray pipelineCacheData() override
quint32 gfxQueueIdx
VkDeviceSize texbufAlign
QList< DeferredReleaseEntry > releaseQueue
void endAndEnqueueSecondaryCommandBuffer(VkCommandBuffer cb, QVkCommandBuffer *cbD)
QVarLengthArray< VkSemaphore, 4 > waitSemaphoresForQueueSubmit
void beginPass(QRhiCommandBuffer *cb, QRhiRenderTarget *rt, const QColor &colorClearValue, const QRhiDepthStencilClearValue &depthStencilClearValue, QRhiResourceUpdateBatch *resourceUpdates, QRhiCommandBuffer::BeginPassFlags flags) override
void setBlendConstants(QRhiCommandBuffer *cb, const QColor &c) override
QRhiBuffer * createBuffer(QRhiBuffer::Type type, QRhiBuffer::UsageFlags usage, quint32 size) override
bool isClipDepthZeroToOne() const override
void enqueueResourceUpdates(QVkCommandBuffer *cbD, QRhiResourceUpdateBatch *resourceUpdates)
QVarLengthArray< VkCommandBuffer, 4 > freeSecondaryCbs[QVK_FRAMES_IN_FLIGHT]
void setShaderResources(QRhiCommandBuffer *cb, QRhiShaderResourceBindings *srb, int dynamicOffsetCount, const QRhiCommandBuffer::DynamicOffset *dynamicOffsets) override
QVkAllocator allocator
bool importedAllocator
VkQueue gfxQueue
PFN_vkAcquireNextImageKHR vkAcquireNextImageKHR
QMatrix4x4 clipSpaceCorrMatrix() const override
bool tessellation
QSet< QVkSwapChain * > swapchains
int ubufAlignment() const override
QRhiDriverInfo driverInfo() const override
void beginExternal(QRhiCommandBuffer *cb) override
void setViewport(QRhiCommandBuffer *cb, const QRhiViewport &viewport) override
bool createDefaultRenderPass(QVkRenderPassDescriptor *rpD, bool hasDepthStencil, VkSampleCountFlagBits samples, VkFormat colorFormat, QRhiShadingRateMap *shadingRateMap)
QRhi::FrameOpResult endAndSubmitPrimaryCommandBuffer(VkCommandBuffer cb, VkFence cmdFence, VkSemaphore *waitSem, VkSemaphore *signalSem)
QRhi::FrameOpResult endFrame(QRhiSwapChain *swapChain, QRhi::EndFrameFlags flags) override
VkSampleCountFlagBits effectiveSampleCountBits(int sampleCount)
VkPhysicalDevice physDev
bool makeThreadLocalNativeContextCurrent() override
QRhiDriverInfo adapterInfo
QRhiDriverInfo info() const override
VkPhysicalDevice physDev
Combined button and popup list for selecting options.
@ UnBounded
Definition qrhi_p.h:285
@ Bounded
Definition qrhi_p.h:286
#define QRHI_RES_RHI(t)
Definition qrhi_p.h:31
#define QRHI_RES(t, x)
Definition qrhi_p.h:30
static VkPolygonMode toVkPolygonMode(QRhiGraphicsPipeline::PolygonMode mode)
static VkCullModeFlags toVkCullMode(QRhiGraphicsPipeline::CullMode c)
static bool accessIsWrite(VkAccessFlags access)
static VkCompareOp toVkTextureCompareOp(QRhiSampler::CompareOp op)
static QVulkanInstance * globalVulkanInstance
static VkBufferUsageFlagBits toVkBufferUsage(QRhiBuffer::UsageFlags usage)
static QRhiTexture::Format swapchainReadbackTextureFormat(VkFormat format, QRhiTexture::Flags *flags)
static VkStencilOp toVkStencilOp(QRhiGraphicsPipeline::StencilOp op)
static bool qvk_debug_filter(QVulkanInstance::DebugMessageSeverityFlags severity, QVulkanInstance::DebugMessageTypeFlags type, const void *callbackData)
static QVkBuffer::UsageState toVkBufferUsageState(QRhiPassResourceTracker::UsageState usage)
static bool attachmentDescriptionEquals(const VkAttachmentDescription &a, const VkAttachmentDescription &b)
static bool isSrgbFormat(VkFormat format)
static VkPipelineStageFlags toVkPipelineStage(QRhiPassResourceTracker::TextureStage stage)
static VkAccessFlags toVkAccess(QRhiPassResourceTracker::BufferAccess access)
static VkImageLayout toVkLayout(QRhiPassResourceTracker::TextureAccess access)
static VkFormat toVkAttributeFormat(QRhiVertexInputAttribute::Format format)
static QVkTexture::UsageState toVkTextureUsageState(QRhiPassResourceTracker::UsageState usage)
static VkPipelineStageFlags toVkPipelineStage(QRhiPassResourceTracker::BufferStage stage)
static QRhiDriverInfo::DeviceType toRhiDeviceType(VkPhysicalDeviceType type)
static QRhiPassResourceTracker::UsageState toPassTrackerUsageState(const QVkBuffer::UsageState &bufUsage)
static VkColorComponentFlags toVkColorComponents(QRhiGraphicsPipeline::ColorMask c)
static VkFilter toVkFilter(QRhiSampler::Filter f)
static VkPrimitiveTopology toVkTopology(QRhiGraphicsPipeline::Topology t)
static void qrhivk_releaseTexture(const QRhiVulkan::DeferredReleaseEntry &e, VkDevice dev, QVulkanDeviceFunctions *df, void *allocator)
static void qrhivk_releaseBuffer(const QRhiVulkan::DeferredReleaseEntry &e, void *allocator)
static VkAccessFlags toVkAccess(QRhiPassResourceTracker::TextureAccess access)
static VmaAllocator toVmaAllocator(QVkAllocator a)
static VkSamplerAddressMode toVkAddressMode(QRhiSampler::AddressMode m)
static constexpr bool isDepthTextureFormat(QRhiTexture::Format format)
static void fillVkStencilOpState(VkStencilOpState *dst, const QRhiGraphicsPipeline::StencilOpState &src)
VkSampleCountFlagBits mask
static VkShaderStageFlags toVkShaderStageFlags(QRhiShaderResourceBinding::StageFlags stage)
static constexpr VkImageAspectFlags aspectMaskForTextureFormat(QRhiTexture::Format format)
static VkDescriptorType toVkDescriptorType(const QRhiShaderResourceBinding::Data *b)
static VkBlendFactor toVkBlendFactor(QRhiGraphicsPipeline::BlendFactor f)
static void fillDriverInfo(QRhiDriverInfo *info, const VkPhysicalDeviceProperties &physDevProperties)
static VkBlendOp toVkBlendOp(QRhiGraphicsPipeline::BlendOp op)
static void qrhivk_releaseRenderBuffer(const QRhiVulkan::DeferredReleaseEntry &e, VkDevice dev, QVulkanDeviceFunctions *df)
static VkFrontFace toVkFrontFace(QRhiGraphicsPipeline::FrontFace f)
void qrhivk_accumulateComputeResource(T *writtenResources, QRhiResource *resource, QRhiShaderResourceBinding::Type bindingType, int loadTypeVal, int storeTypeVal, int loadStoreTypeVal)
static VkFormat toVkTextureFormat(QRhiTexture::Format format, QRhiTexture::Flags flags)
static VkCompareOp toVkCompareOp(QRhiGraphicsPipeline::CompareOp op)
static void fillRenderPassCreateInfo(VkRenderPassCreateInfo *rpInfo, VkSubpassDescription *subpassDesc, QVkRenderPassDescriptor *rpD)
static VkSamplerMipmapMode toVkMipmapMode(QRhiSampler::Filter f)
static bool hdrFormatMatchesVkSurfaceFormat(QRhiSwapChain::Format f, const VkSurfaceFormatKHR &s)
static void qrhivk_releaseSampler(const QRhiVulkan::DeferredReleaseEntry &e, VkDevice dev, QVulkanDeviceFunctions *df)
int count
static constexpr bool isStencilTextureFormat(QRhiTexture::Format format)
static QVkRenderTargetData * maybeRenderTargetData(QVkCommandBuffer *cbD)
static QRhiPassResourceTracker::UsageState toPassTrackerUsageState(const QVkTexture::UsageState &texUsage)
static VmaAllocation toVmaAllocation(QVkAlloc a)
static void addToChain(T *head, void *entry)
static VkShaderStageFlagBits toVkShaderStage(QRhiShaderStage::Type type)
static const int QVK_UNIFORM_BUFFERS_PER_POOL
static const int QVK_COMBINED_IMAGE_SAMPLERS_PER_POOL
Q_DECLARE_TYPEINFO(QVkCommandBuffer::ComputePassState::AccessFlagsAndIsNew, Q_RELOCATABLE_TYPE)
Q_DECLARE_TYPEINFO(QVkShaderResourceBindings::BoundResourceData, Q_RELOCATABLE_TYPE)
Q_DECLARE_TYPEINFO(QRhiVulkan::TextureReadback, Q_RELOCATABLE_TYPE)
static const int QVK_STORAGE_BUFFERS_PER_POOL
static const int QVK_STORAGE_IMAGES_PER_POOL
static const int QVK_SAMPLED_IMAGES_PER_POOL
void * QVkAllocator
Q_DECLARE_TYPEINFO(QRhiVulkan::DescriptorPoolData, Q_RELOCATABLE_TYPE)
Q_DECLARE_TYPEINFO(QVkBuffer::DynamicUpdate, Q_RELOCATABLE_TYPE)
Q_DECLARE_TYPEINFO(QRhiVulkan::DeferredReleaseEntry, Q_RELOCATABLE_TYPE)
static const int QVK_MAX_ACTIVE_TIMESTAMP_PAIRS
Q_DECLARE_TYPEINFO(QRhiVulkan::BufferReadback, Q_RELOCATABLE_TYPE)
static const int QVK_SAMPLERS_PER_POOL
static const int QVK_DESC_SETS_PER_POOL
void * QVkAlloc
static const int QVK_FRAMES_IN_FLIGHT
bool prepare(VkRenderPassCreateInfo *rpInfo, int multiViewCount, bool multiViewCap)
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
Definition qrhi.h:1867
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
Definition qrhi.h:1557
QRhiReadbackResult * result
VkBuffer stagingBuffers[QVK_FRAMES_IN_FLIGHT]
VkImageView rtv[QVkRenderTargetData::MAX_COLOR_ATTACHMENTS]
QVkAlloc allocations[QVK_FRAMES_IN_FLIGHT]
VkImageView extraImageViews[QRhi::MAX_MIP_LEVELS]
QVkAlloc stagingAllocations[QVK_FRAMES_IN_FLIGHT]
VkImageView resrtv[QVkRenderTargetData::MAX_COLOR_ATTACHMENTS]
VkBuffer buffers[QVK_FRAMES_IN_FLIGHT]
DescriptorPoolData(VkDescriptorPool pool_)
QVkCommandBuffer * cbWrapper[QVK_FRAMES_IN_FLIGHT]
OffscreenFrame(QRhiImplementation *rhi)
QRhiTexture::Format format
QRhiReadbackDescription desc
QRhiReadbackResult * result
VkPipelineStageFlags stage
VkAccessFlags access
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
VkBuffer buffers[QVK_FRAMES_IN_FLIGHT]
QVkBuffer(QRhiImplementation *rhi, Type type, UsageFlags usage, quint32 size)
UsageState usageState[QVK_FRAMES_IN_FLIGHT]
uint generation
VkBuffer stagingBuffers[QVK_FRAMES_IN_FLIGHT]
QVkAlloc allocations[QVK_FRAMES_IN_FLIGHT]
QVkAlloc stagingAllocations[QVK_FRAMES_IN_FLIGHT]
void endFullDynamicBufferUpdateForCurrentFrame() override
To be called when the entire contents of the buffer data has been updated in the memory block returne...
QRhiBuffer::NativeBuffer nativeBuffer() override
bool create() override
Creates the corresponding native graphics resources.
QVarLengthArray< DynamicUpdate, 16 > pendingDynamicUpdates[QVK_FRAMES_IN_FLIGHT]
char * beginFullDynamicBufferUpdateForCurrentFrame() override
int lastActiveFrameSlot
QVarLengthFlatMap< QRhiResource *, AccessFlagsAndIsNew, 12 > writtenResources
VkBuffer currentVertexBuffers[VERTEX_INPUT_RESOURCE_SLOT_COUNT]
QVkCommandBuffer(QRhiImplementation *rhi)
QVector< QRhiPassResourceTracker > passResTrackers
QVarLengthArray< VkCommandBuffer, 4 > activeSecondaryCbStack
QRhiBackendCommandList< Command > commands
QRhiRenderTarget * currentTarget
QVarLengthArray< VkBufferImageCopy, 16 > bufferImageCopy
QRhiVulkanCommandBufferNativeHandles nativeHandlesStruct
QVarLengthArray< VkImageMemoryBarrier, 8 > imageBarrier
QVarLengthArray< VkBufferMemoryBarrier, 8 > bufferBarrier
quint32 currentVertexOffsets[VERTEX_INPUT_RESOURCE_SLOT_COUNT]
QRhiComputePipeline * currentComputePipeline
static const int VERTEX_INPUT_RESOURCE_SLOT_COUNT
const QRhiNativeHandles * nativeHandles()
QRhiShaderResourceBindings * currentComputeSrb
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
QRhiShaderResourceBindings * currentGraphicsSrb
QRhiViewport currentViewport
PassType recordingPass
QVarLengthArray< VkDeviceSize, 4 > vertexBufferOffset
VkBuffer currentIndexBuffer
VkCommandBuffer cb
QVarLengthArray< VkBuffer, 4 > vertexBuffer
QRhiGraphicsPipeline * currentGraphicsPipeline
QVarLengthArray< VkClearValue, 4 > clearValue
uint currentPipelineGeneration
quint32 currentIndexOffset
QVarLengthArray< uint32_t, 4 > dynamicOffset
QVarLengthArray< QByteArray, 4 > debugMarkerData
VkIndexType currentIndexFormat
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
QVkComputePipeline(QRhiImplementation *rhi)
bool create() override
VkPipelineLayout layout
QVkGraphicsPipeline(QRhiImplementation *rhi)
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
VkPipelineLayout layout
bool create() override
Creates the corresponding native graphics resources.
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
QVkRenderBuffer(QRhiImplementation *rhi, Type type, const QSize &pixelSize, int sampleCount, Flags flags, QRhiTexture::Format backingFormatHint)
VkFormat vkformat
VkSampleCountFlagBits samples
QRhiTexture::Format backingFormat() const override
bool create() override
Creates the corresponding native graphics resources.
VkDeviceMemory memory
QVkTexture * backingTexture
VkImageView imageView
QVarLengthArray< VkSubpassDependency, 2 > subpassDeps
const QRhiNativeHandles * nativeHandles() override
QVector< quint32 > serializedFormatData
QVarLengthArray< VkAttachmentReference, 8 > colorRefs
QRhiRenderPassDescriptor * newCompatibleRenderPassDescriptor() const override
VkAttachmentReference dsRef
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
QVarLengthArray< VkAttachmentReference, 8 > resolveRefs
QVarLengthArray< VkAttachmentDescription, 8 > attDescs
VkAttachmentReference shadingRateRef
QRhiVulkanRenderPassNativeHandles nativeHandlesStruct
VkAttachmentReference dsResolveRef
QVector< quint32 > serializedFormat() const override
QVkRenderPassDescriptor(QRhiImplementation *rhi)
bool isCompatible(const QRhiRenderPassDescriptor *other) const override
QVkRenderPassDescriptor * rp
QRhiRenderTargetAttachmentTracker::ResIdList currentResIdList
static const int MAX_COLOR_ATTACHMENTS
int lastActiveFrameSlot
bool create() override
VkSampler sampler
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
QVkSampler(QRhiImplementation *rhi, Filter magFilter, Filter minFilter, Filter mipmapMode, AddressMode u, AddressMode v, AddressMode w)
VkDescriptorSetLayout layout
void updateResources(UpdateFlags flags) override
QVkShaderResourceBindings(QRhiImplementation *rhi)
bool create() override
Creates the corresponding resource binding set.
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
QVarLengthArray< QRhiShaderResourceBinding, BINDING_PREALLOC > sortedBindings
QVarLengthArray< BoundResourceData, BINDING_PREALLOC > boundResourceData[QVK_FRAMES_IN_FLIGHT]
VkDescriptorSet descSets[QVK_FRAMES_IN_FLIGHT]
bool createFrom(QRhiTexture *src) override
Sets up the shading rate map to use the texture src as the image containing the per-tile shading rate...
QVkShadingRateMap(QRhiImplementation *rhi)
QVkTexture * texture
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
QSize pixelSize() const override
int sampleCount() const override
float devicePixelRatio() const override
QVkRenderTargetData d
QVkSwapChainRenderTarget(QRhiImplementation *rhi, QRhiSwapChain *swapchain)
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
VkColorSpaceKHR colorSpace
VkSurfaceKHR lastConnectedSurface
bool createOrResize() override
Creates the swapchain if not already done and resizes the swapchain buffers to match the current size...
VkSwapchainKHR sc
QRhiRenderTarget * currentFrameRenderTarget(StereoTargetBuffer targetBuffer) override
VkFormat colorFormat
bool isFormatSupported(Format f) override
QVkCommandBuffer cbWrapper
static const quint32 EXPECTED_MAX_BUFFER_COUNT
const VkFormat defaultSrgbColorFormat
QRhiRenderPassDescriptor * newCompatibleRenderPassDescriptor() override
VkSampleCountFlagBits samples
bool supportsReadback
QVkSwapChain(QRhiImplementation *rhi)
QVkRenderBuffer * ds
quint32 currentFrameSlot
QSize surfacePixelSize() override
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
VkDeviceMemory msaaImageMem
QRhiRenderTarget * currentFrameRenderTarget() override
quint32 currentImageIndex
QVarLengthArray< ImageResources, EXPECTED_MAX_BUFFER_COUNT > imageRes
VkSurfaceKHR surface
QVarLengthArray< VkPresentModeKHR, 8 > supportedPresentationModes
QWindow * window
QVkSwapChainRenderTarget rtWrapperRight
VkImageView shadingRateMapView
bool ensureSurface()
QVkSwapChainRenderTarget rtWrapper
QRhiSwapChainHdrInfo hdrInfo() override
\variable QRhiSwapChainHdrInfo::limitsType
QRhiCommandBuffer * currentFrameCommandBuffer() override
const VkFormat defaultColorFormat
VkImageView shadingRateMapView
QVkTextureRenderTarget(QRhiImplementation *rhi, const QRhiTextureRenderTargetDescription &desc, Flags flags)
float devicePixelRatio() const override
VkImageView rtv[QVkRenderTargetData::MAX_COLOR_ATTACHMENTS]
bool create() override
Creates the corresponding native graphics resources.
int sampleCount() const override
QSize pixelSize() const override
QVkRenderTargetData d
VkImageView resrtv[QVkRenderTargetData::MAX_COLOR_ATTACHMENTS]
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
QRhiRenderPassDescriptor * newCompatibleRenderPassDescriptor() override
VkPipelineStageFlags stage
bool create() override
Creates the corresponding native graphics resources.
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
VkBuffer stagingBuffers[QVK_FRAMES_IN_FLIGHT]
VkFormat vkformat
bool finishCreate()
VkImageView perLevelImageViewForLoadStore(int level)
VkSampleCountFlagBits samples
int lastActiveFrameSlot
QVkAlloc stagingAllocations[QVK_FRAMES_IN_FLIGHT]
bool createFrom(NativeTexture src) override
Similar to create(), except that no new native textures are created.
VkFormat viewFormat
QVkAlloc imageAlloc
VkImage image
void setNativeLayout(int layout) override
With some graphics APIs, such as Vulkan, integrating custom rendering code that uses the graphics API...
VkFormat viewFormatForSampling
QVkTexture(QRhiImplementation *rhi, Format format, const QSize &pixelSize, int depth, int arraySize, int sampleCount, Flags flags)
VkImageView perLevelImageViews[QRhi::MAX_MIP_LEVELS]
NativeTexture nativeTexture() override
UsageState usageState
bool prepareCreate(QSize *adjustedSize=nullptr)
uint mipLevelCount
VkImageView imageView
VkDependencyFlags dependencyFlags
VkPipelineStageFlags srcStageMask
VkPipelineStageFlags dstStageMask
VkRenderPassBeginInfo desc
VkPipelineBindPoint bindPoint