Qt 6.x
The Qt SDK
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
21
24
25static const int QVK_FRAMES_IN_FLIGHT = 2;
26
27static const int QVK_DESC_SETS_PER_POOL = 128;
28static const int QVK_UNIFORM_BUFFERS_PER_POOL = 256;
30static const int QVK_STORAGE_BUFFERS_PER_POOL = 128;
31static const int QVK_STORAGE_IMAGES_PER_POOL = 128;
32
33static const int QVK_MAX_ACTIVE_TIMESTAMP_PAIRS = 16;
34
35// no vk_mem_alloc.h available here, void* is good enough
36typedef void * QVkAlloc;
37typedef void * QVkAllocator;
38
39struct QVkBuffer : public QRhiBuffer
40{
42 ~QVkBuffer();
43 void destroy() override;
44 bool create() override;
48
54 };
58 struct UsageState {
59 VkAccessFlags access = 0;
60 VkPipelineStageFlags stage = 0;
61 };
65 friend class QRhiVulkan;
66};
67
69
70struct QVkTexture;
71
73{
76 QRhiTexture::Format backingFormatHint);
78 void destroy() override;
79 bool create() override;
80 QRhiTexture::Format backingFormat() const override;
81
82 VkDeviceMemory memory = VK_NULL_HANDLE;
83 VkImage image = VK_NULL_HANDLE;
84 VkImageView imageView = VK_NULL_HANDLE;
85 VkSampleCountFlagBits samples;
87 VkFormat vkformat;
90 friend class QRhiVulkan;
91};
92
93struct QVkTexture : public QRhiTexture
94{
98 void destroy() override;
99 bool create() override;
100 bool createFrom(NativeTexture src) override;
101 NativeTexture nativeTexture() override;
102 void setNativeLayout(int layout) override;
103
104 bool prepareCreate(QSize *adjustedSize = nullptr);
105 bool finishCreate();
106 VkImageView imageViewForLevel(int level);
107
108 VkImage image = VK_NULL_HANDLE;
109 VkImageView imageView = VK_NULL_HANDLE;
114 bool owns = true;
115 struct UsageState {
116 // no tracking of subresource layouts (some operations can keep
117 // subresources in different layouts for some time, but that does not
118 // need to be kept track of)
119 VkImageLayout layout;
120 VkAccessFlags access;
121 VkPipelineStageFlags stage;
122 };
124 VkFormat vkformat;
126 VkSampleCountFlagBits samples;
129 friend class QRhiVulkan;
130};
131
132struct QVkSampler : public QRhiSampler
133{
136 ~QVkSampler();
137 void destroy() override;
138 bool create() override;
139
140 VkSampler sampler = VK_NULL_HANDLE;
143 friend class QRhiVulkan;
144};
145
147{
150 void destroy() override;
151 bool isCompatible(const QRhiRenderPassDescriptor *other) const override;
153 QVector<quint32> serializedFormat() const override;
154 const QRhiNativeHandles *nativeHandles() override;
155
157
158 VkRenderPass rp = VK_NULL_HANDLE;
159 bool ownsRp = false;
164 bool hasDepthStencil = false;
165 uint32_t multiViewCount = 0;
166 VkAttachmentReference dsRef;
170};
171
173{
174 VkFramebuffer fb = VK_NULL_HANDLE;
177 float dpr = 1;
178 int sampleCount = 1;
180 int dsAttCount = 0;
184 static const int MAX_COLOR_ATTACHMENTS = 8;
185};
186
188{
191 void destroy() override;
192
193 QSize pixelSize() const override;
194 float devicePixelRatio() const override;
195 int sampleCount() const override;
196
198};
199
201{
204 void destroy() override;
205
206 QSize pixelSize() const override;
207 float devicePixelRatio() const override;
208 int sampleCount() const override;
209
211 bool create() override;
212
217 friend class QRhiVulkan;
218};
219
221{
224 void destroy() override;
225 bool create() override;
226 void updateResources(UpdateFlags flags) override;
227
229 bool hasSlottedResource = false;
230 bool hasDynamicOffset = false;
231 int poolIndex = -1;
232 VkDescriptorSetLayout layout = VK_NULL_HANDLE;
233 VkDescriptorSet descSets[QVK_FRAMES_IN_FLIGHT]; // multiple sets to support dynamic buffers
236
237 // Keep track of the generation number of each referenced QRhi* to be able
238 // to detect that the underlying descriptor set became out of date and they
239 // need to be written again with the up-to-date VkBuffer etc. objects.
243 };
245 int count;
246 struct {
252 };
256 };
260 };
262 union {
267 };
268 };
270
271 friend class QRhiVulkan;
272};
273
275
277{
280 void destroy() override;
281 bool create() override;
282
283 VkPipelineLayout layout = VK_NULL_HANDLE;
284 VkPipeline pipeline = VK_NULL_HANDLE;
287 friend class QRhiVulkan;
288};
289
291{
294 void destroy() override;
295 bool create() override;
296
297 VkPipelineLayout layout = VK_NULL_HANDLE;
298 VkPipeline pipeline = VK_NULL_HANDLE;
301 friend class QRhiVulkan;
302};
303
305{
308 void destroy() override;
309
311
312 VkCommandBuffer cb = VK_NULL_HANDLE; // primary
314
315 enum PassType {
319 };
320
321 void resetState() {
323 passUsesSecondaryCb = false;
324 lastGpuTime = 0;
325 currentTarget = nullptr;
329 }
330
332 currentGraphicsPipeline = nullptr;
333 currentComputePipeline = nullptr;
335 currentGraphicsSrb = nullptr;
336 currentComputeSrb = nullptr;
339 currentIndexBuffer = VK_NULL_HANDLE;
341 currentIndexFormat = VK_INDEX_TYPE_UINT16;
342 memset(currentVertexBuffers, 0, sizeof(currentVertexBuffers));
343 memset(currentVertexOffsets, 0, sizeof(currentVertexOffsets));
344 inExternal = false;
345 }
346
349 double lastGpuTime = 0;
361 static const int VERTEX_INPUT_RESOURCE_SLOT_COUNT = 32;
366
367 struct {
369 void reset() {
371 }
373
374 struct Command {
375 enum Cmd {
401 };
403
404 union Args {
405 struct {
406 VkBuffer src;
407 VkBuffer dst;
408 VkBufferCopy desc;
410 struct {
411 VkBuffer src;
412 VkImage dst;
413 VkImageLayout dstLayout;
414 int count;
417 struct {
418 VkImage src;
419 VkImageLayout srcLayout;
420 VkImage dst;
421 VkImageLayout dstLayout;
422 VkImageCopy desc;
424 struct {
425 VkImage src;
426 VkImageLayout srcLayout;
427 VkBuffer dst;
428 VkBufferImageCopy desc;
430 struct {
431 VkPipelineStageFlags srcStageMask;
432 VkPipelineStageFlags dstStageMask;
433 int count;
434 int index;
436 struct {
437 VkPipelineStageFlags srcStageMask;
438 VkPipelineStageFlags dstStageMask;
439 int count;
440 int index;
442 struct {
443 VkImage src;
444 VkImageLayout srcLayout;
445 VkImage dst;
446 VkImageLayout dstLayout;
447 VkFilter filter;
448 VkImageBlit desc;
450 struct {
451 VkRenderPassBeginInfo desc;
455 struct {
457 struct {
458 VkPipelineBindPoint bindPoint;
459 VkPipeline pipeline;
461 struct {
462 VkPipelineBindPoint bindPoint;
463 VkPipelineLayout pipelineLayout;
464 VkDescriptorSet descSet;
468 struct {
470 int count;
474 struct {
475 VkBuffer buf;
476 VkDeviceSize ofs;
477 VkIndexType type;
479 struct {
480 VkViewport viewport;
482 struct {
483 VkRect2D scissor;
485 struct {
486 float c[4];
488 struct {
489 uint32_t ref;
491 struct {
492 uint32_t vertexCount;
494 uint32_t firstVertex;
497 struct {
498 uint32_t indexCount;
499 uint32_t instanceCount;
500 uint32_t firstIndex;
502 uint32_t firstInstance;
504 struct {
505#ifdef VK_EXT_debug_utils
506 VkDebugUtilsLabelEXT label;
507 int labelNameIndex;
508#endif
510 struct {
512 struct {
513#ifdef VK_EXT_debug_utils
514 VkDebugUtilsLabelEXT label;
515 int labelNameIndex;
516#endif
518 struct {
521 struct {
522 int x, y, z;
524 struct {
525 VkCommandBuffer cb;
528 };
529
533
535 commands.reset();
536 resetPools();
537
540 }
541
542 void resetPools() {
543 pools.clearValue.clear();
544 pools.bufferImageCopy.clear();
545 pools.dynamicOffset.clear();
546 pools.vertexBuffer.clear();
547 pools.vertexBufferOffset.clear();
548 pools.debugMarkerData.clear();
549 pools.imageBarrier.clear();
550 pools.bufferBarrier.clear();
551 }
552
553 struct {
563
564 friend class QRhiVulkan;
565};
566
568{
571 void destroy() override;
572
575
576 QSize surfacePixelSize() override;
577 bool isFormatSupported(Format f) override;
578
580 bool createOrResize() override;
581
582 bool ensureSurface();
583
585
586 QWindow *window = nullptr;
588 bool supportsReadback = false;
589 VkSwapchainKHR sc = VK_NULL_HANDLE;
590 int bufferCount = 0;
591 VkSurfaceKHR surface = VK_NULL_HANDLE;
592 VkSurfaceKHR lastConnectedSurface = VK_NULL_HANDLE;
593 VkFormat colorFormat = VK_FORMAT_B8G8R8A8_UNORM;
594 VkColorSpaceKHR colorSpace = VK_COLOR_SPACE_SRGB_NONLINEAR_KHR;
595 QVkRenderBuffer *ds = nullptr;
596 VkSampleCountFlagBits samples = VK_SAMPLE_COUNT_1_BIT;
598 VkDeviceMemory msaaImageMem = VK_NULL_HANDLE;
601
603 VkImage image = VK_NULL_HANDLE;
604 VkImageView imageView = VK_NULL_HANDLE;
605 VkFramebuffer fb = VK_NULL_HANDLE;
606 VkImage msaaImage = VK_NULL_HANDLE;
607 VkImageView msaaImageView = VK_NULL_HANDLE;
608 enum LastUse {
612 };
614 };
616
618 VkFence imageFence = VK_NULL_HANDLE;
619 bool imageFenceWaitable = false;
620 VkSemaphore imageSem = VK_NULL_HANDLE;
621 VkSemaphore drawSem = VK_NULL_HANDLE;
622 bool imageAcquired = false;
623 bool imageSemWaitable = false;
624 VkFence cmdFence = VK_NULL_HANDLE;
625 bool cmdFenceWaitable = false;
626 VkCommandBuffer cmdBuf = VK_NULL_HANDLE; // primary
629
630 quint32 currentImageIndex = 0; // index in imageRes
631 quint32 currentFrameSlot = 0; // index in frameRes
632 int frameCount = 0;
633
634 friend class QRhiVulkan;
635};
636
638{
639public:
641
642 bool create(QRhi::Flags flags) override;
643 void destroy() override;
644
649 QRhiBuffer::UsageFlags usage,
650 quint32 size) override;
652 const QSize &pixelSize,
653 int sampleCount,
654 QRhiRenderBuffer::Flags flags,
655 QRhiTexture::Format backingFormatHint) override;
657 const QSize &pixelSize,
658 int depth,
659 int arraySize,
660 int sampleCount,
661 QRhiTexture::Flags flags) override;
663 QRhiSampler::Filter minFilter,
664 QRhiSampler::Filter mipmapMode,
667 QRhiSampler::AddressMode w) override;
668
670 QRhiTextureRenderTarget::Flags flags) override;
671
672 QRhiSwapChain *createSwapChain() override;
673 QRhi::FrameOpResult beginFrame(QRhiSwapChain *swapChain, QRhi::BeginFrameFlags flags) override;
674 QRhi::FrameOpResult endFrame(QRhiSwapChain *swapChain, QRhi::EndFrameFlags flags) override;
675 QRhi::FrameOpResult beginOffscreenFrame(QRhiCommandBuffer **cb, QRhi::BeginFrameFlags flags) override;
676 QRhi::FrameOpResult endOffscreenFrame(QRhi::EndFrameFlags flags) override;
677 QRhi::FrameOpResult finish() override;
678
679 void resourceUpdate(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override;
680
683 const QColor &colorClearValue,
684 const QRhiDepthStencilClearValue &depthStencilClearValue,
685 QRhiResourceUpdateBatch *resourceUpdates,
686 QRhiCommandBuffer::BeginPassFlags flags) override;
687 void endPass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override;
688
690 QRhiGraphicsPipeline *ps) override;
691
694 int dynamicOffsetCount,
695 const QRhiCommandBuffer::DynamicOffset *dynamicOffsets) override;
696
698 int startBinding, int bindingCount, const QRhiCommandBuffer::VertexInput *bindings,
699 QRhiBuffer *indexBuf, quint32 indexOffset,
700 QRhiCommandBuffer::IndexFormat indexFormat) override;
701
702 void setViewport(QRhiCommandBuffer *cb, const QRhiViewport &viewport) override;
703 void setScissor(QRhiCommandBuffer *cb, const QRhiScissor &scissor) override;
704 void setBlendConstants(QRhiCommandBuffer *cb, const QColor &c) override;
705 void setStencilRef(QRhiCommandBuffer *cb, quint32 refValue) override;
706
707 void draw(QRhiCommandBuffer *cb, quint32 vertexCount,
708 quint32 instanceCount, quint32 firstVertex, quint32 firstInstance) override;
709
710 void drawIndexed(QRhiCommandBuffer *cb, quint32 indexCount,
711 quint32 instanceCount, quint32 firstIndex,
712 qint32 vertexOffset, quint32 firstInstance) override;
713
714 void debugMarkBegin(QRhiCommandBuffer *cb, const QByteArray &name) override;
715 void debugMarkEnd(QRhiCommandBuffer *cb) override;
716 void debugMarkMsg(QRhiCommandBuffer *cb, const QByteArray &msg) override;
717
719 QRhiResourceUpdateBatch *resourceUpdates,
720 QRhiCommandBuffer::BeginPassFlags flags) override;
721 void endComputePass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override;
723 void dispatch(QRhiCommandBuffer *cb, int x, int y, int z) override;
724
726 void beginExternal(QRhiCommandBuffer *cb) override;
727 void endExternal(QRhiCommandBuffer *cb) override;
728 double lastCompletedGpuTime(QRhiCommandBuffer *cb) override;
729
730 QList<int> supportedSampleCounts() const override;
731 int ubufAlignment() const override;
732 bool isYUpInFramebuffer() const override;
733 bool isYUpInNDC() const override;
734 bool isClipDepthZeroToOne() const override;
735 QMatrix4x4 clipSpaceCorrMatrix() const override;
736 bool isTextureFormatSupported(QRhiTexture::Format format, QRhiTexture::Flags flags) const override;
737 bool isFeatureSupported(QRhi::Feature feature) const override;
738 int resourceLimit(QRhi::ResourceLimit limit) const override;
739 const QRhiNativeHandles *nativeHandles() override;
740 QRhiDriverInfo driverInfo() const override;
741 QRhiStats statistics() override;
743 void releaseCachedResources() override;
744 bool isDeviceLost() const override;
745
746 QByteArray pipelineCacheData() override;
747 void setPipelineCacheData(const QByteArray &data) override;
748
749 VkResult createDescriptorPool(VkDescriptorPool *pool);
750 bool allocateDescriptorSet(VkDescriptorSetAllocateInfo *allocInfo, VkDescriptorSet *result, int *resultPoolIndex);
751 uint32_t chooseTransientImageMemType(VkImage img, uint32_t startIndex);
752 bool createTransientImage(VkFormat format, const QSize &pixelSize, VkImageUsageFlags usage,
753 VkImageAspectFlags aspectMask, VkSampleCountFlagBits samples,
754 VkDeviceMemory *mem, VkImage *images, VkImageView *views, int count);
755
756 bool recreateSwapChain(QRhiSwapChain *swapChain);
758
759 VkFormat optimalDepthStencilFormat();
760 VkSampleCountFlagBits effectiveSampleCount(int sampleCount);
762 bool hasDepthStencil,
763 VkSampleCountFlagBits samples,
764 VkFormat colorFormat);
766 const QRhiColorAttachment *firstColorAttachment,
767 const QRhiColorAttachment *lastColorAttachment,
768 bool preserveColor,
769 bool preserveDs,
770 QRhiRenderBuffer *depthStencilBuffer,
771 QRhiTexture *depthTexture);
772 bool ensurePipelineCache(const void *initialData = nullptr, size_t initialDataSize = 0);
773 VkShaderModule createShader(const QByteArray &spirv);
774
776 VkCommandBuffer startSecondaryCommandBuffer(QVkRenderTargetData *rtD = nullptr);
777 void endAndEnqueueSecondaryCommandBuffer(VkCommandBuffer cb, QVkCommandBuffer *cbD);
779 QRhi::FrameOpResult endAndSubmitPrimaryCommandBuffer(VkCommandBuffer cb, VkFence cmdFence,
780 VkSemaphore *waitSem, VkSemaphore *signalSem);
781 void waitCommandCompletion(int frameSlot);
782 VkDeviceSize subresUploadByteSize(const QRhiTextureSubresourceUploadDescription &subresDesc) const;
784 void prepareUploadSubres(QVkTexture *texD, int layer, int level,
786 size_t *curOfs, void *mp,
787 BufferImageCopyList *copyInfos);
789 void executeBufferHostWritesForSlot(QVkBuffer *bufD, int slot);
793 QVkBuffer *bufD,
794 int slot,
798 QVkTexture *texD,
803 void executeDeferredReleases(bool forced = false);
804 void finishActiveReadbacks(bool forced = false);
805
806 void setObjectName(uint64_t object, VkObjectType type, const QByteArray &name, int slot = -1);
807 void trackedBufferBarrier(QVkCommandBuffer *cbD, QVkBuffer *bufD, int slot,
808 VkAccessFlags access, VkPipelineStageFlags stage);
810 VkImageLayout layout, VkAccessFlags access, VkPipelineStageFlags stage);
812 void subresourceBarrier(QVkCommandBuffer *cbD, VkImage image,
813 VkImageLayout oldLayout, VkImageLayout newLayout,
814 VkAccessFlags srcAccess, VkAccessFlags dstAccess,
815 VkPipelineStageFlags srcStage, VkPipelineStageFlags dstStage,
816 int startLayer, int layerCount,
817 int startLevel, int levelCount);
818 void updateShaderResourceBindings(QRhiShaderResourceBindings *srb, int descSetIdx = -1);
820 double elapsedSecondsFromTimestamp(quint64 timestamp[2], bool *ok);
821
825 bool importedDevice = false;
826 VkPhysicalDevice physDev = VK_NULL_HANDLE;
827 VkDevice dev = VK_NULL_HANDLE;
828 VkCommandPool cmdPool[QVK_FRAMES_IN_FLIGHT] = {};
831 VkQueue gfxQueue = VK_NULL_HANDLE;
833 bool importedAllocator = false;
835 QVulkanFunctions *f = nullptr;
837 QRhi::Flags rhiFlags;
838 VkPhysicalDeviceFeatures physDevFeatures;
839#ifdef VK_VERSION_1_2
840 VkPhysicalDeviceVulkan11Features physDevFeatures11;
841 VkPhysicalDeviceVulkan12Features physDevFeatures12;
842#endif
843#ifdef VK_VERSION_1_3
844 VkPhysicalDeviceVulkan13Features physDevFeatures13;
845#endif
846 VkPhysicalDeviceProperties physDevProperties;
847 VkDeviceSize ubufAlign;
848 VkDeviceSize texbufAlign;
849 bool deviceLost = false;
851
852#ifdef VK_EXT_debug_utils
853 PFN_vkSetDebugUtilsObjectNameEXT vkSetDebugUtilsObjectNameEXT = nullptr;
854 PFN_vkCmdBeginDebugUtilsLabelEXT vkCmdBeginDebugUtilsLabelEXT = nullptr;
855 PFN_vkCmdEndDebugUtilsLabelEXT vkCmdEndDebugUtilsLabelEXT = nullptr;
856 PFN_vkCmdInsertDebugUtilsLabelEXT vkCmdInsertDebugUtilsLabelEXT = nullptr;
857#endif
858
859 PFN_vkCreateSwapchainKHR vkCreateSwapchainKHR = nullptr;
860 PFN_vkDestroySwapchainKHR vkDestroySwapchainKHR;
861 PFN_vkGetSwapchainImagesKHR vkGetSwapchainImagesKHR;
862 PFN_vkAcquireNextImageKHR vkAcquireNextImageKHR;
863 PFN_vkQueuePresentKHR vkQueuePresentKHR;
864 PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR vkGetPhysicalDeviceSurfaceCapabilitiesKHR;
865 PFN_vkGetPhysicalDeviceSurfaceFormatsKHR vkGetPhysicalDeviceSurfaceFormatsKHR;
866 PFN_vkGetPhysicalDeviceSurfacePresentModesKHR vkGetPhysicalDeviceSurfacePresentModesKHR;
867
868 struct {
869 bool compute = false;
870 bool wideLines = false;
871 bool debugUtils = false;
873 bool texture3DSliceAs2D = false;
874 bool tessellation = false;
875 bool geometryShader = false;
876 bool nonFillPolygonMode = false;
877 bool multiView = false;
880
881 VkPipelineCache pipelineCache = VK_NULL_HANDLE;
884 DescriptorPoolData(VkDescriptorPool pool_)
885 : pool(pool_)
886 { }
887 VkDescriptorPool pool = VK_NULL_HANDLE;
888 int refCount = 0;
890 };
893
894 VkQueryPool timestampQueryPool = VK_NULL_HANDLE;
896
897 VkFormat optimalDsFormat = VK_FORMAT_UNDEFINED;
899
904
907 {
908 for (int i = 0; i < QVK_FRAMES_IN_FLIGHT; ++i)
909 cbWrapper[i] = new QVkCommandBuffer(rhi);
910 }
912 {
913 for (int i = 0; i < QVK_FRAMES_IN_FLIGHT; ++i)
914 delete cbWrapper[i];
915 }
916 bool active = false;
918 VkFence cmdFence = VK_NULL_HANDLE;
921
926 VkBuffer stagingBuf;
931 };
937 VkBuffer stagingBuf;
939 };
941
943 enum Type {
954 };
956 int lastActiveFrameSlot; // -1 if not used otherwise 0..FRAMES_IN_FLIGHT-1
957 union {
958 struct {
959 VkPipeline pipeline;
960 VkPipelineLayout layout;
962 struct {
964 VkDescriptorSetLayout layout;
966 struct {
972 struct {
973 VkDeviceMemory memory;
974 VkImage image;
975 VkImageView imageView;
977 struct {
978 VkImage image;
979 VkImageView imageView;
985 struct {
986 VkSampler sampler;
988 struct {
989 VkFramebuffer fb;
993 struct {
994 VkRenderPass rp;
996 struct {
1000 struct {
1001 VkCommandBuffer cb;
1003 };
1004 };
1006};
1007
1012
1014
1015#endif
\inmodule QtCore
Definition qbitarray.h:13
\inmodule QtCore
\inmodule QtCore
Definition qbytearray.h:57
The QColor class provides colors based on RGB, HSV or CMYK values.
Definition qcolor.h:31
\inmodule QtCore
Definition qhash.h:818
void clear() noexcept(std::is_nothrow_destructible< Node >::value)
Removes all items from the hash and frees up all memory used by it.
Definition qhash.h:949
Definition qlist.h:74
The QMatrix4x4 class represents a 4x4 transformation matrix in 3D space.
Definition qmatrix4x4.h:25
\inmodule QtGui
Definition qrhi.h:834
Type
Specifies storage type of buffer resource.
Definition qrhi.h:836
\inmodule QtGui
Definition qrhi.h:568
\inmodule QtGui
Definition qrhi.h:1614
QPair< QRhiBuffer *, quint32 > VertexInput
Synonym for QPair<QRhiBuffer *, quint32>.
Definition qrhi.h:1643
QPair< int, quint32 > DynamicOffset
Synonym for QPair<int, quint32>.
Definition qrhi.h:1639
IndexFormat
Specifies the index data type.
Definition qrhi.h:1616
\inmodule QtGui
Definition qrhi.h:1585
\inmodule QtGui
Definition qrhi.h:44
\inmodule QtGui
Definition qrhi.h:1241
\inmodule QtGui
Definition qrhi.h:765
\inmodule QtGui
Definition qrhi.h:1071
QSize pixelSize() const
Definition qrhi.h:1092
int sampleCount() const
Definition qrhi.h:1095
Type
Specifies the type of the renderbuffer.
Definition qrhi.h:1073
\inmodule QtGui
Definition qrhi.h:1119
\inmodule QtGui
Definition qrhi.h:1135
\inmodule QtGui
Definition qrhi.h:1694
QRhi * rhi() const
Definition qrhi.cpp:3477
\inmodule QtGui
Definition qrhi.h:1007
Filter
Specifies the minification, magnification, or mipmap filtering.
Definition qrhi.h:1009
Filter magFilter() const
Definition qrhi.h:1034
AddressMode
Specifies the addressing mode.
Definition qrhi.h:1015
Filter minFilter() const
Definition qrhi.h:1037
Filter mipmapMode() const
Definition qrhi.h:1040
\inmodule QtGui
Definition qrhi.h:138
\inmodule QtGui
Definition qrhi.h:1190
\inmodule QtGui
Definition qrhi.h:1150
\inmodule QtGui
Definition qrhi.h:1513
Format
Describes the swapchain format.
Definition qrhi.h:1525
\inmodule QtGui
Definition qrhi.h:1161
\inmodule QtGui
Definition qrhi.h:883
int arraySize() const
Definition qrhi.h:969
int sampleCount() const
Definition qrhi.h:983
Format
Specifies the texture format.
Definition qrhi.h:902
QSize pixelSize() const
Definition qrhi.h:963
\inmodule QtGui
Definition qrhi.h:85
\variable QRhiVulkanNativeHandles::physDev
\inmodule QtGui
\variable QRhiVulkanInitParams::inst
\variable QRhiVulkanCommandBufferNativeHandles::commandBuffer
QVarLengthArray< DescriptorPoolData, 8 > descriptorPools
void recordTransitionPassResources(QVkCommandBuffer *cbD, const QRhiPassResourceTracker &tracker)
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
VkSampleCountFlagBits effectiveSampleCount(int sampleCount)
QVkSwapChain * currentSwapChain
bool geometryShader
bool importedDevice
QByteArrayList requestedDeviceExtensions
bool createDefaultRenderPass(QVkRenderPassDescriptor *rpD, bool hasDepthStencil, VkSampleCountFlagBits samples, VkFormat colorFormat)
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
double elapsedSecondsFromTimestamp(quint64 timestamp[2], bool *ok)
VkFormat optimalDsFormat
QRhi::FrameOpResult beginOffscreenFrame(QRhiCommandBuffer **cb, QRhi::BeginFrameFlags flags) override
void trackedBufferBarrier(QVkCommandBuffer *cbD, QVkBuffer *bufD, int slot, VkAccessFlags access, VkPipelineStageFlags stage)
void endExternal(QRhiCommandBuffer *cb) override
QWindow * maybeWindow
void dispatch(QRhiCommandBuffer *cb, int x, int y, int z) override
VkPhysicalDeviceFeatures physDevFeatures
QRhiVulkanNativeHandles nativeHandlesStruct
bool allocateDescriptorSet(VkDescriptorSetAllocateInfo *allocInfo, VkDescriptorSet *result, int *resultPoolIndex)
void updateShaderResourceBindings(QRhiShaderResourceBindings *srb, int descSetIdx=-1)
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)
void setComputePipeline(QRhiCommandBuffer *cb, QRhiComputePipeline *ps) override
QRhi::FrameOpResult beginFrame(QRhiSwapChain *swapChain, QRhi::BeginFrameFlags flags) override
QRhi::FrameOpResult startPrimaryCommandBuffer(VkCommandBuffer *cb)
double lastCompletedGpuTime(QRhiCommandBuffer *cb) override
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
bool createOffscreenRenderPass(QVkRenderPassDescriptor *rpD, const QRhiColorAttachment *firstColorAttachment, const QRhiColorAttachment *lastColorAttachment, bool preserveColor, bool preserveDs, QRhiRenderBuffer *depthStencilBuffer, QRhiTexture *depthTexture)
QRhiTexture * createTexture(QRhiTexture::Format format, const QSize &pixelSize, int depth, int arraySize, int sampleCount, QRhiTexture::Flags flags) override
void waitCommandCompletion(int frameSlot)
void debugMarkBegin(QRhiCommandBuffer *cb, const QByteArray &name) override
PFN_vkGetPhysicalDeviceSurfacePresentModesKHR vkGetPhysicalDeviceSurfacePresentModesKHR
bool recreateSwapChain(QRhiSwapChain *swapChain)
PFN_vkQueuePresentKHR vkQueuePresentKHR
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
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
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)
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
bool vertexAttribDivisor
QMatrix4x4 clipCorrectMatrix
void executeBufferHostWritesForSlot(QVkBuffer *bufD, int slot)
bool isYUpInNDC() const override
const QRhiNativeHandles * nativeHandles() 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()
struct QRhiVulkan::@355 caps
QByteArray pipelineCacheData() override
quint32 gfxQueueIdx
VkDeviceSize texbufAlign
QList< DeferredReleaseEntry > releaseQueue
void endAndEnqueueSecondaryCommandBuffer(VkCommandBuffer cb, QVkCommandBuffer *cbD)
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
struct QRhiVulkan::OffscreenFrame ofr
QSet< QVkSwapChain * > swapchains
int ubufAlignment() const override
QRhiDriverInfo driverInfo() const override
void beginExternal(QRhiCommandBuffer *cb) override
void setViewport(QRhiCommandBuffer *cb, const QRhiViewport &viewport) override
QRhi::FrameOpResult endAndSubmitPrimaryCommandBuffer(VkCommandBuffer cb, VkFence cmdFence, VkSemaphore *waitSem, VkSemaphore *signalSem)
QRhi::FrameOpResult endFrame(QRhiSwapChain *swapChain, QRhi::EndFrameFlags flags) override
VkPhysicalDevice physDev
bool makeThreadLocalNativeContextCurrent() override
ResourceLimit
Describes the resource limit to query.
Definition qrhi.h:1846
Feature
Flag values to indicate what features are supported by the backend currently in use.
Definition qrhi.h:1793
static const int MAX_MIP_LEVELS
Definition qrhi.h:1955
FrameOpResult
Describes the result of operations that can have a soft failure.
Definition qrhi.h:1786
Definition qset.h:18
\inmodule QtCore
Definition qsize.h:25
\inmodule QtCore
The QVulkanDeviceFunctions class provides cross-platform access to the device level core Vulkan 1....
The QVulkanFunctions class provides cross-platform access to the instance level core Vulkan 1....
The QVulkanInstance class represents a native Vulkan instance, enabling Vulkan rendering onto a QSurf...
\inmodule QtGui
Definition qwindow.h:63
Combined button and popup list for selecting options.
Definition image.cpp:4
static int instanceCount
EGLOutputLayerEXT layer
Flags
GLsizei const GLfloat * v
[13]
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat z
GLint GLint GLint GLint GLint x
[0]
GLuint const GLuint * buffers
GLint GLenum GLsizei GLsizei GLsizei depth
GLsizei samples
GLenum GLuint GLint level
GLfloat GLfloat GLfloat w
[0]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLuint sampler
GLenum GLenum GLsizei count
GLsizei const GLubyte * commands
GLfloat GLfloat f
GLenum src
GLenum type
GLuint GLsizei const GLchar * label
[43]
GLenum access
GLbitfield flags
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLuint name
GLint GLsizei GLsizei GLenum format
GLsizei GLenum GLsizei GLsizei GLuint memory
GLint y
void ** params
GLboolean reset
const GLubyte * c
GLint void * img
Definition qopenglext.h:233
GLint limit
GLuint64EXT * result
[6]
GLenum GLenum colorFormat
GLsizeiptr const void GLenum usage
Definition qopenglext.h:543
static const int QVK_UNIFORM_BUFFERS_PER_POOL
static const int QVK_COMBINED_IMAGE_SAMPLERS_PER_POOL
static const int QVK_STORAGE_BUFFERS_PER_POOL
static const int QVK_STORAGE_IMAGES_PER_POOL
void * QVkAllocator
static const int QVK_MAX_ACTIVE_TIMESTAMP_PAIRS
static const int QVK_DESC_SETS_PER_POOL
void * QVkAlloc
static const int QVK_FRAMES_IN_FLIGHT
SSL_CTX int(* cb)(SSL *ssl, unsigned char **out, unsigned char *outlen, const unsigned char *in, unsigned int inlen, void *arg)
@ desc
@ Q_RELOCATABLE_TYPE
Definition qtypeinfo.h:145
#define Q_DECLARE_TYPEINFO(TYPE, FLAGS)
Definition qtypeinfo.h:163
unsigned int quint32
Definition qtypes.h:45
int qint32
Definition qtypes.h:44
unsigned long long quint64
Definition qtypes.h:56
unsigned int uint
Definition qtypes.h:29
QList< QImage > images
[6]
QVBoxLayout * layout
QSharedPointer< T > other(t)
[5]
view viewport() -> scroll(dx, dy, deviceRect)
view create()
\inmodule QtGui
Definition qrhi.h:850
\inmodule QtGui
Definition qrhi.h:1722
\variable QRhiReadbackResult::completed
Definition qrhi.h:788
\inmodule QtGui
Definition qrhi.h:1686
static const int MAX_TEX_SAMPLER_ARRAY_SIZE
Definition qrhi.h:498
\inmodule QtGui
Definition qrhi.h:1745
\inmodule QtGui
Definition qrhi.h:953
QRhiReadbackResult * result
VkBuffer stagingBuffers[QVK_FRAMES_IN_FLIGHT]
struct QRhiVulkan::DeferredReleaseEntry::@359::@363 buffer
VkImageView rtv[QVkRenderTargetData::MAX_COLOR_ATTACHMENTS]
struct QRhiVulkan::DeferredReleaseEntry::@359::@368 renderPass
QVkAlloc allocations[QVK_FRAMES_IN_FLIGHT]
struct QRhiVulkan::DeferredReleaseEntry::@359::@364 renderBuffer
VkImageView extraImageViews[QRhi::MAX_MIP_LEVELS]
struct QRhiVulkan::DeferredReleaseEntry::@359::@361 pipelineState
VkDescriptorSetLayout layout
QVkAlloc stagingAllocations[QVK_FRAMES_IN_FLIGHT]
struct QRhiVulkan::DeferredReleaseEntry::@359::@370 secondaryCommandBuffer
VkImageView resrtv[QVkRenderTargetData::MAX_COLOR_ATTACHMENTS]
struct QRhiVulkan::DeferredReleaseEntry::@359::@365 texture
struct QRhiVulkan::DeferredReleaseEntry::@359::@362 shaderResourceBindings
struct QRhiVulkan::DeferredReleaseEntry::@359::@367 textureRenderTarget
DescriptorPoolData(VkDescriptorPool pool_)
QVkCommandBuffer * cbWrapper[QVK_FRAMES_IN_FLIGHT]
OffscreenFrame(QRhiImplementation *rhi)
QRhiTexture::Format format
QRhiReadbackDescription desc
QRhiReadbackResult * result
VkPipelineStageFlags stage
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
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
union QVkCommandBuffer::Command::Args args
struct QVkCommandBuffer::@247 pools
VkBuffer currentVertexBuffers[VERTEX_INPUT_RESOURCE_SLOT_COUNT]
struct QVkCommandBuffer::@245 computePassState
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]
QHash< QRhiResource *, QPair< VkAccessFlags, bool > > writtenResources
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
QVarLengthArray< QRhiPassResourceTracker, 8 > passResTrackers
VkIndexType currentIndexFormat
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
bool create() override
VkPipelineLayout layout
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.
VkFormat vkformat
VkSampleCountFlagBits samples
QRhiTexture::Format backingFormat() const override
bool create() override
Creates the corresponding native graphics resources.
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
QRhiVulkanRenderPassNativeHandles nativeHandlesStruct
QVector< quint32 > serializedFormat() const override
bool isCompatible(const QRhiRenderPassDescriptor *other) const override
QVkRenderPassDescriptor * rp
QRhiRenderTargetAttachmentTracker::ResIdList currentResIdList
static const int MAX_COLOR_ATTACHMENTS
int lastActiveFrameSlot
bool create() override
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
struct QVkShaderResourceBindings::BoundSampledTextureData::@239 d[QRhiShaderResourceBinding::Data::MAX_TEX_SAMPLER_ARRAY_SIZE]
VkDescriptorSetLayout layout
void updateResources(UpdateFlags flags) override
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]
QSize pixelSize() const override
int sampleCount() const override
float devicePixelRatio() const override
QVkRenderTargetData d
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
bool isFormatSupported(Format f) override
QVkCommandBuffer cbWrapper
static const quint32 EXPECTED_MAX_BUFFER_COUNT
QRhiRenderPassDescriptor * newCompatibleRenderPassDescriptor() override
struct QVkSwapChain::FrameResources frameRes[QVK_FRAMES_IN_FLIGHT]
bool supportsReadback
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
bool ensureSurface()
QVkSwapChainRenderTarget rtWrapper
QRhiCommandBuffer * currentFrameCommandBuffer() override
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()
VkSampleCountFlagBits samples
VkImageView imageViewForLevel(int level)
int lastActiveFrameSlot
QVkAlloc stagingAllocations[QVK_FRAMES_IN_FLIGHT]
bool createFrom(NativeTexture src) override
Similar to create(), except that no new native textures are created.
QVkAlloc imageAlloc
void setNativeLayout(int layout) override
With some graphics APIs, such as Vulkan, integrating custom rendering code that uses the graphics API...
VkImageView perLevelImageViews[QRhi::MAX_MIP_LEVELS]
NativeTexture nativeTexture() override
UsageState usageState
bool prepareCreate(QSize *adjustedSize=nullptr)
uint mipLevelCount
VkImageView imageView
Definition moc.h:24
struct QVkCommandBuffer::Command::Args::@272 copyImageToBuffer
struct QVkCommandBuffer::Command::Args::@304 debugMarkerEnd
struct QVkCommandBuffer::Command::Args::@289 bindIndexBuffer
struct QVkCommandBuffer::Command::Args::@307 debugMarkerInsert
struct QVkCommandBuffer::Command::Args::@301 drawIndexed
struct QVkCommandBuffer::Command::Args::@277 bufferBarrier
struct QVkCommandBuffer::Command::Args::@280 beginRenderPass
struct QVkCommandBuffer::Command::Args::@308 transitionResources
struct QVkCommandBuffer::Command::Args::@284 bindPipeline
struct QVkCommandBuffer::Command::Args::@291 setViewport
struct QVkCommandBuffer::Command::Args::@309 dispatch
VkPipelineStageFlags srcStageMask
struct QVkCommandBuffer::Command::Args::@286 bindDescriptorSet
struct QVkCommandBuffer::Command::Args::@269 copyBufferToImage
VkPipelineStageFlags dstStageMask
struct QVkCommandBuffer::Command::Args::@299 draw
struct QVkCommandBuffer::Command::Args::@278 blitImage
struct QVkCommandBuffer::Command::Args::@295 setBlendConstants
struct QVkCommandBuffer::Command::Args::@274 imageBarrier
VkRenderPassBeginInfo desc
struct QVkCommandBuffer::Command::Args::@293 setScissor
struct QVkCommandBuffer::Command::Args::@297 setStencilRef
VkPipelineBindPoint bindPoint
struct QVkCommandBuffer::Command::Args::@287 bindVertexBuffer
struct QVkCommandBuffer::Command::Args::@310 executeSecondary
struct QVkCommandBuffer::Command::Args::@267 copyBuffer
struct QVkCommandBuffer::Command::Args::@303 debugMarkerBegin
struct QVkCommandBuffer::Command::Args::@271 copyImage
struct QVkCommandBuffer::Command::Args::@282 endRenderPass