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
4#ifndef QRHIVULKAN_P_H
5#define QRHIVULKAN_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include "qrhi_p.h"
19
20#ifdef Q_OS_WIN
21#include "qdxgihdrinfo_p.h"
22#endif
23
25
26class QVulkanFunctions;
27class QVulkanDeviceFunctions;
28
29static const int QVK_FRAMES_IN_FLIGHT = 2;
30
31static const int QVK_DESC_SETS_PER_POOL = 128;
32static const int QVK_UNIFORM_BUFFERS_PER_POOL = 256;
34static const int QVK_STORAGE_BUFFERS_PER_POOL = 128;
35static const int QVK_STORAGE_IMAGES_PER_POOL = 128;
36
37static const int QVK_MAX_ACTIVE_TIMESTAMP_PAIRS = 16;
38
39// no vk_mem_alloc.h available here, void* is good enough
40typedef void * QVkAlloc;
41typedef void * QVkAllocator;
42
71
73
74struct QVkTexture;
75
77{
78 QVkRenderBuffer(QRhiImplementation *rhi, Type type, const QSize &pixelSize,
79 int sampleCount, Flags flags,
80 QRhiTexture::Format backingFormatHint);
82 void destroy() override;
83 bool create() override;
84 QRhiTexture::Format backingFormat() const override;
85
94 friend class QRhiVulkan;
95};
96
97struct QVkTexture : public QRhiTexture
98{
99 QVkTexture(QRhiImplementation *rhi, Format format, const QSize &pixelSize, int depth,
100 int arraySize, int sampleCount, Flags flags);
101 ~QVkTexture();
102 void destroy() override;
103 bool create() override;
104 bool createFrom(NativeTexture src) override;
105 NativeTexture nativeTexture() override;
106 void setNativeLayout(int layout) override;
107
108 bool prepareCreate(QSize *adjustedSize = nullptr);
109 bool finishCreate();
111
118 bool owns = true;
119 struct UsageState {
120 // no tracking of subresource layouts (some operations can keep
121 // subresources in different layouts for some time, but that does not
122 // need to be kept track of)
126 };
135 friend class QRhiVulkan;
136};
137
138struct QVkSampler : public QRhiSampler
139{
140 QVkSampler(QRhiImplementation *rhi, Filter magFilter, Filter minFilter, Filter mipmapMode,
141 AddressMode u, AddressMode v, AddressMode w);
142 ~QVkSampler();
143 void destroy() override;
144 bool create() override;
145
149 friend class QRhiVulkan;
150};
151
153{
154 QVkShadingRateMap(QRhiImplementation *rhi);
156 void destroy() override;
157 bool createFrom(QRhiTexture *src) override;
158
159 QVkTexture *texture = nullptr; // not owned
160 friend class QRhiVulkan;
161};
162
192
209
211{
212 QVkSwapChainRenderTarget(QRhiImplementation *rhi, QRhiSwapChain *swapchain);
214 void destroy() override;
215
216 QSize pixelSize() const override;
217 float devicePixelRatio() const override;
218 int sampleCount() const override;
219
221};
222
245
247{
248 QVkShaderResourceBindings(QRhiImplementation *rhi);
250 void destroy() override;
251 bool create() override;
252 void updateResources(UpdateFlags flags) override;
253
255 bool hasDynamicOffset = false;
256 int poolIndex = -1;
258 VkDescriptorSet descSets[QVK_FRAMES_IN_FLIGHT]; // multiple sets to support dynamic buffers
261
262 // Keep track of the generation number of each referenced QRhi* to be able
263 // to detect that the underlying descriptor set became out of date and they
264 // need to be written again with the up-to-date VkBuffer etc. objects.
270 int count;
271 struct {
276 } d[QRhiShaderResourceBinding::Data::MAX_TEX_SAMPLER_ARRAY_SIZE];
277 };
295
296 friend class QRhiVulkan;
297};
298
300
314
328
330{
331 QVkCommandBuffer(QRhiImplementation *rhi);
333 void destroy() override;
334
336
339
345
346 void resetState() {
348 passUsesSecondaryCb = false;
349 lastGpuTime = 0;
350 currentTarget = nullptr;
351 activeSecondaryCbStack.clear();
354 }
355
357 currentGraphicsPipeline = nullptr;
358 currentComputePipeline = nullptr;
359 currentPipelineGeneration = 0;
360 currentGraphicsSrb = nullptr;
361 currentComputeSrb = nullptr;
362 currentSrbGeneration = 0;
364 currentIndexBuffer = VK_NULL_HANDLE;
365 currentIndexOffset = 0;
366 currentIndexFormat = VK_INDEX_TYPE_UINT16;
367 memset(currentVertexBuffers, 0, sizeof(currentVertexBuffers));
368 memset(currentVertexOffsets, 0, sizeof(currentVertexOffsets));
369 inExternal = false;
370 hasShadingRateSet = false;
371 }
372
375 double lastGpuTime = 0;
387 static const int VERTEX_INPUT_RESOURCE_SLOT_COUNT = 32;
393
394 struct {
396 void reset() {
397 writtenResources.clear();
398 }
399 } computePassState;
400
401 struct Command {
432
433 union Args {
434 struct {
438 } copyBuffer;
439 struct {
440 VkBuffer src;
443 int count;
445 } copyBufferToImage;
446 struct {
449 VkImage dst;
450 VkImageLayout dstLayout;
452 } copyImage;
453 struct {
454 VkImage src;
455 VkImageLayout srcLayout;
456 VkBuffer dst;
458 } copyImageToBuffer;
459 struct {
462 int count;
463 int index;
464 } imageBarrier;
465 struct {
466 VkPipelineStageFlags srcStageMask;
467 VkPipelineStageFlags dstStageMask;
471 } memoryBarrier;
472 struct {
473 VkPipelineStageFlags srcStageMask;
474 VkPipelineStageFlags dstStageMask;
475 int count;
476 int index;
477 } bufferBarrier;
478 struct {
479 VkImage src;
480 VkImageLayout srcLayout;
481 VkImage dst;
482 VkImageLayout dstLayout;
485 } blitImage;
486 struct {
490 } beginRenderPass;
491 struct {
492 } endRenderPass;
493 struct {
496 } bindPipeline;
497 struct {
498 VkPipelineBindPoint bindPoint;
503 } bindDescriptorSet;
504 struct {
506 int count;
509 } bindVertexBuffer;
510 struct {
514 } bindIndexBuffer;
515 struct {
517 } setViewport;
518 struct {
520 } setScissor;
521 struct {
522 float c[4];
523 } setBlendConstants;
524 struct {
526 } setStencilRef;
527 struct {
532 } draw;
533 struct {
535 uint32_t instanceCount;
538 uint32_t firstInstance;
539 } drawIndexed;
540 struct {
541#ifdef VK_EXT_debug_utils
542 VkDebugUtilsLabelEXT label;
543 int labelNameIndex;
544#endif
545 } debugMarkerBegin;
546 struct {
547 } debugMarkerEnd;
548 struct {
549#ifdef VK_EXT_debug_utils
550 VkDebugUtilsLabelEXT label;
551 int labelNameIndex;
552#endif
553 } debugMarkerInsert;
554 struct {
556 } transitionResources;
557 struct {
558 int x, y, z;
559 } dispatch;
560 struct {
562 } executeSecondary;
563 struct {
566 } setShadingRate;
567 } args;
568 };
569
573
575 commands.reset();
577
578 passResTrackers.clear();
580 }
581
582 void resetPools() {
583 pools.clearValue.clear();
584 pools.bufferImageCopy.clear();
585 pools.dynamicOffset.clear();
586 pools.vertexBuffer.clear();
587 pools.vertexBufferOffset.clear();
588 pools.debugMarkerData.clear();
589 pools.imageBarrier.clear();
590 pools.bufferBarrier.clear();
591 }
592
593 struct {
602 } pools;
603
604 friend class QRhiVulkan;
605};
606
608{
609 QVkSwapChain(QRhiImplementation *rhi);
610 ~QVkSwapChain();
611 void destroy() override;
612
613 QRhiCommandBuffer *currentFrameCommandBuffer() override;
615 QRhiRenderTarget *currentFrameRenderTarget(StereoTargetBuffer targetBuffer) override;
616
617 QSize surfacePixelSize() override;
618 bool isFormatSupported(Format f) override;
620
623
624 bool ensureSurface();
625
627
628 QWindow *window = nullptr;
630 bool supportsReadback = false;
631 bool stereo = false;
633 int bufferCount = 0;
638 QVkRenderBuffer *ds = nullptr;
646
662
672
673 quint32 currentImageIndex = 0; // index in imageRes
674 quint32 currentFrameSlot = 0; // index in frameRes
675 int frameCount = 0;
676
677 friend class QRhiVulkan;
678};
679
681{
682public:
683 QRhiDriverInfo info() const override;
684
687};
688
690{
691public:
692 QRhiVulkan(QRhiVulkanInitParams *params, QRhiVulkanNativeHandles *importParams = nullptr);
693
694 bool create(QRhi::Flags flags) override;
695 void destroy() override;
696 QRhi::AdapterList enumerateAdaptersBeforeCreate(QRhiNativeHandles *nativeHandles) const override;
697
701 QRhiBuffer *createBuffer(QRhiBuffer::Type type,
702 QRhiBuffer::UsageFlags usage,
703 quint32 size) override;
704 QRhiRenderBuffer *createRenderBuffer(QRhiRenderBuffer::Type type,
705 const QSize &pixelSize,
706 int sampleCount,
707 QRhiRenderBuffer::Flags flags,
708 QRhiTexture::Format backingFormatHint) override;
709 QRhiTexture *createTexture(QRhiTexture::Format format,
710 const QSize &pixelSize,
711 int depth,
712 int arraySize,
713 int sampleCount,
714 QRhiTexture::Flags flags) override;
715 QRhiSampler *createSampler(QRhiSampler::Filter magFilter,
716 QRhiSampler::Filter minFilter,
717 QRhiSampler::Filter mipmapMode,
718 QRhiSampler:: AddressMode u,
719 QRhiSampler::AddressMode v,
720 QRhiSampler::AddressMode w) override;
721
722 QRhiTextureRenderTarget *createTextureRenderTarget(const QRhiTextureRenderTargetDescription &desc,
723 QRhiTextureRenderTarget::Flags flags) override;
724
725 QRhiShadingRateMap *createShadingRateMap() override;
726
727 QRhiSwapChain *createSwapChain() override;
728 QRhi::FrameOpResult beginFrame(QRhiSwapChain *swapChain, QRhi::BeginFrameFlags flags) override;
729 QRhi::FrameOpResult endFrame(QRhiSwapChain *swapChain, QRhi::EndFrameFlags flags) override;
730 QRhi::FrameOpResult beginOffscreenFrame(QRhiCommandBuffer **cb, QRhi::BeginFrameFlags flags) override;
731 QRhi::FrameOpResult endOffscreenFrame(QRhi::EndFrameFlags flags) override;
732 QRhi::FrameOpResult finish() override;
733
734 void resourceUpdate(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override;
735
736 void beginPass(QRhiCommandBuffer *cb,
737 QRhiRenderTarget *rt,
738 const QColor &colorClearValue,
739 const QRhiDepthStencilClearValue &depthStencilClearValue,
740 QRhiResourceUpdateBatch *resourceUpdates,
741 QRhiCommandBuffer::BeginPassFlags flags) override;
742 void endPass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override;
743
744 void setGraphicsPipeline(QRhiCommandBuffer *cb,
745 QRhiGraphicsPipeline *ps) override;
746
747 void setShaderResources(QRhiCommandBuffer *cb,
748 QRhiShaderResourceBindings *srb,
749 int dynamicOffsetCount,
750 const QRhiCommandBuffer::DynamicOffset *dynamicOffsets) override;
751
752 void setVertexInput(QRhiCommandBuffer *cb,
753 int startBinding, int bindingCount, const QRhiCommandBuffer::VertexInput *bindings,
754 QRhiBuffer *indexBuf, quint32 indexOffset,
755 QRhiCommandBuffer::IndexFormat indexFormat) override;
756
757 void setViewport(QRhiCommandBuffer *cb, const QRhiViewport &viewport) override;
758 void setScissor(QRhiCommandBuffer *cb, const QRhiScissor &scissor) override;
759 void setBlendConstants(QRhiCommandBuffer *cb, const QColor &c) override;
760 void setStencilRef(QRhiCommandBuffer *cb, quint32 refValue) override;
761 void setShadingRate(QRhiCommandBuffer *cb, const QSize &coarsePixelSize) override;
762
763 void draw(QRhiCommandBuffer *cb, quint32 vertexCount,
764 quint32 instanceCount, quint32 firstVertex, quint32 firstInstance) override;
765
766 void drawIndexed(QRhiCommandBuffer *cb, quint32 indexCount,
767 quint32 instanceCount, quint32 firstIndex,
768 qint32 vertexOffset, quint32 firstInstance) override;
769
770 void debugMarkBegin(QRhiCommandBuffer *cb, const QByteArray &name) override;
771 void debugMarkEnd(QRhiCommandBuffer *cb) override;
772 void debugMarkMsg(QRhiCommandBuffer *cb, const QByteArray &msg) override;
773
774 void beginComputePass(QRhiCommandBuffer *cb,
775 QRhiResourceUpdateBatch *resourceUpdates,
776 QRhiCommandBuffer::BeginPassFlags flags) override;
777 void endComputePass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override;
778 void setComputePipeline(QRhiCommandBuffer *cb, QRhiComputePipeline *ps) override;
779 void dispatch(QRhiCommandBuffer *cb, int x, int y, int z) override;
780
781 const QRhiNativeHandles *nativeHandles(QRhiCommandBuffer *cb) override;
782 void beginExternal(QRhiCommandBuffer *cb) override;
783 void endExternal(QRhiCommandBuffer *cb) override;
784 double lastCompletedGpuTime(QRhiCommandBuffer *cb) override;
785
786 QList<int> supportedSampleCounts() const override;
787 QList<QSize> supportedShadingRates(int sampleCount) const override;
788 int ubufAlignment() const override;
789 bool isYUpInFramebuffer() const override;
790 bool isYUpInNDC() const override;
791 bool isClipDepthZeroToOne() const override;
792 QMatrix4x4 clipSpaceCorrMatrix() const override;
793 bool isTextureFormatSupported(QRhiTexture::Format format, QRhiTexture::Flags flags) const override;
794 bool isFeatureSupported(QRhi::Feature feature) const override;
795 int resourceLimit(QRhi::ResourceLimit limit) const override;
796 const QRhiNativeHandles *nativeHandles() override;
797 QRhiDriverInfo driverInfo() const override;
798 QRhiStats statistics() override;
800 void setQueueSubmitParams(QRhiNativeHandles *params) override;
802 bool isDeviceLost() const override;
803
804 QByteArray pipelineCacheData() override;
805 void setPipelineCacheData(const QByteArray &data) override;
806
807 VkResult createDescriptorPool(VkDescriptorPool *pool);
808 bool allocateDescriptorSet(VkDescriptorSetAllocateInfo *allocInfo, VkDescriptorSet *result, int *resultPoolIndex);
809 uint32_t chooseTransientImageMemType(VkImage img, uint32_t startIndex);
810 bool createTransientImage(VkFormat format, const QSize &pixelSize, VkImageUsageFlags usage,
811 VkImageAspectFlags aspectMask, VkSampleCountFlagBits samples,
812 VkDeviceMemory *mem, VkImage *images, VkImageView *views, int count);
813
814 bool recreateSwapChain(QRhiSwapChain *swapChain);
815 void releaseSwapChainResources(QRhiSwapChain *swapChain);
816
820 bool hasDepthStencil,
821 VkSampleCountFlagBits samples,
822 VkFormat colorFormat,
823 QRhiShadingRateMap *shadingRateMap);
825 const QRhiColorAttachment *colorAttachmentsBegin,
826 const QRhiColorAttachment *colorAttachmentsEnd,
827 bool preserveColor,
828 bool preserveDs,
829 bool storeDs,
830 QRhiRenderBuffer *depthStencilBuffer,
831 QRhiTexture *depthTexture,
832 QRhiTexture *depthResolveTexture,
833 QRhiShadingRateMap *shadingRateMap);
834 bool ensurePipelineCache(const void *initialData = nullptr, size_t initialDataSize = 0);
835 VkShaderModule createShader(const QByteArray &spirv);
836
837 void prepareNewFrame(QRhiCommandBuffer *cb);
839 void endAndEnqueueSecondaryCommandBuffer(VkCommandBuffer cb, QVkCommandBuffer *cbD);
840 QRhi::FrameOpResult startPrimaryCommandBuffer(VkCommandBuffer *cb);
841 QRhi::FrameOpResult endAndSubmitPrimaryCommandBuffer(VkCommandBuffer cb, VkFence cmdFence,
842 VkSemaphore *waitSem, VkSemaphore *signalSem);
844 VkDeviceSize subresUploadByteSize(const QRhiTextureSubresourceUploadDescription &subresDesc) const;
846 void prepareUploadSubres(QVkTexture *texD, int layer, int level,
847 const QRhiTextureSubresourceUploadDescription &subresDesc,
848 size_t *curOfs, void *mp,
849 BufferImageCopyList *copyInfos);
850 void enqueueResourceUpdates(QVkCommandBuffer *cbD, QRhiResourceUpdateBatch *resourceUpdates);
851 void executeBufferHostWritesForSlot(QVkBuffer *bufD, int slot);
855 QVkBuffer *bufD,
856 int slot,
860 QVkTexture *texD,
865 void executeDeferredReleases(bool forced = false);
866 void finishActiveReadbacks(bool forced = false);
867
868 void setAllocationName(QVkAlloc allocation, const QByteArray &name, int slot = -1);
869 void setObjectName(uint64_t object, VkObjectType type, const QByteArray &name, int slot = -1);
870 void trackedBufferBarrier(QVkCommandBuffer *cbD, QVkBuffer *bufD, int slot,
871 VkAccessFlags access, VkPipelineStageFlags stage);
873 VkImageLayout layout, VkAccessFlags access, VkPipelineStageFlags stage);
875 void subresourceBarrier(QVkCommandBuffer *cbD, VkImage image,
876 VkImageLayout oldLayout, VkImageLayout newLayout,
877 VkAccessFlags srcAccess, VkAccessFlags dstAccess,
878 VkPipelineStageFlags srcStage, VkPipelineStageFlags dstStage,
879 int startLayer, int layerCount,
880 int startLevel, int levelCount);
881 void updateShaderResourceBindings(QRhiShaderResourceBindings *srb);
883 double elapsedSecondsFromTimestamp(quint64 timestamp[2], bool *ok);
884 void printExtraErrorInfo(VkResult err);
885 void printDeviceLossErrorInfo() const;
886
888 QWindow *maybeWindow = nullptr;
890 bool importedDevice = false;
898 bool importedAllocator = false;
900 QVulkanFunctions *f = nullptr;
901 QVulkanDeviceFunctions *df = nullptr;
904#ifdef VK_VERSION_1_1
906#endif
907#ifdef VK_VERSION_1_2
910#endif
911#ifdef VK_VERSION_1_3
913#endif
917 bool deviceLost = false;
919
920#ifdef Q_OS_WIN
921 bool adapterLuidValid = false;
923 QDxgiHdrInfo *dxgiHdrInfo = nullptr;
924#endif
925
926#ifdef VK_EXT_debug_utils
931#endif
932
941
942#ifdef VK_KHR_create_renderpass2
944#endif
945
946#ifdef VK_EXT_device_fault
948#endif
949
950 struct {
951 bool compute = false;
952 bool depthClamp = false;
953 bool wideLines = false;
954 bool debugUtils = false;
955 bool deviceFault = false;
957 bool texture3DSliceAs2D = false;
958 bool tessellation = false;
959 bool geometryShader = false;
960 bool nonFillPolygonMode = false;
961 bool multiView = false;
962 bool renderPass2KHR = false;
964 bool perDrawShadingRate = false;
968 } caps;
969
982
985
988
993
995 OffscreenFrame(QRhiImplementation *rhi)
996 {
997 for (int i = 0; i < QVK_FRAMES_IN_FLIGHT; ++i)
998 cbWrapper[i] = new QVkCommandBuffer(rhi);
999 }
1001 {
1002 for (int i = 0; i < QVK_FRAMES_IN_FLIGHT; ++i)
1003 delete cbWrapper[i];
1004 }
1005 bool active = false;
1009 } ofr;
1010
1030
1045 int lastActiveFrameSlot; // -1 if not used otherwise 0..FRAMES_IN_FLIGHT-1
1046 union {
1047 struct {
1050 } pipelineState;
1051 struct {
1054 } shaderResourceBindings;
1055 struct {
1060 } buffer;
1061 struct {
1065 } renderBuffer;
1066 struct {
1067 VkImage image;
1068 VkImageView imageView;
1070 VkBuffer stagingBuffers[QVK_FRAMES_IN_FLIGHT];
1071 QVkAlloc stagingAllocations[QVK_FRAMES_IN_FLIGHT];
1072 VkImageView extraImageViews[QRhi::MAX_MIP_LEVELS];
1073 } texture;
1074 struct {
1076 } sampler;
1077 struct {
1084 } textureRenderTarget;
1085 struct {
1087 } renderPass;
1088 struct {
1091 } stagingBuffer;
1092 struct {
1094 } secondaryCommandBuffer;
1095 };
1096 };
1098
1099#ifdef VK_KHR_fragment_shading_rate
1102#endif
1103
1108};
1109
1114
1115QT_END_NAMESPACE
1116
1117#endif
const char * constData() const
Definition qrhi_p.h:366
bool isEmpty() const
Definition qrhi.cpp:11777
void registerBuffer(QRhiBuffer *buf, int slot, BufferAccess *access, BufferStage *stage, const UsageState &state)
Definition qrhi.cpp:11794
void registerTexture(QRhiTexture *tex, TextureAccess *access, TextureStage *stage, const UsageState &state)
Definition qrhi.cpp:11834
static QRhiResourceUpdateBatchPrivate * get(QRhiResourceUpdateBatch *b)
Definition qrhi_p.h:591
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:279
@ Bounded
Definition qrhi_p.h:280
#define QRHI_RES_RHI(t)
Definition qrhi_p.h:30
#define QRHI_RES(t, x)
Definition qrhi_p.h:29
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:1834
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
Definition qrhi.h:1555
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