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_STORAGE_BUFFERS_PER_POOL = 128;
36static const int QVK_STORAGE_IMAGES_PER_POOL = 128;
37
38static const int QVK_MAX_ACTIVE_TIMESTAMP_PAIRS = 16;
39
40// no vk_mem_alloc.h available here, void* is good enough
41typedef void * QVkAlloc;
42typedef void * QVkAllocator;
43
72
74
75struct QVkTexture;
76
78{
79 QVkRenderBuffer(QRhiImplementation *rhi, Type type, const QSize &pixelSize,
80 int sampleCount, Flags flags,
81 QRhiTexture::Format backingFormatHint);
83 void destroy() override;
84 bool create() override;
85 QRhiTexture::Format backingFormat() const override;
86
95 friend class QRhiVulkan;
96};
97
98struct QVkTexture : public QRhiTexture
99{
100 QVkTexture(QRhiImplementation *rhi, Format format, const QSize &pixelSize, int depth,
101 int arraySize, int sampleCount, Flags flags);
102 ~QVkTexture();
103 void destroy() override;
104 bool create() override;
105 bool createFrom(NativeTexture src) override;
106 NativeTexture nativeTexture() override;
107 void setNativeLayout(int layout) override;
108
109 bool prepareCreate(QSize *adjustedSize = nullptr);
110 bool finishCreate();
112
119 bool owns = true;
120 struct UsageState {
121 // no tracking of subresource layouts (some operations can keep
122 // subresources in different layouts for some time, but that does not
123 // need to be kept track of)
127 };
136 friend class QRhiVulkan;
137};
138
139struct QVkSampler : public QRhiSampler
140{
141 QVkSampler(QRhiImplementation *rhi, Filter magFilter, Filter minFilter, Filter mipmapMode,
142 AddressMode u, AddressMode v, AddressMode w);
143 ~QVkSampler();
144 void destroy() override;
145 bool create() override;
146
150 friend class QRhiVulkan;
151};
152
154{
155 QVkShadingRateMap(QRhiImplementation *rhi);
157 void destroy() override;
158 bool createFrom(QRhiTexture *src) override;
159
160 QVkTexture *texture = nullptr; // not owned
161 friend class QRhiVulkan;
162};
163
193
210
212{
213 QVkSwapChainRenderTarget(QRhiImplementation *rhi, QRhiSwapChain *swapchain);
215 void destroy() override;
216
217 QSize pixelSize() const override;
218 float devicePixelRatio() const override;
219 int sampleCount() const override;
220
222};
223
246
248{
249 QVkShaderResourceBindings(QRhiImplementation *rhi);
251 void destroy() override;
252 bool create() override;
253 void updateResources(UpdateFlags flags) override;
254
256 bool hasDynamicOffset = false;
257 int poolIndex = -1;
259 VkDescriptorSet descSets[QVK_FRAMES_IN_FLIGHT]; // multiple sets to support dynamic buffers
262
263 // Keep track of the generation number of each referenced QRhi* to be able
264 // to detect that the underlying descriptor set became out of date and they
265 // need to be written again with the up-to-date VkBuffer etc. objects.
271 int count;
272 struct {
277 } d[QRhiShaderResourceBinding::Data::MAX_TEX_SAMPLER_ARRAY_SIZE];
278 };
296
297 friend class QRhiVulkan;
298};
299
301
315
329
331{
332 QVkCommandBuffer(QRhiImplementation *rhi);
334 void destroy() override;
335
337
340
346
347 void resetState() {
349 passUsesSecondaryCb = false;
350 lastGpuTime = 0;
351 currentTarget = nullptr;
352 activeSecondaryCbStack.clear();
355 }
356
358 currentGraphicsPipeline = nullptr;
359 currentComputePipeline = nullptr;
360 currentPipelineGeneration = 0;
361 currentGraphicsSrb = nullptr;
362 currentComputeSrb = nullptr;
363 currentSrbGeneration = 0;
365 currentIndexBuffer = VK_NULL_HANDLE;
366 currentIndexOffset = 0;
367 currentIndexFormat = VK_INDEX_TYPE_UINT16;
368 memset(currentVertexBuffers, 0, sizeof(currentVertexBuffers));
369 memset(currentVertexOffsets, 0, sizeof(currentVertexOffsets));
370 inExternal = false;
371 hasShadingRateSet = false;
372 }
373
376 double lastGpuTime = 0;
388 static const int VERTEX_INPUT_RESOURCE_SLOT_COUNT = 32;
394
395 struct {
397 void reset() {
398 writtenResources.clear();
399 }
400 } computePassState;
401
402 struct Command {
433
434 union Args {
435 struct {
439 } copyBuffer;
440 struct {
441 VkBuffer src;
444 int count;
446 } copyBufferToImage;
447 struct {
450 VkImage dst;
451 VkImageLayout dstLayout;
453 } copyImage;
454 struct {
455 VkImage src;
456 VkImageLayout srcLayout;
457 VkBuffer dst;
459 } copyImageToBuffer;
460 struct {
463 int count;
464 int index;
465 } imageBarrier;
466 struct {
467 VkPipelineStageFlags srcStageMask;
468 VkPipelineStageFlags dstStageMask;
472 } memoryBarrier;
473 struct {
474 VkPipelineStageFlags srcStageMask;
475 VkPipelineStageFlags dstStageMask;
476 int count;
477 int index;
478 } bufferBarrier;
479 struct {
480 VkImage src;
481 VkImageLayout srcLayout;
482 VkImage dst;
483 VkImageLayout dstLayout;
486 } blitImage;
487 struct {
491 } beginRenderPass;
492 struct {
493 } endRenderPass;
494 struct {
497 } bindPipeline;
498 struct {
499 VkPipelineBindPoint bindPoint;
504 } bindDescriptorSet;
505 struct {
507 int count;
510 } bindVertexBuffer;
511 struct {
515 } bindIndexBuffer;
516 struct {
518 } setViewport;
519 struct {
521 } setScissor;
522 struct {
523 float c[4];
524 } setBlendConstants;
525 struct {
527 } setStencilRef;
528 struct {
533 } draw;
534 struct {
536 uint32_t instanceCount;
539 uint32_t firstInstance;
540 } drawIndexed;
541 struct {
542#ifdef VK_EXT_debug_utils
543 VkDebugUtilsLabelEXT label;
544 int labelNameIndex;
545#endif
546 } debugMarkerBegin;
547 struct {
548 } debugMarkerEnd;
549 struct {
550#ifdef VK_EXT_debug_utils
551 VkDebugUtilsLabelEXT label;
552 int labelNameIndex;
553#endif
554 } debugMarkerInsert;
555 struct {
557 } transitionResources;
558 struct {
559 int x, y, z;
560 } dispatch;
561 struct {
563 } executeSecondary;
564 struct {
567 } setShadingRate;
568 } args;
569 };
570
574
576 commands.reset();
578
579 passResTrackers.clear();
581 }
582
583 void resetPools() {
584 pools.clearValue.clear();
585 pools.bufferImageCopy.clear();
586 pools.dynamicOffset.clear();
587 pools.vertexBuffer.clear();
588 pools.vertexBufferOffset.clear();
589 pools.debugMarkerData.clear();
590 pools.imageBarrier.clear();
591 pools.bufferBarrier.clear();
592 }
593
594 struct {
603 } pools;
604
605 friend class QRhiVulkan;
606};
607
609{
610 QVkSwapChain(QRhiImplementation *rhi);
611 ~QVkSwapChain();
612 void destroy() override;
613
614 QRhiCommandBuffer *currentFrameCommandBuffer() override;
616 QRhiRenderTarget *currentFrameRenderTarget(StereoTargetBuffer targetBuffer) override;
617
618 QSize surfacePixelSize() override;
619 bool isFormatSupported(Format f) override;
621
624
625 bool ensureSurface();
626
628
629 QWindow *window = nullptr;
631 bool supportsReadback = false;
632 bool stereo = false;
634 int bufferCount = 0;
639 QVkRenderBuffer *ds = nullptr;
647
663
673
674 quint32 currentImageIndex = 0; // index in imageRes
675 quint32 currentFrameSlot = 0; // index in frameRes
676 int frameCount = 0;
677
678 friend class QRhiVulkan;
679};
680
682{
683public:
684 QRhiDriverInfo info() const override;
685
688};
689
691{
692public:
693 QRhiVulkan(QRhiVulkanInitParams *params, QRhiVulkanNativeHandles *importParams = nullptr);
694
695 bool create(QRhi::Flags flags) override;
696 void destroy() override;
697 QRhi::AdapterList enumerateAdaptersBeforeCreate(QRhiNativeHandles *nativeHandles) const override;
698
702 QRhiBuffer *createBuffer(QRhiBuffer::Type type,
703 QRhiBuffer::UsageFlags usage,
704 quint32 size) override;
705 QRhiRenderBuffer *createRenderBuffer(QRhiRenderBuffer::Type type,
706 const QSize &pixelSize,
707 int sampleCount,
708 QRhiRenderBuffer::Flags flags,
709 QRhiTexture::Format backingFormatHint) override;
710 QRhiTexture *createTexture(QRhiTexture::Format format,
711 const QSize &pixelSize,
712 int depth,
713 int arraySize,
714 int sampleCount,
715 QRhiTexture::Flags flags) override;
716 QRhiSampler *createSampler(QRhiSampler::Filter magFilter,
717 QRhiSampler::Filter minFilter,
718 QRhiSampler::Filter mipmapMode,
719 QRhiSampler:: AddressMode u,
720 QRhiSampler::AddressMode v,
721 QRhiSampler::AddressMode w) override;
722
723 QRhiTextureRenderTarget *createTextureRenderTarget(const QRhiTextureRenderTargetDescription &desc,
724 QRhiTextureRenderTarget::Flags flags) override;
725
726 QRhiShadingRateMap *createShadingRateMap() override;
727
728 QRhiSwapChain *createSwapChain() override;
729 QRhi::FrameOpResult beginFrame(QRhiSwapChain *swapChain, QRhi::BeginFrameFlags flags) override;
730 QRhi::FrameOpResult endFrame(QRhiSwapChain *swapChain, QRhi::EndFrameFlags flags) override;
731 QRhi::FrameOpResult beginOffscreenFrame(QRhiCommandBuffer **cb, QRhi::BeginFrameFlags flags) override;
732 QRhi::FrameOpResult endOffscreenFrame(QRhi::EndFrameFlags flags) override;
733 QRhi::FrameOpResult finish() override;
734
735 void resourceUpdate(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override;
736
737 void beginPass(QRhiCommandBuffer *cb,
738 QRhiRenderTarget *rt,
739 const QColor &colorClearValue,
740 const QRhiDepthStencilClearValue &depthStencilClearValue,
741 QRhiResourceUpdateBatch *resourceUpdates,
742 QRhiCommandBuffer::BeginPassFlags flags) override;
743 void endPass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override;
744
745 void setGraphicsPipeline(QRhiCommandBuffer *cb,
746 QRhiGraphicsPipeline *ps) override;
747
748 void setShaderResources(QRhiCommandBuffer *cb,
749 QRhiShaderResourceBindings *srb,
750 int dynamicOffsetCount,
751 const QRhiCommandBuffer::DynamicOffset *dynamicOffsets) override;
752
753 void setVertexInput(QRhiCommandBuffer *cb,
754 int startBinding, int bindingCount, const QRhiCommandBuffer::VertexInput *bindings,
755 QRhiBuffer *indexBuf, quint32 indexOffset,
756 QRhiCommandBuffer::IndexFormat indexFormat) override;
757
758 void setViewport(QRhiCommandBuffer *cb, const QRhiViewport &viewport) override;
759 void setScissor(QRhiCommandBuffer *cb, const QRhiScissor &scissor) override;
760 void setBlendConstants(QRhiCommandBuffer *cb, const QColor &c) override;
761 void setStencilRef(QRhiCommandBuffer *cb, quint32 refValue) override;
762 void setShadingRate(QRhiCommandBuffer *cb, const QSize &coarsePixelSize) override;
763
764 void draw(QRhiCommandBuffer *cb, quint32 vertexCount,
765 quint32 instanceCount, quint32 firstVertex, quint32 firstInstance) override;
766
767 void drawIndexed(QRhiCommandBuffer *cb, quint32 indexCount,
768 quint32 instanceCount, quint32 firstIndex,
769 qint32 vertexOffset, quint32 firstInstance) override;
770
771 void debugMarkBegin(QRhiCommandBuffer *cb, const QByteArray &name) override;
772 void debugMarkEnd(QRhiCommandBuffer *cb) override;
773 void debugMarkMsg(QRhiCommandBuffer *cb, const QByteArray &msg) override;
774
775 void beginComputePass(QRhiCommandBuffer *cb,
776 QRhiResourceUpdateBatch *resourceUpdates,
777 QRhiCommandBuffer::BeginPassFlags flags) override;
778 void endComputePass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override;
779 void setComputePipeline(QRhiCommandBuffer *cb, QRhiComputePipeline *ps) override;
780 void dispatch(QRhiCommandBuffer *cb, int x, int y, int z) override;
781
782 const QRhiNativeHandles *nativeHandles(QRhiCommandBuffer *cb) override;
783 void beginExternal(QRhiCommandBuffer *cb) override;
784 void endExternal(QRhiCommandBuffer *cb) override;
785 double lastCompletedGpuTime(QRhiCommandBuffer *cb) override;
786
787 QList<int> supportedSampleCounts() const override;
788 QList<QSize> supportedShadingRates(int sampleCount) const override;
789 int ubufAlignment() const override;
790 bool isYUpInFramebuffer() const override;
791 bool isYUpInNDC() const override;
792 bool isClipDepthZeroToOne() const override;
793 QMatrix4x4 clipSpaceCorrMatrix() const override;
794 bool isTextureFormatSupported(QRhiTexture::Format format, QRhiTexture::Flags flags) const override;
795 bool isFeatureSupported(QRhi::Feature feature) const override;
796 int resourceLimit(QRhi::ResourceLimit limit) const override;
797 const QRhiNativeHandles *nativeHandles() override;
798 QRhiDriverInfo driverInfo() const override;
799 QRhiStats statistics() override;
801 void setQueueSubmitParams(QRhiNativeHandles *params) override;
803 bool isDeviceLost() const override;
804
805 QByteArray pipelineCacheData() override;
806 void setPipelineCacheData(const QByteArray &data) override;
807
808 VkResult createDescriptorPool(VkDescriptorPool *pool);
809 bool allocateDescriptorSet(VkDescriptorSetAllocateInfo *allocInfo, VkDescriptorSet *result, int *resultPoolIndex);
810 uint32_t chooseTransientImageMemType(VkImage img, uint32_t startIndex);
811 bool createTransientImage(VkFormat format, const QSize &pixelSize, VkImageUsageFlags usage,
812 VkImageAspectFlags aspectMask, VkSampleCountFlagBits samples,
813 VkDeviceMemory *mem, VkImage *images, VkImageView *views, int count);
814
815 bool recreateSwapChain(QRhiSwapChain *swapChain);
816 void releaseSwapChainResources(QRhiSwapChain *swapChain);
817
821 bool hasDepthStencil,
822 VkSampleCountFlagBits samples,
823 VkFormat colorFormat,
824 QRhiShadingRateMap *shadingRateMap);
826 const QRhiColorAttachment *colorAttachmentsBegin,
827 const QRhiColorAttachment *colorAttachmentsEnd,
828 bool preserveColor,
829 bool preserveDs,
830 bool storeDs,
831 QRhiRenderBuffer *depthStencilBuffer,
832 QRhiTexture *depthTexture,
833 QRhiTexture *depthResolveTexture,
834 QRhiShadingRateMap *shadingRateMap);
835 bool ensurePipelineCache(const void *initialData = nullptr, size_t initialDataSize = 0);
836 VkShaderModule createShader(const QByteArray &spirv);
837
838 void prepareNewFrame(QRhiCommandBuffer *cb);
840 void endAndEnqueueSecondaryCommandBuffer(VkCommandBuffer cb, QVkCommandBuffer *cbD);
841 QRhi::FrameOpResult startPrimaryCommandBuffer(VkCommandBuffer *cb);
842 QRhi::FrameOpResult endAndSubmitPrimaryCommandBuffer(VkCommandBuffer cb, VkFence cmdFence,
843 VkSemaphore *waitSem, VkSemaphore *signalSem);
845 VkDeviceSize subresUploadByteSize(const QRhiTextureSubresourceUploadDescription &subresDesc) const;
847 void prepareUploadSubres(QVkTexture *texD, int layer, int level,
848 const QRhiTextureSubresourceUploadDescription &subresDesc,
849 size_t *curOfs, void *mp,
850 BufferImageCopyList *copyInfos);
851 void enqueueResourceUpdates(QVkCommandBuffer *cbD, QRhiResourceUpdateBatch *resourceUpdates);
852 void executeBufferHostWritesForSlot(QVkBuffer *bufD, int slot);
856 QVkBuffer *bufD,
857 int slot,
861 QVkTexture *texD,
866 void executeDeferredReleases(bool forced = false);
867 void finishActiveReadbacks(bool forced = false);
868
869 void setAllocationName(QVkAlloc allocation, const QByteArray &name, int slot = -1);
870 void setObjectName(uint64_t object, VkObjectType type, const QByteArray &name, int slot = -1);
871 void trackedBufferBarrier(QVkCommandBuffer *cbD, QVkBuffer *bufD, int slot,
872 VkAccessFlags access, VkPipelineStageFlags stage);
874 VkImageLayout layout, VkAccessFlags access, VkPipelineStageFlags stage);
876 void subresourceBarrier(QVkCommandBuffer *cbD, VkImage image,
877 VkImageLayout oldLayout, VkImageLayout newLayout,
878 VkAccessFlags srcAccess, VkAccessFlags dstAccess,
879 VkPipelineStageFlags srcStage, VkPipelineStageFlags dstStage,
880 int startLayer, int layerCount,
881 int startLevel, int levelCount);
882 void updateShaderResourceBindings(QRhiShaderResourceBindings *srb);
884 double elapsedSecondsFromTimestamp(quint64 timestamp[2], bool *ok);
885 void printExtraErrorInfo(VkResult err);
886 void printDeviceLossErrorInfo() const;
887
889 QWindow *maybeWindow = nullptr;
891 bool importedDevice = false;
899 bool importedAllocator = false;
901 QVulkanFunctions *f = nullptr;
902 QVulkanDeviceFunctions *df = nullptr;
905#ifdef VK_VERSION_1_1
907#endif
908#ifdef VK_VERSION_1_2
911#endif
912#ifdef VK_VERSION_1_3
914#endif
918 bool deviceLost = false;
920
921#ifdef Q_OS_WIN
922 bool adapterLuidValid = false;
924 QDxgiHdrInfo *dxgiHdrInfo = nullptr;
925#endif
926
927#ifdef VK_EXT_debug_utils
932#endif
933
942
943#ifdef VK_KHR_create_renderpass2
945#endif
946
947#ifdef VK_EXT_device_fault
949#endif
950
951 struct {
952 bool compute = false;
953 bool depthClamp = false;
954 bool wideLines = false;
955 bool debugUtils = false;
956 bool deviceFault = false;
958 bool texture3DSliceAs2D = false;
959 bool tessellation = false;
960 bool geometryShader = false;
961 bool nonFillPolygonMode = false;
962 bool multiView = false;
963 bool renderPass2KHR = false;
965 bool perDrawShadingRate = false;
969 } caps;
970
983
986
989
994
996 OffscreenFrame(QRhiImplementation *rhi)
997 {
998 for (int i = 0; i < QVK_FRAMES_IN_FLIGHT; ++i)
999 cbWrapper[i] = new QVkCommandBuffer(rhi);
1000 }
1002 {
1003 for (int i = 0; i < QVK_FRAMES_IN_FLIGHT; ++i)
1004 delete cbWrapper[i];
1005 }
1006 bool active = false;
1010 } ofr;
1011
1031
1046 int lastActiveFrameSlot; // -1 if not used otherwise 0..FRAMES_IN_FLIGHT-1
1047 union {
1048 struct {
1051 } pipelineState;
1052 struct {
1055 } shaderResourceBindings;
1056 struct {
1061 } buffer;
1062 struct {
1066 } renderBuffer;
1067 struct {
1068 VkImage image;
1069 VkImageView imageView;
1071 VkBuffer stagingBuffers[QVK_FRAMES_IN_FLIGHT];
1072 QVkAlloc stagingAllocations[QVK_FRAMES_IN_FLIGHT];
1073 VkImageView extraImageViews[QRhi::MAX_MIP_LEVELS];
1074 } texture;
1075 struct {
1077 } sampler;
1078 struct {
1085 } textureRenderTarget;
1086 struct {
1088 } renderPass;
1089 struct {
1092 } stagingBuffer;
1093 struct {
1095 } secondaryCommandBuffer;
1096 };
1097 };
1099
1100#ifdef VK_KHR_fragment_shading_rate
1103#endif
1104
1109};
1110
1115
1116QT_END_NAMESPACE
1117
1118#endif
const char * constData() const
Definition qrhi_p.h:367
bool isEmpty() const
Definition qrhi.cpp:11785
void registerBuffer(QRhiBuffer *buf, int slot, BufferAccess *access, BufferStage *stage, const UsageState &state)
Definition qrhi.cpp:11802
void registerTexture(QRhiTexture *tex, TextureAccess *access, TextureStage *stage, const UsageState &state)
Definition qrhi.cpp:11842
static QRhiResourceUpdateBatchPrivate * get(QRhiResourceUpdateBatch *b)
Definition qrhi_p.h:592
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 isTextureFormatSupported(QRhiTexture::Format format, QRhiTexture::Flags flags) const override
VkDevice dev
QVersionNumber apiVersion
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 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
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:280
@ Bounded
Definition qrhi_p.h:281
#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(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
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_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:1835
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
Definition qrhi.h:1556
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
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
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
QHash< QRhiResource *, std::pair< VkAccessFlags, bool > > writtenResources
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.
QVarLengthArray< QRhiShaderResourceBinding, 8 > sortedBindings
QVarLengthArray< BoundResourceData, 8 > boundResourceData[QVK_FRAMES_IN_FLIGHT]
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
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
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
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