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;
641 QVkRenderBuffer *ds = nullptr;
649
665
675
676 quint32 currentImageIndex = 0; // index in imageRes
677 quint32 currentFrameSlot = 0; // index in frameRes
678 int frameCount = 0;
679
680 friend class QRhiVulkan;
681};
682
684{
685public:
686 QRhiDriverInfo info() const override;
687
690};
691
693{
694public:
695 QRhiVulkan(QRhiVulkanInitParams *params, QRhiVulkanNativeHandles *importParams = nullptr);
696
697 bool create(QRhi::Flags flags) override;
698 void destroy() override;
699 QRhi::AdapterList enumerateAdaptersBeforeCreate(QRhiNativeHandles *nativeHandles) const override;
700
704 QRhiBuffer *createBuffer(QRhiBuffer::Type type,
705 QRhiBuffer::UsageFlags usage,
706 quint32 size) override;
707 QRhiRenderBuffer *createRenderBuffer(QRhiRenderBuffer::Type type,
708 const QSize &pixelSize,
709 int sampleCount,
710 QRhiRenderBuffer::Flags flags,
711 QRhiTexture::Format backingFormatHint) override;
712 QRhiTexture *createTexture(QRhiTexture::Format format,
713 const QSize &pixelSize,
714 int depth,
715 int arraySize,
716 int sampleCount,
717 QRhiTexture::Flags flags) override;
718 QRhiSampler *createSampler(QRhiSampler::Filter magFilter,
719 QRhiSampler::Filter minFilter,
720 QRhiSampler::Filter mipmapMode,
721 QRhiSampler:: AddressMode u,
722 QRhiSampler::AddressMode v,
723 QRhiSampler::AddressMode w) override;
724
725 QRhiTextureRenderTarget *createTextureRenderTarget(const QRhiTextureRenderTargetDescription &desc,
726 QRhiTextureRenderTarget::Flags flags) override;
727
728 QRhiShadingRateMap *createShadingRateMap() override;
729
730 QRhiSwapChain *createSwapChain() override;
731 QRhi::FrameOpResult beginFrame(QRhiSwapChain *swapChain, QRhi::BeginFrameFlags flags) override;
732 QRhi::FrameOpResult endFrame(QRhiSwapChain *swapChain, QRhi::EndFrameFlags flags) override;
733 QRhi::FrameOpResult beginOffscreenFrame(QRhiCommandBuffer **cb, QRhi::BeginFrameFlags flags) override;
734 QRhi::FrameOpResult endOffscreenFrame(QRhi::EndFrameFlags flags) override;
735 QRhi::FrameOpResult finish() override;
736
737 void resourceUpdate(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override;
738
739 void beginPass(QRhiCommandBuffer *cb,
740 QRhiRenderTarget *rt,
741 const QColor &colorClearValue,
742 const QRhiDepthStencilClearValue &depthStencilClearValue,
743 QRhiResourceUpdateBatch *resourceUpdates,
744 QRhiCommandBuffer::BeginPassFlags flags) override;
745 void endPass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override;
746
747 void setGraphicsPipeline(QRhiCommandBuffer *cb,
748 QRhiGraphicsPipeline *ps) override;
749
750 void setShaderResources(QRhiCommandBuffer *cb,
751 QRhiShaderResourceBindings *srb,
752 int dynamicOffsetCount,
753 const QRhiCommandBuffer::DynamicOffset *dynamicOffsets) override;
754
755 void setVertexInput(QRhiCommandBuffer *cb,
756 int startBinding, int bindingCount, const QRhiCommandBuffer::VertexInput *bindings,
757 QRhiBuffer *indexBuf, quint32 indexOffset,
758 QRhiCommandBuffer::IndexFormat indexFormat) override;
759
760 void setViewport(QRhiCommandBuffer *cb, const QRhiViewport &viewport) override;
761 void setScissor(QRhiCommandBuffer *cb, const QRhiScissor &scissor) override;
762 void setBlendConstants(QRhiCommandBuffer *cb, const QColor &c) override;
763 void setStencilRef(QRhiCommandBuffer *cb, quint32 refValue) override;
764 void setShadingRate(QRhiCommandBuffer *cb, const QSize &coarsePixelSize) override;
765
766 void draw(QRhiCommandBuffer *cb, quint32 vertexCount,
767 quint32 instanceCount, quint32 firstVertex, quint32 firstInstance) override;
768
769 void drawIndexed(QRhiCommandBuffer *cb, quint32 indexCount,
770 quint32 instanceCount, quint32 firstIndex,
771 qint32 vertexOffset, quint32 firstInstance) override;
772
773 void debugMarkBegin(QRhiCommandBuffer *cb, const QByteArray &name) override;
774 void debugMarkEnd(QRhiCommandBuffer *cb) override;
775 void debugMarkMsg(QRhiCommandBuffer *cb, const QByteArray &msg) override;
776
777 void beginComputePass(QRhiCommandBuffer *cb,
778 QRhiResourceUpdateBatch *resourceUpdates,
779 QRhiCommandBuffer::BeginPassFlags flags) override;
780 void endComputePass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override;
781 void setComputePipeline(QRhiCommandBuffer *cb, QRhiComputePipeline *ps) override;
782 void dispatch(QRhiCommandBuffer *cb, int x, int y, int z) override;
783
784 const QRhiNativeHandles *nativeHandles(QRhiCommandBuffer *cb) override;
785 void beginExternal(QRhiCommandBuffer *cb) override;
786 void endExternal(QRhiCommandBuffer *cb) override;
787 double lastCompletedGpuTime(QRhiCommandBuffer *cb) override;
788
789 QList<int> supportedSampleCounts() const override;
790 QList<QSize> supportedShadingRates(int sampleCount) const override;
791 int ubufAlignment() const override;
792 bool isYUpInFramebuffer() const override;
793 bool isYUpInNDC() const override;
794 bool isClipDepthZeroToOne() const override;
795 QMatrix4x4 clipSpaceCorrMatrix() const override;
796 bool isTextureFormatSupported(QRhiTexture::Format format, QRhiTexture::Flags flags) const override;
797 bool isFeatureSupported(QRhi::Feature feature) const override;
798 int resourceLimit(QRhi::ResourceLimit limit) const override;
799 const QRhiNativeHandles *nativeHandles() override;
800 QRhiDriverInfo driverInfo() const override;
801 QRhiStats statistics() override;
803 void setQueueSubmitParams(QRhiNativeHandles *params) override;
805 bool isDeviceLost() const override;
806
807 QByteArray pipelineCacheData() override;
808 void setPipelineCacheData(const QByteArray &data) override;
809
810 VkResult createDescriptorPool(VkDescriptorPool *pool);
811 bool allocateDescriptorSet(VkDescriptorSetAllocateInfo *allocInfo, VkDescriptorSet *result, int *resultPoolIndex);
812 uint32_t chooseTransientImageMemType(VkImage img, uint32_t startIndex);
813 bool createTransientImage(VkFormat format, const QSize &pixelSize, VkImageUsageFlags usage,
814 VkImageAspectFlags aspectMask, VkSampleCountFlagBits samples,
815 VkDeviceMemory *mem, VkImage *images, VkImageView *views, int count);
816
817 bool recreateSwapChain(QRhiSwapChain *swapChain);
818 void releaseSwapChainResources(QRhiSwapChain *swapChain);
819
823 bool hasDepthStencil,
824 VkSampleCountFlagBits samples,
825 VkFormat colorFormat,
826 QRhiShadingRateMap *shadingRateMap);
828 const QRhiColorAttachment *colorAttachmentsBegin,
829 const QRhiColorAttachment *colorAttachmentsEnd,
830 bool preserveColor,
831 bool preserveDs,
832 bool storeDs,
833 QRhiRenderBuffer *depthStencilBuffer,
834 QRhiTexture *depthTexture,
835 QRhiTexture *depthResolveTexture,
836 QRhiShadingRateMap *shadingRateMap);
837 bool ensurePipelineCache(const void *initialData = nullptr, size_t initialDataSize = 0);
838 VkShaderModule createShader(const QByteArray &spirv);
839
840 void prepareNewFrame(QRhiCommandBuffer *cb);
842 void endAndEnqueueSecondaryCommandBuffer(VkCommandBuffer cb, QVkCommandBuffer *cbD);
843 QRhi::FrameOpResult startPrimaryCommandBuffer(VkCommandBuffer *cb);
844 QRhi::FrameOpResult endAndSubmitPrimaryCommandBuffer(VkCommandBuffer cb, VkFence cmdFence,
845 VkSemaphore *waitSem, VkSemaphore *signalSem);
847 VkDeviceSize subresUploadByteSize(const QRhiTextureSubresourceUploadDescription &subresDesc) const;
849 void prepareUploadSubres(QVkTexture *texD, int layer, int level,
850 const QRhiTextureSubresourceUploadDescription &subresDesc,
851 size_t *curOfs, void *mp,
852 BufferImageCopyList *copyInfos);
853 void enqueueResourceUpdates(QVkCommandBuffer *cbD, QRhiResourceUpdateBatch *resourceUpdates);
854 void executeBufferHostWritesForSlot(QVkBuffer *bufD, int slot);
858 QVkBuffer *bufD,
859 int slot,
863 QVkTexture *texD,
868 void executeDeferredReleases(bool forced = false);
869 void finishActiveReadbacks(bool forced = false);
870
871 void setAllocationName(QVkAlloc allocation, const QByteArray &name, int slot = -1);
872 void setObjectName(uint64_t object, VkObjectType type, const QByteArray &name, int slot = -1);
873 void trackedBufferBarrier(QVkCommandBuffer *cbD, QVkBuffer *bufD, int slot,
874 VkAccessFlags access, VkPipelineStageFlags stage);
876 VkImageLayout layout, VkAccessFlags access, VkPipelineStageFlags stage);
878 void subresourceBarrier(QVkCommandBuffer *cbD, VkImage image,
879 VkImageLayout oldLayout, VkImageLayout newLayout,
880 VkAccessFlags srcAccess, VkAccessFlags dstAccess,
881 VkPipelineStageFlags srcStage, VkPipelineStageFlags dstStage,
882 int startLayer, int layerCount,
883 int startLevel, int levelCount);
884 void updateShaderResourceBindings(QRhiShaderResourceBindings *srb);
886 double elapsedSecondsFromTimestamp(quint64 timestamp[2], bool *ok);
887 void printExtraErrorInfo(VkResult err);
888 void printDeviceLossErrorInfo() const;
889
891 QWindow *maybeWindow = nullptr;
893 bool importedDevice = false;
901 bool importedAllocator = false;
903 QVulkanFunctions *f = nullptr;
904 QVulkanDeviceFunctions *df = nullptr;
907#ifdef VK_VERSION_1_1
909#endif
910#ifdef VK_VERSION_1_2
913#endif
914#ifdef VK_VERSION_1_3
916#endif
920 bool deviceLost = false;
922
923#ifdef Q_OS_WIN
924 bool adapterLuidValid = false;
926 QDxgiHdrInfo *dxgiHdrInfo = nullptr;
927#endif
928
929#ifdef VK_EXT_debug_utils
934#endif
935
944
945#ifdef VK_KHR_create_renderpass2
947#endif
948
949#ifdef VK_EXT_device_fault
951#endif
952
953 struct {
954 bool compute = false;
955 bool depthClamp = false;
956 bool wideLines = false;
957 bool debugUtils = false;
958 bool deviceFault = false;
960 bool texture3DSliceAs2D = false;
961 bool tessellation = false;
962 bool geometryShader = false;
963 bool nonFillPolygonMode = false;
964 bool multiView = false;
965 bool renderPass2KHR = false;
967 bool perDrawShadingRate = false;
971 } caps;
972
985
988
991
996
998 OffscreenFrame(QRhiImplementation *rhi)
999 {
1000 for (int i = 0; i < QVK_FRAMES_IN_FLIGHT; ++i)
1001 cbWrapper[i] = new QVkCommandBuffer(rhi);
1002 }
1004 {
1005 for (int i = 0; i < QVK_FRAMES_IN_FLIGHT; ++i)
1006 delete cbWrapper[i];
1007 }
1008 bool active = false;
1012 } ofr;
1013
1033
1048 int lastActiveFrameSlot; // -1 if not used otherwise 0..FRAMES_IN_FLIGHT-1
1049 union {
1050 struct {
1053 } pipelineState;
1054 struct {
1057 } shaderResourceBindings;
1058 struct {
1063 } buffer;
1064 struct {
1068 } renderBuffer;
1069 struct {
1070 VkImage image;
1071 VkImageView imageView;
1073 VkBuffer stagingBuffers[QVK_FRAMES_IN_FLIGHT];
1074 QVkAlloc stagingAllocations[QVK_FRAMES_IN_FLIGHT];
1075 VkImageView extraImageViews[QRhi::MAX_MIP_LEVELS];
1076 } texture;
1077 struct {
1079 } sampler;
1080 struct {
1087 } textureRenderTarget;
1088 struct {
1090 } renderPass;
1091 struct {
1094 } stagingBuffer;
1095 struct {
1097 } secondaryCommandBuffer;
1098 };
1099 };
1101
1102#ifdef VK_KHR_fragment_shading_rate
1105#endif
1106
1111};
1112
1117
1118QT_END_NAMESPACE
1119
1120#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
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