Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qrhi.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 QRHI_H
5#define QRHI_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is part of the RHI API, with limited compatibility guarantees.
12// Usage of this API may make your code source and binary incompatible with
13// future versions of Qt.
14//
15
16#include <QtGui/qtguiglobal.h>
17#include <QtCore/qsize.h>
18#include <QtCore/qlist.h>
19#include <QtCore/qvarlengtharray.h>
20#include <QtCore/qthread.h>
21#include <QtGui/qmatrix4x4.h>
22#include <QtGui/qcolor.h>
23#include <QtGui/qimage.h>
24#include <functional>
25#include <array>
26
27#include <rhi/qshader.h>
28
30
31class QWindow;
32class QRhi;
34class QRhiBuffer;
36class QRhiTexture;
37class QRhiSampler;
41class QRhiSwapChain;
42
44{
45public:
48
49 float depthClearValue() const { return m_d; }
50 void setDepthClearValue(float d) { m_d = d; }
51
52 quint32 stencilClearValue() const { return m_s; }
54
55private:
56 float m_d = 1.0f;
57 quint32 m_s = 0;
58
60 {
61 return a.m_d == b.m_d && a.m_s == b.m_s;
62 }
63
65 {
66 return !(a == b);
67 }
68
69 friend size_t qHash(const QRhiDepthStencilClearValue &v, size_t seed = 0) noexcept
70 {
72 seed = hash(seed, v.m_d);
73 seed = hash(seed, v.m_s);
74 return seed;
75 }
76};
77
79
80#ifndef QT_NO_DEBUG_STREAM
82#endif
83
84class Q_GUI_EXPORT QRhiViewport
85{
86public:
87 QRhiViewport() = default;
88 QRhiViewport(float x, float y, float w, float h, float minDepth = 0.0f, float maxDepth = 1.0f);
89
90 std::array<float, 4> viewport() const { return m_rect; }
91 void setViewport(float x, float y, float w, float h) {
92 m_rect[0] = x; m_rect[1] = y; m_rect[2] = w; m_rect[3] = h;
93 }
94
95 float minDepth() const { return m_minDepth; }
96 void setMinDepth(float minDepth) { m_minDepth = minDepth; }
97
98 float maxDepth() const { return m_maxDepth; }
99 void setMaxDepth(float maxDepth) { m_maxDepth = maxDepth; }
100
101private:
102 std::array<float, 4> m_rect { { 0.0f, 0.0f, 0.0f, 0.0f } };
103 float m_minDepth = 0.0f;
104 float m_maxDepth = 1.0f;
105
106 friend bool operator==(const QRhiViewport &a, const QRhiViewport &b) noexcept
107 {
108 return a.m_rect == b.m_rect
109 && a.m_minDepth == b.m_minDepth
110 && a.m_maxDepth == b.m_maxDepth;
111 }
112
113 friend bool operator!=(const QRhiViewport &a, const QRhiViewport &b) noexcept
114 {
115 return !(a == b);
116 }
117
118 friend size_t qHash(const QRhiViewport &v, size_t seed = 0) noexcept
119 {
121 seed = hash(seed, v.m_rect[0]);
122 seed = hash(seed, v.m_rect[1]);
123 seed = hash(seed, v.m_rect[2]);
124 seed = hash(seed, v.m_rect[3]);
125 seed = hash(seed, v.m_minDepth);
126 seed = hash(seed, v.m_maxDepth);
127 return seed;
128 }
129};
130
132
133#ifndef QT_NO_DEBUG_STREAM
134Q_GUI_EXPORT QDebug operator<<(QDebug, const QRhiViewport &);
135#endif
136
137class Q_GUI_EXPORT QRhiScissor
138{
139public:
140 QRhiScissor() = default;
141 QRhiScissor(int x, int y, int w, int h);
142
143 std::array<int, 4> scissor() const { return m_rect; }
144 void setScissor(int x, int y, int w, int h) {
145 m_rect[0] = x; m_rect[1] = y; m_rect[2] = w; m_rect[3] = h;
146 }
147
148private:
149 std::array<int, 4> m_rect { { 0, 0, 0, 0 } };
150
151 friend bool operator==(const QRhiScissor &a, const QRhiScissor &b) noexcept
152 {
153 return a.m_rect == b.m_rect;
154 }
155
156 friend bool operator!=(const QRhiScissor &a, const QRhiScissor &b) noexcept
157 {
158 return !(a == b);
159 }
160
161 friend size_t qHash(const QRhiScissor &v, size_t seed = 0) noexcept
162 {
164 seed = hash(seed, v.m_rect[0]);
165 seed = hash(seed, v.m_rect[1]);
166 seed = hash(seed, v.m_rect[2]);
167 seed = hash(seed, v.m_rect[3]);
168 return seed;
169 }
170};
171
173
174#ifndef QT_NO_DEBUG_STREAM
175Q_GUI_EXPORT QDebug operator<<(QDebug, const QRhiScissor &);
176#endif
177
178class Q_GUI_EXPORT QRhiVertexInputBinding
179{
180public:
183 PerInstance
184 };
185
187 QRhiVertexInputBinding(quint32 stride, Classification cls = PerVertex, quint32 stepRate = 1);
188
189 quint32 stride() const { return m_stride; }
190 void setStride(quint32 s) { m_stride = s; }
191
192 Classification classification() const { return m_classification; }
193 void setClassification(Classification c) { m_classification = c; }
194
195 quint32 instanceStepRate() const { return m_instanceStepRate; }
196 void setInstanceStepRate(quint32 rate) { m_instanceStepRate = rate; }
197
198private:
199 quint32 m_stride = 0;
200 Classification m_classification = PerVertex;
201 quint32 m_instanceStepRate = 1;
202
203 friend bool operator==(const QRhiVertexInputBinding &a, const QRhiVertexInputBinding &b) noexcept
204 {
205 return a.m_stride == b.m_stride
206 && a.m_classification == b.m_classification
207 && a.m_instanceStepRate == b.m_instanceStepRate;
208 }
209
210 friend bool operator!=(const QRhiVertexInputBinding &a, const QRhiVertexInputBinding &b) noexcept
211 {
212 return !(a == b);
213 }
214
215 friend size_t qHash(const QRhiVertexInputBinding &v, size_t seed = 0) noexcept
216 {
218 seed = hash(seed, v.m_stride);
219 seed = hash(seed, v.m_classification);
220 seed = hash(seed, v.m_instanceStepRate);
221 return seed;
222 }
223};
224
226
227#ifndef QT_NO_DEBUG_STREAM
228Q_GUI_EXPORT QDebug operator<<(QDebug, const QRhiVertexInputBinding &);
229#endif
230
231class Q_GUI_EXPORT QRhiVertexInputAttribute
232{
233public:
234 enum Format {
253 Half
254 };
255
257 QRhiVertexInputAttribute(int binding, int location, Format format, quint32 offset, int matrixSlice = -1);
258
259 int binding() const { return m_binding; }
260 void setBinding(int b) { m_binding = b; }
261
262 int location() const { return m_location; }
263 void setLocation(int loc) { m_location = loc; }
264
265 Format format() const { return m_format; }
266 void setFormat(Format f) { m_format = f; }
267
268 quint32 offset() const { return m_offset; }
269 void setOffset(quint32 ofs) { m_offset = ofs; }
270
271 int matrixSlice() const { return m_matrixSlice; }
272 void setMatrixSlice(int slice) { m_matrixSlice = slice; }
273
274private:
275 int m_binding = 0;
276 int m_location = 0;
277 Format m_format = Float4;
278 quint32 m_offset = 0;
279 int m_matrixSlice = -1;
280
282 {
283 return a.m_binding == b.m_binding
284 && a.m_location == b.m_location
285 && a.m_format == b.m_format
286 && a.m_offset == b.m_offset;
287 // matrixSlice excluded intentionally
288 }
289
291 {
292 return !(a == b);
293 }
294
295 friend size_t qHash(const QRhiVertexInputAttribute &v, size_t seed = 0) noexcept
296 {
298 seed = hash(seed, v.m_binding);
299 seed = hash(seed, v.m_location);
300 seed = hash(seed, v.m_format);
301 seed = hash(seed, v.m_offset);
302 return seed;
303 }
304};
305
307
308#ifndef QT_NO_DEBUG_STREAM
309Q_GUI_EXPORT QDebug operator<<(QDebug, const QRhiVertexInputAttribute &);
310#endif
311
312class Q_GUI_EXPORT QRhiVertexInputLayout
313{
314public:
316
317 void setBindings(std::initializer_list<QRhiVertexInputBinding> list) { m_bindings = list; }
318 template<typename InputIterator>
319 void setBindings(InputIterator first, InputIterator last)
320 {
321 m_bindings.clear();
322 std::copy(first, last, std::back_inserter(m_bindings));
323 }
324 const QRhiVertexInputBinding *cbeginBindings() const { return m_bindings.cbegin(); }
325 const QRhiVertexInputBinding *cendBindings() const { return m_bindings.cend(); }
326 const QRhiVertexInputBinding *bindingAt(qsizetype index) const { return &m_bindings.at(index); }
327 qsizetype bindingCount() const { return m_bindings.count(); }
328
329 void setAttributes(std::initializer_list<QRhiVertexInputAttribute> list) { m_attributes = list; }
330 template<typename InputIterator>
331 void setAttributes(InputIterator first, InputIterator last)
332 {
333 m_attributes.clear();
334 std::copy(first, last, std::back_inserter(m_attributes));
335 }
336 const QRhiVertexInputAttribute *cbeginAttributes() const { return m_attributes.cbegin(); }
337 const QRhiVertexInputAttribute *cendAttributes() const { return m_attributes.cend(); }
338 const QRhiVertexInputAttribute *attributeAt(qsizetype index) const { return &m_attributes.at(index); }
339 qsizetype attributeCount() const { return m_attributes.count(); }
340
341private:
344
345 friend bool operator==(const QRhiVertexInputLayout &a, const QRhiVertexInputLayout &b) noexcept
346 {
347 return a.m_bindings == b.m_bindings && a.m_attributes == b.m_attributes;
348 }
349
350 friend bool operator!=(const QRhiVertexInputLayout &a, const QRhiVertexInputLayout &b) noexcept
351 {
352 return !(a == b);
353 }
354
355 friend size_t qHash(const QRhiVertexInputLayout &v, size_t seed = 0) noexcept
356 {
358 seed = hash(seed, v.m_bindings);
359 seed = hash(seed, v.m_attributes);
360 return seed;
361 }
362
363 friend Q_GUI_EXPORT QDebug operator<<(QDebug, const QRhiVertexInputLayout &);
364};
365
366#ifndef QT_NO_DEBUG_STREAM
367Q_GUI_EXPORT QDebug operator<<(QDebug, const QRhiVertexInputLayout &);
368#endif
369
370class Q_GUI_EXPORT QRhiShaderStage
371{
372public:
373 enum Type {
379 Compute
380 };
381
382 QRhiShaderStage() = default;
385
386 Type type() const { return m_type; }
387 void setType(Type t) { m_type = t; }
388
389 QShader shader() const { return m_shader; }
390 void setShader(const QShader &s) { m_shader = s; }
391
392 QShader::Variant shaderVariant() const { return m_shaderVariant; }
393 void setShaderVariant(QShader::Variant v) { m_shaderVariant = v; }
394
395private:
396 Type m_type = Vertex;
397 QShader m_shader;
399
400 friend bool operator==(const QRhiShaderStage &a, const QRhiShaderStage &b) noexcept
401 {
402 return a.m_type == b.m_type
403 && a.m_shader == b.m_shader
404 && a.m_shaderVariant == b.m_shaderVariant;
405 }
406
407 friend bool operator!=(const QRhiShaderStage &a, const QRhiShaderStage &b) noexcept
408 {
409 return !(a == b);
410 }
411
412 friend size_t qHash(const QRhiShaderStage &v, size_t seed = 0) noexcept
413 {
415 seed = hash(seed, v.m_type);
416 seed = hash(seed, v.m_shader);
417 seed = hash(seed, v.m_shaderVariant);
418 return seed;
419 }
420};
421
423
424#ifndef QT_NO_DEBUG_STREAM
425Q_GUI_EXPORT QDebug operator<<(QDebug, const QRhiShaderStage &);
426#endif
427
429
431{
432public:
433 enum Type {
443 BufferLoadStore
444 };
445
447 VertexStage = 1 << 0,
448 TessellationControlStage = 1 << 1,
449 TessellationEvaluationStage = 1 << 2,
450 GeometryStage = 1 << 3,
451 FragmentStage = 1 << 4,
452 ComputeStage = 1 << 5
453 };
454 Q_DECLARE_FLAGS(StageFlags, StageFlag)
455
457
458 bool isLayoutCompatible(const QRhiShaderResourceBinding &other) const;
459
460 static QRhiShaderResourceBinding uniformBuffer(int binding, StageFlags stage, QRhiBuffer *buf);
461 static QRhiShaderResourceBinding uniformBuffer(int binding, StageFlags stage, QRhiBuffer *buf, quint32 offset, quint32 size);
462 static QRhiShaderResourceBinding uniformBufferWithDynamicOffset(int binding, StageFlags stage, QRhiBuffer *buf, quint32 size);
463
464 static QRhiShaderResourceBinding sampledTexture(int binding, StageFlags stage, QRhiTexture *tex, QRhiSampler *sampler);
465
469 };
470 static QRhiShaderResourceBinding sampledTextures(int binding, StageFlags stage, int count, const TextureAndSampler *texSamplers);
471
472 static QRhiShaderResourceBinding texture(int binding, StageFlags stage, QRhiTexture *tex);
473 static QRhiShaderResourceBinding textures(int binding, StageFlags stage, int count, QRhiTexture **tex);
474 static QRhiShaderResourceBinding sampler(int binding, StageFlags stage, QRhiSampler *sampler);
475
476 static QRhiShaderResourceBinding imageLoad(int binding, StageFlags stage, QRhiTexture *tex, int level);
477 static QRhiShaderResourceBinding imageStore(int binding, StageFlags stage, QRhiTexture *tex, int level);
478 static QRhiShaderResourceBinding imageLoadStore(int binding, StageFlags stage, QRhiTexture *tex, int level);
479
480 static QRhiShaderResourceBinding bufferLoad(int binding, StageFlags stage, QRhiBuffer *buf);
481 static QRhiShaderResourceBinding bufferLoad(int binding, StageFlags stage, QRhiBuffer *buf, quint32 offset, quint32 size);
482 static QRhiShaderResourceBinding bufferStore(int binding, StageFlags stage, QRhiBuffer *buf);
483 static QRhiShaderResourceBinding bufferStore(int binding, StageFlags stage, QRhiBuffer *buf, quint32 offset, quint32 size);
484 static QRhiShaderResourceBinding bufferLoadStore(int binding, StageFlags stage, QRhiBuffer *buf);
485 static QRhiShaderResourceBinding bufferLoadStore(int binding, StageFlags stage, QRhiBuffer *buf, quint32 offset, quint32 size);
486
487 struct Data
488 {
490 QRhiShaderResourceBinding::StageFlags stage;
497 };
498 static const int MAX_TEX_SAMPLER_ARRAY_SIZE = 16;
500 int count;
501 TextureAndSampler texSamplers[MAX_TEX_SAMPLER_ARRAY_SIZE];
502 };
505 int level;
506 };
511 };
512 union {
517 } u;
518
519 int arraySize() const
520 {
522 ? u.stex.count
523 : 1;
524 }
525
526 template<typename Output>
528 {
529 // must write out exactly LAYOUT_DESC_ENTRIES_PER_BINDING elements here
530 *dst++ = quint32(binding);
531 *dst++ = quint32(stage);
532 *dst++ = quint32(type);
533 *dst++ = quint32(arraySize());
534 return dst;
535 }
536 };
537
538 static const int LAYOUT_DESC_ENTRIES_PER_BINDING = 4;
539
540 template<typename Output>
542 const QRhiShaderResourceBinding *last,
543 Output dst)
544 {
545 while (first != last) {
546 dst = first->d.serialize(dst);
547 ++first;
548 }
549 }
550
551private:
552 Data d;
553 friend class QRhiImplementation;
554};
555
556Q_DECLARE_OPERATORS_FOR_FLAGS(QRhiShaderResourceBinding::StageFlags)
557
559
560Q_GUI_EXPORT bool operator==(const QRhiShaderResourceBinding &a, const QRhiShaderResourceBinding &b) noexcept;
561Q_GUI_EXPORT bool operator!=(const QRhiShaderResourceBinding &a, const QRhiShaderResourceBinding &b) noexcept;
562Q_GUI_EXPORT size_t qHash(const QRhiShaderResourceBinding &b, size_t seed = 0) noexcept;
563#ifndef QT_NO_DEBUG_STREAM
565#endif
566
567class Q_GUI_EXPORT QRhiColorAttachment
568{
569public:
573
574 QRhiTexture *texture() const { return m_texture; }
575 void setTexture(QRhiTexture *tex) { m_texture = tex; }
576
577 QRhiRenderBuffer *renderBuffer() const { return m_renderBuffer; }
578 void setRenderBuffer(QRhiRenderBuffer *rb) { m_renderBuffer = rb; }
579
580 int layer() const { return m_layer; }
581 void setLayer(int layer) { m_layer = layer; }
582
583 int level() const { return m_level; }
584 void setLevel(int level) { m_level = level; }
585
586 QRhiTexture *resolveTexture() const { return m_resolveTexture; }
587 void setResolveTexture(QRhiTexture *tex) { m_resolveTexture = tex; }
588
589 int resolveLayer() const { return m_resolveLayer; }
590 void setResolveLayer(int layer) { m_resolveLayer = layer; }
591
592 int resolveLevel() const { return m_resolveLevel; }
593 void setResolveLevel(int level) { m_resolveLevel = level; }
594
595 int multiViewCount() const { return m_multiViewCount; }
596 void setMultiViewCount(int count) { m_multiViewCount = count; }
597
598private:
599 QRhiTexture *m_texture = nullptr;
600 QRhiRenderBuffer *m_renderBuffer = nullptr;
601 int m_layer = 0;
602 int m_level = 0;
603 QRhiTexture *m_resolveTexture = nullptr;
604 int m_resolveLayer = 0;
605 int m_resolveLevel = 0;
606 int m_multiViewCount = 0;
607};
608
610
612{
613public:
616 QRhiTextureRenderTargetDescription(const QRhiColorAttachment &colorAttachment, QRhiRenderBuffer *depthStencilBuffer);
617 QRhiTextureRenderTargetDescription(const QRhiColorAttachment &colorAttachment, QRhiTexture *depthTexture);
618
619 void setColorAttachments(std::initializer_list<QRhiColorAttachment> list) { m_colorAttachments = list; }
620 template<typename InputIterator>
621 void setColorAttachments(InputIterator first, InputIterator last)
622 {
623 m_colorAttachments.clear();
624 std::copy(first, last, std::back_inserter(m_colorAttachments));
625 }
626 const QRhiColorAttachment *cbeginColorAttachments() const { return m_colorAttachments.cbegin(); }
627 const QRhiColorAttachment *cendColorAttachments() const { return m_colorAttachments.cend(); }
628 const QRhiColorAttachment *colorAttachmentAt(qsizetype index) const { return &m_colorAttachments.at(index); }
629 qsizetype colorAttachmentCount() const { return m_colorAttachments.count(); }
630
631 QRhiRenderBuffer *depthStencilBuffer() const { return m_depthStencilBuffer; }
632 void setDepthStencilBuffer(QRhiRenderBuffer *renderBuffer) { m_depthStencilBuffer = renderBuffer; }
633
634 QRhiTexture *depthTexture() const { return m_depthTexture; }
635 void setDepthTexture(QRhiTexture *texture) { m_depthTexture = texture; }
636
637private:
639 QRhiRenderBuffer *m_depthStencilBuffer = nullptr;
640 QRhiTexture *m_depthTexture = nullptr;
641};
642
644{
645public:
650
651 QImage image() const { return m_image; }
652 void setImage(const QImage &image) { m_image = image; }
653
654 QByteArray data() const { return m_data; }
655 void setData(const QByteArray &data) { m_data = data; }
656
657 quint32 dataStride() const { return m_dataStride; }
658 void setDataStride(quint32 stride) { m_dataStride = stride; }
659
660 QPoint destinationTopLeft() const { return m_destinationTopLeft; }
661 void setDestinationTopLeft(const QPoint &p) { m_destinationTopLeft = p; }
662
663 QSize sourceSize() const { return m_sourceSize; }
664 void setSourceSize(const QSize &size) { m_sourceSize = size; }
665
666 QPoint sourceTopLeft() const { return m_sourceTopLeft; }
667 void setSourceTopLeft(const QPoint &p) { m_sourceTopLeft = p; }
668
669private:
670 QImage m_image;
672 quint32 m_dataStride = 0;
673 QPoint m_destinationTopLeft;
674 QSize m_sourceSize;
675 QPoint m_sourceTopLeft;
676};
677
679
680class Q_GUI_EXPORT QRhiTextureUploadEntry
681{
682public:
685
686 int layer() const { return m_layer; }
687 void setLayer(int layer) { m_layer = layer; }
688
689 int level() const { return m_level; }
690 void setLevel(int level) { m_level = level; }
691
694
695private:
696 int m_layer = 0;
697 int m_level = 0;
699};
700
702
704{
705public:
708 QRhiTextureUploadDescription(std::initializer_list<QRhiTextureUploadEntry> list);
709
710 void setEntries(std::initializer_list<QRhiTextureUploadEntry> list) { m_entries = list; }
711 template<typename InputIterator>
712 void setEntries(InputIterator first, InputIterator last)
713 {
714 m_entries.clear();
715 std::copy(first, last, std::back_inserter(m_entries));
716 }
717 const QRhiTextureUploadEntry *cbeginEntries() const { return m_entries.cbegin(); }
718 const QRhiTextureUploadEntry *cendEntries() const { return m_entries.cend(); }
719 const QRhiTextureUploadEntry *entryAt(qsizetype index) const { return &m_entries.at(index); }
720 qsizetype entryCount() const { return m_entries.count(); }
721
722private:
724};
725
727{
728public:
730
731 QSize pixelSize() const { return m_pixelSize; }
732 void setPixelSize(const QSize &sz) { m_pixelSize = sz; }
733
734 int sourceLayer() const { return m_sourceLayer; }
735 void setSourceLayer(int layer) { m_sourceLayer = layer; }
736
737 int sourceLevel() const { return m_sourceLevel; }
738 void setSourceLevel(int level) { m_sourceLevel = level; }
739
740 QPoint sourceTopLeft() const { return m_sourceTopLeft; }
741 void setSourceTopLeft(const QPoint &p) { m_sourceTopLeft = p; }
742
743 int destinationLayer() const { return m_destinationLayer; }
744 void setDestinationLayer(int layer) { m_destinationLayer = layer; }
745
746 int destinationLevel() const { return m_destinationLevel; }
747 void setDestinationLevel(int level) { m_destinationLevel = level; }
748
749 QPoint destinationTopLeft() const { return m_destinationTopLeft; }
750 void setDestinationTopLeft(const QPoint &p) { m_destinationTopLeft = p; }
751
752private:
753 QSize m_pixelSize;
754 int m_sourceLayer = 0;
755 int m_sourceLevel = 0;
756 QPoint m_sourceTopLeft;
757 int m_destinationLayer = 0;
758 int m_destinationLevel = 0;
759 QPoint m_destinationTopLeft;
760};
761
763
764class Q_GUI_EXPORT QRhiReadbackDescription
765{
766public:
769
770 QRhiTexture *texture() const { return m_texture; }
771 void setTexture(QRhiTexture *tex) { m_texture = tex; }
772
773 int layer() const { return m_layer; }
774 void setLayer(int layer) { m_layer = layer; }
775
776 int level() const { return m_level; }
777 void setLevel(int level) { m_level = level; }
778
779private:
780 QRhiTexture *m_texture = nullptr;
781 int m_layer = 0;
782 int m_level = 0;
783};
784
786
787struct Q_GUI_EXPORT QRhiNativeHandles
788{
789};
790
791class Q_GUI_EXPORT QRhiResource
792{
793public:
794 enum Type {
806 CommandBuffer
807 };
808
809 virtual ~QRhiResource();
810
811 virtual Type resourceType() const = 0;
812
813 virtual void destroy() = 0;
814
815 void deleteLater();
816
817 QByteArray name() const;
818 void setName(const QByteArray &name);
819
820 quint64 globalResourceId() const;
821
822 QRhi *rhi() const;
823
824protected:
826 Q_DISABLE_COPY(QRhiResource)
827 friend class QRhiImplementation;
828 QRhiImplementation *m_rhi = nullptr;
830 QByteArray m_objectName;
831};
832
833class Q_GUI_EXPORT QRhiBuffer : public QRhiResource
834{
835public:
836 enum Type {
839 Dynamic
840 };
841
843 VertexBuffer = 1 << 0,
844 IndexBuffer = 1 << 1,
845 UniformBuffer = 1 << 2,
846 StorageBuffer = 1 << 3
847 };
848 Q_DECLARE_FLAGS(UsageFlags, UsageFlag)
849
851 const void *objects[3];
853 };
854
855 QRhiResource::Type resourceType() const override;
856
857 Type type() const { return m_type; }
858 void setType(Type t) { m_type = t; }
859
860 UsageFlags usage() const { return m_usage; }
861 void setUsage(UsageFlags u) { m_usage = u; }
862
863 quint32 size() const { return m_size; }
864 void setSize(quint32 sz) { m_size = sz; }
865
866 virtual bool create() = 0;
867
868 virtual NativeBuffer nativeBuffer();
869
870 virtual char *beginFullDynamicBufferUpdateForCurrentFrame();
871 virtual void endFullDynamicBufferUpdateForCurrentFrame();
872
873protected:
874 QRhiBuffer(QRhiImplementation *rhi, Type type_, UsageFlags usage_, quint32 size_);
876 UsageFlags m_usage;
878};
879
880Q_DECLARE_OPERATORS_FOR_FLAGS(QRhiBuffer::UsageFlags)
881
882class Q_GUI_EXPORT QRhiTexture : public QRhiResource
883{
884public:
885 enum Flag {
886 RenderTarget = 1 << 0,
887 CubeMap = 1 << 2,
888 MipMapped = 1 << 3,
889 sRGB = 1 << 4,
890 UsedAsTransferSource = 1 << 5,
891 UsedWithGenerateMips = 1 << 6,
892 UsedWithLoadStore = 1 << 7,
893 UsedAsCompressedAtlas = 1 << 8,
894 ExternalOES = 1 << 9,
895 ThreeDimensional = 1 << 10,
896 TextureRectangleGL = 1 << 11,
897 TextureArray = 1 << 12,
898 OneDimensional = 1 << 13
899 };
901
902 enum Format {
904
912
917
919
924
932
936
950 ASTC_12x12
951 };
952
955 int layout; // or state
956 };
957
958 QRhiResource::Type resourceType() const override;
959
960 Format format() const { return m_format; }
961 void setFormat(Format fmt) { m_format = fmt; }
962
963 QSize pixelSize() const { return m_pixelSize; }
964 void setPixelSize(const QSize &sz) { m_pixelSize = sz; }
965
966 int depth() const { return m_depth; }
967 void setDepth(int depth) { m_depth = depth; }
968
969 int arraySize() const { return m_arraySize; }
970 void setArraySize(int arraySize) { m_arraySize = arraySize; }
971
972 int arrayRangeStart() const { return m_arrayRangeStart; }
973 int arrayRangeLength() const { return m_arrayRangeLength; }
974 void setArrayRange(int startIndex, int count)
975 {
976 m_arrayRangeStart = startIndex;
977 m_arrayRangeLength = count;
978 }
979
980 Flags flags() const { return m_flags; }
981 void setFlags(Flags f) { m_flags = f; }
982
983 int sampleCount() const { return m_sampleCount; }
984 void setSampleCount(int s) { m_sampleCount = s; }
985
986 virtual bool create() = 0;
987 virtual NativeTexture nativeTexture();
988 virtual bool createFrom(NativeTexture src);
989 virtual void setNativeLayout(int layout);
990
991protected:
992 QRhiTexture(QRhiImplementation *rhi, Format format_, const QSize &pixelSize_, int depth_,
993 int arraySize_, int sampleCount_, Flags flags_);
1000 int m_arrayRangeStart = -1;
1001 int m_arrayRangeLength = -1;
1002};
1003
1004Q_DECLARE_OPERATORS_FOR_FLAGS(QRhiTexture::Flags)
1005
1006class Q_GUI_EXPORT QRhiSampler : public QRhiResource
1007{
1008public:
1009 enum Filter {
1012 Linear
1014
1019 };
1020
1029 Always
1031
1032 QRhiResource::Type resourceType() const override;
1033
1034 Filter magFilter() const { return m_magFilter; }
1035 void setMagFilter(Filter f) { m_magFilter = f; }
1036
1037 Filter minFilter() const { return m_minFilter; }
1038 void setMinFilter(Filter f) { m_minFilter = f; }
1039
1040 Filter mipmapMode() const { return m_mipmapMode; }
1041 void setMipmapMode(Filter f) { m_mipmapMode = f; }
1042
1043 AddressMode addressU() const { return m_addressU; }
1044 void setAddressU(AddressMode mode) { m_addressU = mode; }
1045
1046 AddressMode addressV() const { return m_addressV; }
1047 void setAddressV(AddressMode mode) { m_addressV = mode; }
1048
1049 AddressMode addressW() const { return m_addressW; }
1050 void setAddressW(AddressMode mode) { m_addressW = mode; }
1051
1052 CompareOp textureCompareOp() const { return m_compareOp; }
1053 void setTextureCompareOp(CompareOp op) { m_compareOp = op; }
1054
1055 virtual bool create() = 0;
1056
1057protected:
1059 Filter magFilter_, Filter minFilter_, Filter mipmapMode_,
1068};
1069
1070class Q_GUI_EXPORT QRhiRenderBuffer : public QRhiResource
1071{
1072public:
1073 enum Type {
1075 Color
1077
1078 enum Flag {
1079 UsedWithSwapChainOnly = 1 << 0
1081 Q_DECLARE_FLAGS(Flags, Flag)
1082
1085 };
1086
1087 QRhiResource::Type resourceType() const override;
1088
1089 Type type() const { return m_type; }
1090 void setType(Type t) { m_type = t; }
1091
1092 QSize pixelSize() const { return m_pixelSize; }
1093 void setPixelSize(const QSize &sz) { m_pixelSize = sz; }
1094
1095 int sampleCount() const { return m_sampleCount; }
1096 void setSampleCount(int s) { m_sampleCount = s; }
1097
1098 Flags flags() const { return m_flags; }
1099 void setFlags(Flags f) { m_flags = f; }
1100
1101 virtual bool create() = 0;
1102 virtual bool createFrom(NativeRenderBuffer src);
1103
1105
1106protected:
1107 QRhiRenderBuffer(QRhiImplementation *rhi, Type type_, const QSize &pixelSize_,
1108 int sampleCount_, Flags flags_, QRhiTexture::Format backingFormatHint_);
1114};
1115
1116Q_DECLARE_OPERATORS_FOR_FLAGS(QRhiRenderBuffer::Flags)
1117
1118class Q_GUI_EXPORT QRhiRenderPassDescriptor : public QRhiResource
1119{
1120public:
1121 QRhiResource::Type resourceType() const override;
1122
1123 virtual bool isCompatible(const QRhiRenderPassDescriptor *other) const = 0;
1124 virtual const QRhiNativeHandles *nativeHandles();
1125
1127
1129
1130protected:
1132};
1133
1134class Q_GUI_EXPORT QRhiRenderTarget : public QRhiResource
1135{
1136public:
1137 virtual QSize pixelSize() const = 0;
1138 virtual float devicePixelRatio() const = 0;
1139 virtual int sampleCount() const = 0;
1140
1141 QRhiRenderPassDescriptor *renderPassDescriptor() const { return m_renderPassDesc; }
1143
1144protected:
1146 QRhiRenderPassDescriptor *m_renderPassDesc = nullptr;
1147};
1148
1150{
1151public:
1152 QRhiResource::Type resourceType() const override;
1153 QRhiSwapChain *swapChain() const { return m_swapchain; }
1154
1155protected:
1158};
1159
1161{
1162public:
1163 enum Flag {
1164 PreserveColorContents = 1 << 0,
1165 PreserveDepthStencilContents = 1 << 1
1167 Q_DECLARE_FLAGS(Flags, Flag)
1168
1169 QRhiResource::Type resourceType() const override;
1170
1173
1174 Flags flags() const { return m_flags; }
1175 void setFlags(Flags f) { m_flags = f; }
1176
1178
1179 virtual bool create() = 0;
1180
1181protected:
1185};
1186
1187Q_DECLARE_OPERATORS_FOR_FLAGS(QRhiTextureRenderTarget::Flags)
1188
1189class Q_GUI_EXPORT QRhiShaderResourceBindings : public QRhiResource
1190{
1191public:
1192 QRhiResource::Type resourceType() const override;
1193
1194 void setBindings(std::initializer_list<QRhiShaderResourceBinding> list) { m_bindings = list; }
1195 template<typename InputIterator>
1196 void setBindings(InputIterator first, InputIterator last)
1197 {
1198 m_bindings.clear();
1199 std::copy(first, last, std::back_inserter(m_bindings));
1200 }
1201 const QRhiShaderResourceBinding *cbeginBindings() const { return m_bindings.cbegin(); }
1202 const QRhiShaderResourceBinding *cendBindings() const { return m_bindings.cend(); }
1203 const QRhiShaderResourceBinding *bindingAt(qsizetype index) const { return &m_bindings.at(index); }
1204 qsizetype bindingCount() const { return m_bindings.count(); }
1205
1206 bool isLayoutCompatible(const QRhiShaderResourceBindings *other) const;
1207
1208 QVector<quint32> serializedLayoutDescription() const { return m_layoutDesc; }
1209
1210 virtual bool create() = 0;
1211
1213 BindingsAreSorted = 0x01
1215 Q_DECLARE_FLAGS(UpdateFlags, UpdateFlag)
1216
1217 virtual void updateResources(UpdateFlags flags = {}) = 0;
1218
1219protected:
1220 static const int BINDING_PREALLOC = 12;
1223 size_t m_layoutDescHash = 0;
1224 // Intentionally not using QVLA for m_layoutDesc: clients like Qt Quick are much
1225 // better served with an implicitly shared container here, because they will likely
1226 // throw this directly into structs serving as cache keys.
1229#ifndef QT_NO_DEBUG_STREAM
1230 friend Q_GUI_EXPORT QDebug operator<<(QDebug, const QRhiShaderResourceBindings &);
1231#endif
1232};
1233
1234Q_DECLARE_OPERATORS_FOR_FLAGS(QRhiShaderResourceBindings::UpdateFlags)
1235
1236#ifndef QT_NO_DEBUG_STREAM
1237Q_GUI_EXPORT QDebug operator<<(QDebug, const QRhiShaderResourceBindings &);
1238#endif
1239
1240class Q_GUI_EXPORT QRhiGraphicsPipeline : public QRhiResource
1241{
1242public:
1243 enum Flag {
1244 UsesBlendConstants = 1 << 0,
1245 UsesStencilRef = 1 << 1,
1246 UsesScissor = 1 << 2,
1247 CompileShadersWithDebugInfo = 1 << 3
1249 Q_DECLARE_FLAGS(Flags, Flag)
1250
1258 Patches
1260
1264 Back
1266
1269 CW
1271
1273 R = 1 << 0,
1274 G = 1 << 1,
1275 B = 1 << 2,
1276 A = 1 << 3
1278 Q_DECLARE_FLAGS(ColorMask, ColorMaskComponent)
1279
1299 OneMinusSrc1Alpha
1301
1302 enum BlendOp {
1307 Max
1309
1311 ColorMask colorWrite = ColorMask(0xF); // R | G | B | A
1312 bool enable = false;
1313 BlendFactor srcColor = One;
1314 BlendFactor dstColor = OneMinusSrcAlpha;
1315 BlendOp opColor = Add;
1317 BlendFactor dstAlpha = OneMinusSrcAlpha;
1318 BlendOp opAlpha = Add;
1319 };
1320
1329 Always
1331
1340 DecrementAndWrap
1342
1344 StencilOp failOp = Keep;
1345 StencilOp depthFailOp = Keep;
1346 StencilOp passOp = Keep;
1347 CompareOp compareOp = Always;
1348 };
1349
1352 Line
1354
1355 QRhiResource::Type resourceType() const override;
1356
1357 Flags flags() const { return m_flags; }
1358 void setFlags(Flags f) { m_flags = f; }
1359
1360 Topology topology() const { return m_topology; }
1361 void setTopology(Topology t) { m_topology = t; }
1362
1363 CullMode cullMode() const { return m_cullMode; }
1364 void setCullMode(CullMode mode) { m_cullMode = mode; }
1365
1366 FrontFace frontFace() const { return m_frontFace; }
1367 void setFrontFace(FrontFace f) { m_frontFace = f; }
1368
1369 void setTargetBlends(std::initializer_list<TargetBlend> list) { m_targetBlends = list; }
1370 template<typename InputIterator>
1371 void setTargetBlends(InputIterator first, InputIterator last)
1372 {
1373 m_targetBlends.clear();
1374 std::copy(first, last, std::back_inserter(m_targetBlends));
1375 }
1376 const TargetBlend *cbeginTargetBlends() const { return m_targetBlends.cbegin(); }
1377 const TargetBlend *cendTargetBlends() const { return m_targetBlends.cend(); }
1378 const TargetBlend *targetBlendAt(qsizetype index) const { return &m_targetBlends.at(index); }
1379 qsizetype targetBlendCount() const { return m_targetBlends.count(); }
1380
1381 bool hasDepthTest() const { return m_depthTest; }
1382 void setDepthTest(bool enable) { m_depthTest = enable; }
1383
1384 bool hasDepthWrite() const { return m_depthWrite; }
1385 void setDepthWrite(bool enable) { m_depthWrite = enable; }
1386
1387 CompareOp depthOp() const { return m_depthOp; }
1388 void setDepthOp(CompareOp op) { m_depthOp = op; }
1389
1390 bool hasStencilTest() const { return m_stencilTest; }
1391 void setStencilTest(bool enable) { m_stencilTest = enable; }
1392
1393 StencilOpState stencilFront() const { return m_stencilFront; }
1394 void setStencilFront(const StencilOpState &state) { m_stencilFront = state; }
1395
1396 StencilOpState stencilBack() const { return m_stencilBack; }
1397 void setStencilBack(const StencilOpState &state) { m_stencilBack = state; }
1398
1399 quint32 stencilReadMask() const { return m_stencilReadMask; }
1400 void setStencilReadMask(quint32 mask) { m_stencilReadMask = mask; }
1401
1402 quint32 stencilWriteMask() const { return m_stencilWriteMask; }
1403 void setStencilWriteMask(quint32 mask) { m_stencilWriteMask = mask; }
1404
1405 int sampleCount() const { return m_sampleCount; }
1406 void setSampleCount(int s) { m_sampleCount = s; }
1407
1408 float lineWidth() const { return m_lineWidth; }
1409 void setLineWidth(float width) { m_lineWidth = width; }
1410
1411 int depthBias() const { return m_depthBias; }
1412 void setDepthBias(int bias) { m_depthBias = bias; }
1413
1414 float slopeScaledDepthBias() const { return m_slopeScaledDepthBias; }
1415 void setSlopeScaledDepthBias(float bias) { m_slopeScaledDepthBias = bias; }
1416
1417 void setShaderStages(std::initializer_list<QRhiShaderStage> list) { m_shaderStages = list; }
1418 template<typename InputIterator>
1419 void setShaderStages(InputIterator first, InputIterator last)
1420 {
1421 m_shaderStages.clear();
1422 std::copy(first, last, std::back_inserter(m_shaderStages));
1423 }
1424 const QRhiShaderStage *cbeginShaderStages() const { return m_shaderStages.cbegin(); }
1425 const QRhiShaderStage *cendShaderStages() const { return m_shaderStages.cend(); }
1426 const QRhiShaderStage *shaderStageAt(qsizetype index) const { return &m_shaderStages.at(index); }
1427 qsizetype shaderStageCount() const { return m_shaderStages.count(); }
1428
1429 QRhiVertexInputLayout vertexInputLayout() const { return m_vertexInputLayout; }
1430 void setVertexInputLayout(const QRhiVertexInputLayout &layout) { m_vertexInputLayout = layout; }
1431
1432 QRhiShaderResourceBindings *shaderResourceBindings() const { return m_shaderResourceBindings; }
1433 void setShaderResourceBindings(QRhiShaderResourceBindings *srb) { m_shaderResourceBindings = srb; }
1434
1435 QRhiRenderPassDescriptor *renderPassDescriptor() const { return m_renderPassDesc; }
1437
1438 int patchControlPointCount() const { return m_patchControlPointCount; }
1439 void setPatchControlPointCount(int count) { m_patchControlPointCount = count; }
1440
1441 PolygonMode polygonMode() const {return m_polygonMode; }
1442 void setPolygonMode(PolygonMode mode) {m_polygonMode = mode; }
1443
1444 int multiViewCount() const { return m_multiViewCount; }
1445 void setMultiViewCount(int count) { m_multiViewCount = count; }
1446
1447 virtual bool create() = 0;
1448
1449protected:
1452 Topology m_topology = Triangles;
1453 CullMode m_cullMode = None;
1454 FrontFace m_frontFace = CCW;
1456 bool m_depthTest = false;
1457 bool m_depthWrite = false;
1458 CompareOp m_depthOp = Less;
1459 bool m_stencilTest = false;
1462 quint32 m_stencilReadMask = 0xFF;
1463 quint32 m_stencilWriteMask = 0xFF;
1464 int m_sampleCount = 1;
1465 float m_lineWidth = 1.0f;
1466 int m_depthBias = 0;
1467 float m_slopeScaledDepthBias = 0.0f;
1468 int m_patchControlPointCount = 3;
1469 PolygonMode m_polygonMode = Fill;
1470 int m_multiViewCount = 0;
1473 QRhiShaderResourceBindings *m_shaderResourceBindings = nullptr;
1474 QRhiRenderPassDescriptor *m_renderPassDesc = nullptr;
1475};
1476
1477Q_DECLARE_OPERATORS_FOR_FLAGS(QRhiGraphicsPipeline::Flags)
1478Q_DECLARE_OPERATORS_FOR_FLAGS(QRhiGraphicsPipeline::ColorMask)
1480
1482{
1486 ColorComponentValue
1489 union {
1490 struct {
1493 } luminanceInNits;
1494 struct {
1497 } colorComponentValue;
1498 } limits;
1499};
1500
1502
1503#ifndef QT_NO_DEBUG_STREAM
1504Q_GUI_EXPORT QDebug operator<<(QDebug, const QRhiSwapChainHdrInfo &);
1505#endif
1506
1508{
1509 void *reserved[2] = {};
1510};
1511
1512class Q_GUI_EXPORT QRhiSwapChain : public QRhiResource
1513{
1514public:
1515 enum Flag {
1516 SurfaceHasPreMulAlpha = 1 << 0,
1517 SurfaceHasNonPreMulAlpha = 1 << 1,
1518 sRGB = 1 << 2,
1519 UsedAsTransferSource = 1 << 3,
1520 NoVSync = 1 << 4,
1521 MinimalBufferCount = 1 << 5
1523 Q_DECLARE_FLAGS(Flags, Flag)
1524
1525 enum Format {
1528 HDR10
1530
1533 RightBuffer
1535
1536 QRhiResource::Type resourceType() const override;
1537
1538 QWindow *window() const { return m_window; }
1539 void setWindow(QWindow *window) { m_window = window; }
1540
1541 QRhiSwapChainProxyData proxyData() const { return m_proxyData; }
1542 void setProxyData(const QRhiSwapChainProxyData &d) { m_proxyData = d; }
1543
1544 Flags flags() const { return m_flags; }
1545 void setFlags(Flags f) { m_flags = f; }
1546
1547 Format format() const { return m_format; }
1548 void setFormat(Format f) { m_format = f; }
1549
1550 QRhiRenderBuffer *depthStencil() const { return m_depthStencil; }
1551 void setDepthStencil(QRhiRenderBuffer *ds) { m_depthStencil = ds; }
1552
1553 int sampleCount() const { return m_sampleCount; }
1554 void setSampleCount(int samples) { m_sampleCount = samples; }
1555
1556 QRhiRenderPassDescriptor *renderPassDescriptor() const { return m_renderPassDesc; }
1558
1559 QSize currentPixelSize() const { return m_currentPixelSize; }
1560
1563 virtual QRhiRenderTarget *currentFrameRenderTarget(StereoTargetBuffer targetBuffer);
1565 virtual bool isFormatSupported(Format f) = 0;
1567 virtual bool createOrResize() = 0;
1568 virtual QRhiSwapChainHdrInfo hdrInfo();
1569
1570protected:
1572 QWindow *m_window = nullptr;
1574 Format m_format = SDR;
1575 QRhiRenderBuffer *m_depthStencil = nullptr;
1576 int m_sampleCount = 1;
1577 QRhiRenderPassDescriptor *m_renderPassDesc = nullptr;
1580};
1581
1582Q_DECLARE_OPERATORS_FOR_FLAGS(QRhiSwapChain::Flags)
1583
1584class Q_GUI_EXPORT QRhiComputePipeline : public QRhiResource
1585{
1586public:
1587 enum Flag {
1588 CompileShadersWithDebugInfo = 1 << 0
1590 Q_DECLARE_FLAGS(Flags, Flag)
1591
1592 QRhiResource::Type resourceType() const override;
1593 virtual bool create() = 0;
1594
1595 Flags flags() const { return m_flags; }
1596 void setFlags(Flags f) { m_flags = f; }
1597
1598 QRhiShaderStage shaderStage() const { return m_shaderStage; }
1599 void setShaderStage(const QRhiShaderStage &stage) { m_shaderStage = stage; }
1600
1601 QRhiShaderResourceBindings *shaderResourceBindings() const { return m_shaderResourceBindings; }
1602 void setShaderResourceBindings(QRhiShaderResourceBindings *srb) { m_shaderResourceBindings = srb; }
1603
1604protected:
1608 QRhiShaderResourceBindings *m_shaderResourceBindings = nullptr;
1609};
1610
1611Q_DECLARE_OPERATORS_FOR_FLAGS(QRhiComputePipeline::Flags)
1612
1613class Q_GUI_EXPORT QRhiCommandBuffer : public QRhiResource
1614{
1615public:
1618 IndexUInt32
1620
1622 ExternalContent = 0x01,
1623 DoNotTrackResourcesForCompute = 0x02
1625 Q_DECLARE_FLAGS(BeginPassFlags, BeginPassFlag)
1626
1627 QRhiResource::Type resourceType() const override;
1628
1629 void resourceUpdate(QRhiResourceUpdateBatch *resourceUpdates);
1630
1631 void beginPass(QRhiRenderTarget *rt,
1632 const QColor &colorClearValue,
1633 const QRhiDepthStencilClearValue &depthStencilClearValue,
1634 QRhiResourceUpdateBatch *resourceUpdates = nullptr,
1635 BeginPassFlags flags = {});
1636 void endPass(QRhiResourceUpdateBatch *resourceUpdates = nullptr);
1637
1638 void setGraphicsPipeline(QRhiGraphicsPipeline *ps);
1639 using DynamicOffset = QPair<int, quint32>; // binding, offset
1640 void setShaderResources(QRhiShaderResourceBindings *srb = nullptr,
1641 int dynamicOffsetCount = 0,
1642 const DynamicOffset *dynamicOffsets = nullptr);
1644 void setVertexInput(int startBinding, int bindingCount, const VertexInput *bindings,
1645 QRhiBuffer *indexBuf = nullptr, quint32 indexOffset = 0,
1646 IndexFormat indexFormat = IndexUInt16);
1647
1648 void setViewport(const QRhiViewport &viewport);
1649 void setScissor(const QRhiScissor &scissor);
1650 void setBlendConstants(const QColor &c);
1651 void setStencilRef(quint32 refValue);
1652
1653 void draw(quint32 vertexCount,
1655 quint32 firstVertex = 0,
1656 quint32 firstInstance = 0);
1657
1658 void drawIndexed(quint32 indexCount,
1660 quint32 firstIndex = 0,
1661 qint32 vertexOffset = 0,
1662 quint32 firstInstance = 0);
1663
1664 void debugMarkBegin(const QByteArray &name);
1665 void debugMarkEnd();
1666 void debugMarkMsg(const QByteArray &msg);
1667
1668 void beginComputePass(QRhiResourceUpdateBatch *resourceUpdates = nullptr, BeginPassFlags flags = {});
1669 void endComputePass(QRhiResourceUpdateBatch *resourceUpdates = nullptr);
1670 void setComputePipeline(QRhiComputePipeline *ps);
1671 void dispatch(int x, int y, int z);
1672
1673 const QRhiNativeHandles *nativeHandles();
1674 void beginExternal();
1675 void endExternal();
1676
1677 double lastCompletedGpuTime();
1678
1679protected:
1681};
1682
1683Q_DECLARE_OPERATORS_FOR_FLAGS(QRhiCommandBuffer::BeginPassFlags)
1684
1685struct Q_GUI_EXPORT QRhiReadbackResult
1686{
1687 std::function<void()> completed = nullptr;
1691};
1692
1693class Q_GUI_EXPORT QRhiResourceUpdateBatch
1694{
1695public:
1697
1698 void release();
1699
1700 void merge(QRhiResourceUpdateBatch *other);
1701 bool hasOptimalCapacity() const;
1702
1703 void updateDynamicBuffer(QRhiBuffer *buf, quint32 offset, quint32 size, const void *data);
1704 void uploadStaticBuffer(QRhiBuffer *buf, quint32 offset, quint32 size, const void *data);
1705 void uploadStaticBuffer(QRhiBuffer *buf, const void *data);
1707 void uploadTexture(QRhiTexture *tex, const QRhiTextureUploadDescription &desc);
1708 void uploadTexture(QRhiTexture *tex, const QImage &image);
1710 void readBackTexture(const QRhiReadbackDescription &rb, QRhiReadbackResult *result);
1711 void generateMips(QRhiTexture *tex);
1712
1713private:
1715 Q_DISABLE_COPY(QRhiResourceUpdateBatch)
1718 friend class QRhi;
1719};
1720
1721struct Q_GUI_EXPORT QRhiDriverInfo
1722{
1729 CpuDevice
1731
1733 quint64 deviceId = 0;
1734 quint64 vendorId = 0;
1735 DeviceType deviceType = UnknownDevice;
1736};
1737
1739
1740#ifndef QT_NO_DEBUG_STREAM
1741Q_GUI_EXPORT QDebug operator<<(QDebug, const QRhiDriverInfo &);
1742#endif
1743
1744struct Q_GUI_EXPORT QRhiStats
1745{
1746 qint64 totalPipelineCreationTime = 0;
1747 // Vulkan or D3D12 memory allocator statistics
1748 quint32 blockCount = 0;
1749 quint32 allocCount = 0;
1750 quint64 usedBytes = 0;
1751 quint64 unusedBytes = 0;
1752 // D3D12 only, from IDXGIAdapter3::QueryVideoMemoryInfo(), incl. all resources
1753 quint64 totalUsageBytes = 0;
1754};
1755
1757
1758#ifndef QT_NO_DEBUG_STREAM
1759Q_GUI_EXPORT QDebug operator<<(QDebug, const QRhiStats &);
1760#endif
1761
1762struct Q_GUI_EXPORT QRhiInitParams
1763{
1764};
1765
1766class Q_GUI_EXPORT QRhi
1767{
1768public:
1775 D3D12
1777
1778 enum Flag {
1779 EnableDebugMarkers = 1 << 0,
1780 PreferSoftwareRenderer = 1 << 1,
1781 EnablePipelineCacheDataSave = 1 << 2,
1782 EnableTimestamps = 1 << 3
1784 Q_DECLARE_FLAGS(Flags, Flag)
1785
1787 FrameOpSuccess = 0,
1790 FrameOpDeviceLost
1792
1793 enum Feature {
1794 MultisampleTexture = 1,
1834 MultiView
1836
1838 };
1839 Q_DECLARE_FLAGS(BeginFrameFlags, BeginFrameFlag)
1840
1842 SkipPresent = 1 << 0
1844 Q_DECLARE_FLAGS(EndFrameFlags, EndFrameFlag)
1845
1847 TextureSizeMin = 1,
1860 MaxVertexOutputs
1862
1863 ~QRhi();
1864
1865 static QRhi *create(Implementation impl,
1867 Flags flags = {},
1868 QRhiNativeHandles *importDevice = nullptr);
1869 static bool probe(Implementation impl, QRhiInitParams *params);
1870
1871 Implementation backend() const;
1872 const char *backendName() const;
1873 static const char *backendName(Implementation impl);
1874 QRhiDriverInfo driverInfo() const;
1875 QThread *thread() const;
1876
1877 using CleanupCallback = std::function<void(QRhi *)>;
1878 void addCleanupCallback(const CleanupCallback &callback);
1879 void runCleanup();
1880
1882 QRhiComputePipeline *newComputePipeline();
1883 QRhiShaderResourceBindings *newShaderResourceBindings();
1884
1885 QRhiBuffer *newBuffer(QRhiBuffer::Type type,
1886 QRhiBuffer::UsageFlags usage,
1887 quint32 size);
1888
1890 const QSize &pixelSize,
1891 int sampleCount = 1,
1892 QRhiRenderBuffer::Flags flags = {},
1894
1896 const QSize &pixelSize,
1897 int sampleCount = 1,
1898 QRhiTexture::Flags flags = {});
1899
1901 int width, int height, int depth,
1902 int sampleCount = 1,
1903 QRhiTexture::Flags flags = {});
1904
1905 QRhiTexture *newTextureArray(QRhiTexture::Format format,
1906 int arraySize,
1907 const QSize &pixelSize,
1908 int sampleCount = 1,
1909 QRhiTexture::Flags flags = {});
1910
1911 QRhiSampler *newSampler(QRhiSampler::Filter magFilter,
1912 QRhiSampler::Filter minFilter,
1913 QRhiSampler::Filter mipmapMode,
1914 QRhiSampler::AddressMode addressU,
1915 QRhiSampler::AddressMode addressV,
1917
1919 QRhiTextureRenderTarget::Flags flags = {});
1920
1921 QRhiSwapChain *newSwapChain();
1922 FrameOpResult beginFrame(QRhiSwapChain *swapChain, BeginFrameFlags flags = {});
1923 FrameOpResult endFrame(QRhiSwapChain *swapChain, EndFrameFlags flags = {});
1924 bool isRecordingFrame() const;
1925 int currentFrameSlot() const;
1926
1927 FrameOpResult beginOffscreenFrame(QRhiCommandBuffer **cb, BeginFrameFlags flags = {});
1928 FrameOpResult endOffscreenFrame(EndFrameFlags flags = {});
1929
1930 QRhi::FrameOpResult finish();
1931
1932 QRhiResourceUpdateBatch *nextResourceUpdateBatch();
1933
1934 QList<int> supportedSampleCounts() const;
1935
1936 int ubufAlignment() const;
1937 int ubufAligned(int v) const;
1938
1939 static int mipLevelsForSize(const QSize &size);
1940 static QSize sizeForMipLevel(int mipLevel, const QSize &baseLevelSize);
1941
1942 bool isYUpInFramebuffer() const;
1943 bool isYUpInNDC() const;
1944 bool isClipDepthZeroToOne() const;
1945
1946 QMatrix4x4 clipSpaceCorrMatrix() const;
1947
1948 bool isTextureFormatSupported(QRhiTexture::Format format, QRhiTexture::Flags flags = {}) const;
1949 bool isFeatureSupported(QRhi::Feature feature) const;
1950 int resourceLimit(ResourceLimit limit) const;
1951
1952 const QRhiNativeHandles *nativeHandles();
1953 bool makeThreadLocalNativeContextCurrent();
1954
1955 static const int MAX_MIP_LEVELS = 16; // -> max width or height is 65536
1956
1957 void releaseCachedResources();
1958
1959 bool isDeviceLost() const;
1960
1961 QByteArray pipelineCacheData();
1962 void setPipelineCacheData(const QByteArray &data);
1963
1964 QRhiStats statistics() const;
1965
1966 static QRhiSwapChainProxyData updateSwapChainProxyData(Implementation impl, QWindow *window);
1967
1968protected:
1969 QRhi();
1970
1971private:
1972 Q_DISABLE_COPY(QRhi)
1973 QRhiImplementation *d = nullptr;
1974};
1975
1977Q_DECLARE_OPERATORS_FOR_FLAGS(QRhi::BeginFrameFlags)
1978Q_DECLARE_OPERATORS_FOR_FLAGS(QRhi::EndFrameFlags)
1979
1981
1982#include <rhi/qrhi_platform.h>
1983
1984#endif
NSData * m_data
\inmodule QtCore
Definition qbytearray.h:57
The QColor class provides colors based on RGB, HSV or CMYK values.
Definition qcolor.h:31
\inmodule QtCore
\inmodule QtGui
Definition qimage.h:37
Definition qlist.h:74
The QMatrix4x4 class represents a 4x4 transformation matrix in 3D space.
Definition qmatrix4x4.h:25
\inmodule QtCore\reentrant
Definition qpoint.h:23
\inmodule QtGui
Definition qrhi.h:834
void setUsage(UsageFlags u)
Sets the buffer's usage flags to u.
Definition qrhi.h:861
UsageFlags m_usage
Definition qrhi.h:876
Type m_type
Definition qrhi.h:875
quint32 size() const
Definition qrhi.h:863
void setType(Type t)
Sets the buffer's type to t.
Definition qrhi.h:858
Type
Specifies storage type of buffer resource.
Definition qrhi.h:836
@ Immutable
Definition qrhi.h:837
@ Static
Definition qrhi.h:838
UsageFlags usage() const
Definition qrhi.h:860
UsageFlag
Flag values to specify how the buffer is going to be used.
Definition qrhi.h:842
Type type() const
Definition qrhi.h:857
void setSize(quint32 sz)
Sets the size of the buffer in bytes.
Definition qrhi.h:864
virtual bool create()=0
Creates the corresponding native graphics resources.
quint32 m_size
Definition qrhi.h:877
\inmodule QtGui
Definition qrhi.h:568
void setTexture(QRhiTexture *tex)
Sets the texture tex.
Definition qrhi.h:575
QRhiRenderBuffer * renderBuffer() const
Definition qrhi.h:577
int multiViewCount() const
Definition qrhi.h:595
QRhiColorAttachment()=default
Constructs an empty color attachment description.
int resolveLevel() const
Definition qrhi.h:592
QRhiTexture * texture() const
Definition qrhi.h:574
void setLevel(int level)
Sets the mip level.
Definition qrhi.h:584
void setRenderBuffer(QRhiRenderBuffer *rb)
Sets the renderbuffer rb.
Definition qrhi.h:578
int resolveLayer() const
Definition qrhi.h:589
QRhiTexture * resolveTexture() const
Definition qrhi.h:586
void setLayer(int layer)
Sets the layer index.
Definition qrhi.h:581
int level() const
Definition qrhi.h:583
void setResolveLayer(int layer)
Sets the resolve texture layer to use.
Definition qrhi.h:590
void setMultiViewCount(int count)
Sets the view count.
Definition qrhi.h:596
void setResolveLevel(int level)
Sets the resolve texture mip level to use.
Definition qrhi.h:593
void setResolveTexture(QRhiTexture *tex)
Sets the resolve texture tex.
Definition qrhi.h:587
int layer() const
Definition qrhi.h:580
\inmodule QtGui
Definition qrhi.h:1614
QPair< QRhiBuffer *, quint32 > VertexInput
Synonym for QPair<QRhiBuffer *, quint32>.
Definition qrhi.h:1643
BeginPassFlag
Flag values for QRhi::beginPass()
Definition qrhi.h:1621
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
Flags flags() const
Definition qrhi.h:1595
QRhiShaderStage m_shaderStage
Definition qrhi.h:1607
virtual bool create()=0
void setShaderStage(const QRhiShaderStage &stage)
Sets the shader to use.
Definition qrhi.h:1599
QRhiShaderResourceBindings * shaderResourceBindings() const
Definition qrhi.h:1601
QRhiShaderStage shaderStage() const
Definition qrhi.h:1598
Flag
Flag values for describing pipeline options.
Definition qrhi.h:1587
void setFlags(Flags f)
Sets the flags f.
Definition qrhi.h:1596
void setShaderResourceBindings(QRhiShaderResourceBindings *srb)
Associates with srb describing the resource binding layout and the resources (QRhiBuffer,...
Definition qrhi.h:1602
\inmodule QtGui
Definition qrhi.h:44
friend bool operator!=(const QRhiDepthStencilClearValue &a, const QRhiDepthStencilClearValue &b) noexcept
Definition qrhi.h:64
friend size_t qHash(const QRhiDepthStencilClearValue &v, size_t seed=0) noexcept
Definition qrhi.h:69
void setDepthClearValue(float d)
Sets the depth clear value to d.
Definition qrhi.h:50
friend bool operator==(const QRhiDepthStencilClearValue &a, const QRhiDepthStencilClearValue &b) noexcept
Definition qrhi.h:59
float depthClearValue() const
Definition qrhi.h:49
quint32 stencilClearValue() const
Definition qrhi.h:52
QRhiDepthStencilClearValue()=default
Constructs a depth/stencil clear value with depth clear value 1.0f and stencil clear value 0.
void setStencilClearValue(quint32 s)
Sets the stencil clear value to s.
Definition qrhi.h:53
\inmodule QtGui
Definition qrhi.h:1241
Flag
Flag values for describing the dynamic state of the pipeline, and other options.
Definition qrhi.h:1243
BlendOp
Specifies the blend operation.
Definition qrhi.h:1302
void setStencilFront(const StencilOpState &state)
Sets the stencil test state for front faces.
Definition qrhi.h:1394
void setCullMode(CullMode mode)
Sets the specified face culling mode.
Definition qrhi.h:1364
void setFrontFace(FrontFace f)
Sets the front face mode f.
Definition qrhi.h:1367
StencilOpState stencilBack() const
Definition qrhi.h:1396
PolygonMode
Specifies the polygon rasterization mode.
Definition qrhi.h:1350
const QRhiShaderStage * cendShaderStages() const
Definition qrhi.h:1425
void setTargetBlends(std::initializer_list< TargetBlend > list)
Sets the list of render target blend settings.
Definition qrhi.h:1369
FrontFace
Specifies the front face winding order.
Definition qrhi.h:1267
void setStencilTest(bool enable)
Enables or disables stencil tests based on enable.
Definition qrhi.h:1391
const TargetBlend * cendTargetBlends() const
Definition qrhi.h:1377
BlendFactor
Specifies the blend factor.
Definition qrhi.h:1280
StencilOpState m_stencilFront
Definition qrhi.h:1460
void setDepthWrite(bool enable)
Controls the writing out of depth data into the depth buffer based on enable.
Definition qrhi.h:1385
bool hasDepthWrite() const
Definition qrhi.h:1384
void setShaderResourceBindings(QRhiShaderResourceBindings *srb)
Associates with srb describing the resource binding layout and the resources (QRhiBuffer,...
Definition qrhi.h:1433
QRhiShaderResourceBindings * shaderResourceBindings() const
Definition qrhi.h:1432
void setDepthOp(CompareOp op)
Sets the depth comparison function op.
Definition qrhi.h:1388
CompareOp
Specifies the depth or stencil comparison function.
Definition qrhi.h:1321
int patchControlPointCount() const
Definition qrhi.h:1438
void setSlopeScaledDepthBias(float bias)
Sets the slope scaled depth bias.
Definition qrhi.h:1415
void setVertexInputLayout(const QRhiVertexInputLayout &layout)
Specifies the vertex input layout.
Definition qrhi.h:1430
const TargetBlend * cbeginTargetBlends() const
Definition qrhi.h:1376
CullMode
Specifies the culling mode.
Definition qrhi.h:1261
void setStencilReadMask(quint32 mask)
Sets the stencil read mask.
Definition qrhi.h:1400
QVarLengthArray< QRhiShaderStage, 4 > m_shaderStages
Definition qrhi.h:1471
Flags flags() const
Definition qrhi.h:1357
bool hasDepthTest() const
Definition qrhi.h:1381
void setFlags(Flags f)
Sets the flags f.
Definition qrhi.h:1358
void setShaderStages(std::initializer_list< QRhiShaderStage > list)
Sets the list of shader stages.
Definition qrhi.h:1417
QRhiVertexInputLayout m_vertexInputLayout
Definition qrhi.h:1472
bool hasStencilTest() const
Definition qrhi.h:1390
QRhiRenderPassDescriptor * renderPassDescriptor() const
Definition qrhi.h:1435
QVarLengthArray< TargetBlend, 8 > m_targetBlends
Definition qrhi.h:1455
void setRenderPassDescriptor(QRhiRenderPassDescriptor *desc)
Associates with the specified QRhiRenderPassDescriptor desc.
Definition qrhi.h:1436
int depthBias() const
Definition qrhi.h:1411
const QRhiShaderStage * shaderStageAt(qsizetype index) const
Definition qrhi.h:1426
void setSampleCount(int s)
Sets the sample count.
Definition qrhi.h:1406
FrontFace frontFace() const
Definition qrhi.h:1366
void setShaderStages(InputIterator first, InputIterator last)
Sets the list of shader stages from the iterators first and last.
Definition qrhi.h:1419
void setTopology(Topology t)
Sets the primitive topology t.
Definition qrhi.h:1361
quint32 stencilWriteMask() const
Definition qrhi.h:1402
void setTargetBlends(InputIterator first, InputIterator last)
Sets the list of render target blend settings from the iterators first and last.
Definition qrhi.h:1371
void setMultiViewCount(int count)
Sets the view count for multiview rendering.
Definition qrhi.h:1445
QRhiVertexInputLayout vertexInputLayout() const
Definition qrhi.h:1429
CullMode cullMode() const
Definition qrhi.h:1363
void setPatchControlPointCount(int count)
Sets the number of patch control points to count.
Definition qrhi.h:1439
Topology
Specifies the primitive topology.
Definition qrhi.h:1251
CompareOp depthOp() const
Definition qrhi.h:1387
StencilOpState m_stencilBack
Definition qrhi.h:1461
int sampleCount() const
Definition qrhi.h:1405
quint32 stencilReadMask() const
Definition qrhi.h:1399
const TargetBlend * targetBlendAt(qsizetype index) const
Definition qrhi.h:1378
float lineWidth() const
Definition qrhi.h:1408
virtual bool create()=0
Creates the corresponding native graphics resources.
PolygonMode polygonMode() const
Definition qrhi.h:1441
qsizetype shaderStageCount() const
Definition qrhi.h:1427
void setDepthTest(bool enable)
Enables or disables depth testing based on enable.
Definition qrhi.h:1382
void setDepthBias(int bias)
Sets the depth bias.
Definition qrhi.h:1412
void setPolygonMode(PolygonMode mode)
Sets the polygon mode.
Definition qrhi.h:1442
ColorMaskComponent
Flag values for specifying the color write mask.
Definition qrhi.h:1272
StencilOp
Specifies the stencil operation.
Definition qrhi.h:1332
float slopeScaledDepthBias() const
Definition qrhi.h:1414
void setLineWidth(float width)
Sets the line width.
Definition qrhi.h:1409
StencilOpState stencilFront() const
Definition qrhi.h:1393
void setStencilWriteMask(quint32 mask)
Sets the stencil write mask.
Definition qrhi.h:1403
int multiViewCount() const
Definition qrhi.h:1444
Topology topology() const
Definition qrhi.h:1360
const QRhiShaderStage * cbeginShaderStages() const
Definition qrhi.h:1424
qsizetype targetBlendCount() const
Definition qrhi.h:1379
void setStencilBack(const StencilOpState &state)
Sets the stencil test state for back faces.
Definition qrhi.h:1397
\inmodule QtGui
Definition qrhi.h:765
QRhiReadbackDescription()=default
Constructs an empty texture readback description.
int layer() const
Definition qrhi.h:773
QRhiTexture * texture() const
Definition qrhi.h:770
void setLayer(int layer)
Sets the array layer to read back.
Definition qrhi.h:774
void setLevel(int level)
Sets the mip level to read back.
Definition qrhi.h:777
void setTexture(QRhiTexture *tex)
Sets the texture tex as the source of the readback operation.
Definition qrhi.h:771
int level() const
Definition qrhi.h:776
\inmodule QtGui
Definition qrhi.h:1071
Flags flags() const
Definition qrhi.h:1098
void setPixelSize(const QSize &sz)
Sets the size (in pixels) to sz.
Definition qrhi.h:1093
QSize pixelSize() const
Definition qrhi.h:1092
void setFlags(Flags f)
Sets the flags to f.
Definition qrhi.h:1099
virtual QRhiTexture::Format backingFormat() const =0
void setType(Type t)
Sets the type to t.
Definition qrhi.h:1090
int sampleCount() const
Definition qrhi.h:1095
int m_sampleCount
Definition qrhi.h:1111
QRhiTexture::Format m_backingFormatHint
Definition qrhi.h:1113
QSize m_pixelSize
Definition qrhi.h:1110
void setSampleCount(int s)
Sets the sample count to s.
Definition qrhi.h:1096
Type
Specifies the type of the renderbuffer.
Definition qrhi.h:1073
virtual bool create()=0
Creates the corresponding native graphics resources.
Flag
\variable QRhiRenderBuffer::NativeRenderBuffer::object
Definition qrhi.h:1078
Flags m_flags
Definition qrhi.h:1112
Type type() const
Definition qrhi.h:1089
\inmodule QtGui
Definition qrhi.h:1119
virtual QRhiRenderPassDescriptor * newCompatibleRenderPassDescriptor() const =0
virtual bool isCompatible(const QRhiRenderPassDescriptor *other) const =0
virtual QVector< quint32 > serializedFormat() const =0
\inmodule QtGui
Definition qrhi.h:1135
void setRenderPassDescriptor(QRhiRenderPassDescriptor *desc)
Sets the QRhiRenderPassDescriptor desc for use with this render target.
Definition qrhi.h:1142
virtual QSize pixelSize() const =0
QRhiRenderPassDescriptor * renderPassDescriptor() const
Definition qrhi.h:1141
virtual int sampleCount() const =0
virtual float devicePixelRatio() const =0
\inmodule QtGui
Definition qrhi.h:1694
\inmodule QtGui
Definition qrhi.h:792
Type
Specifies type of the resource.
Definition qrhi.h:794
@ RenderBuffer
Definition qrhi.h:798
@ RenderPassDescriptor
Definition qrhi.h:799
@ SwapChain
Definition qrhi.h:804
@ ComputePipeline
Definition qrhi.h:805
@ SwapChainRenderTarget
Definition qrhi.h:800
@ GraphicsPipeline
Definition qrhi.h:803
@ TextureRenderTarget
Definition qrhi.h:801
@ ShaderResourceBindings
Definition qrhi.h:802
virtual void destroy()=0
Releases (or requests deferred releasing of) the underlying native graphics resources.
virtual Type resourceType() const =0
\inmodule QtGui
Definition qrhi.h:1007
AddressMode addressV() const
Definition qrhi.h:1046
void setMipmapMode(Filter f)
Sets the mipmap filter mode to f.
Definition qrhi.h:1041
void setAddressW(AddressMode mode)
Sets the depth wrap mode.
Definition qrhi.h:1050
virtual bool create()=0
Filter m_minFilter
Definition qrhi.h:1062
Filter
Specifies the minification, magnification, or mipmap filtering.
Definition qrhi.h:1009
AddressMode m_addressV
Definition qrhi.h:1065
Filter magFilter() const
Definition qrhi.h:1034
Filter m_mipmapMode
Definition qrhi.h:1063
AddressMode m_addressU
Definition qrhi.h:1064
AddressMode
Specifies the addressing mode.
Definition qrhi.h:1015
@ ClampToEdge
Definition qrhi.h:1017
void setMinFilter(Filter f)
Sets the minification filter mode to f.
Definition qrhi.h:1038
CompareOp
Specifies the texture comparison function.
Definition qrhi.h:1021
@ LessOrEqual
Definition qrhi.h:1025
@ GreaterOrEqual
Definition qrhi.h:1028
Filter minFilter() const
Definition qrhi.h:1037
Filter mipmapMode() const
Definition qrhi.h:1040
AddressMode addressW() const
Definition qrhi.h:1049
void setTextureCompareOp(CompareOp op)
Sets the texture comparison function op.
Definition qrhi.h:1053
CompareOp m_compareOp
Definition qrhi.h:1067
void setAddressU(AddressMode mode)
Sets the horizontal wrap mode.
Definition qrhi.h:1044
AddressMode addressU() const
Definition qrhi.h:1043
AddressMode m_addressW
Definition qrhi.h:1066
CompareOp textureCompareOp() const
Definition qrhi.h:1052
void setAddressV(AddressMode mode)
Sets the vertical wrap mode.
Definition qrhi.h:1047
Filter m_magFilter
Definition qrhi.h:1061
void setMagFilter(Filter f)
Sets the magnification filter mode to f.
Definition qrhi.h:1035
\inmodule QtGui
Definition qrhi.h:138
friend size_t qHash(const QRhiScissor &v, size_t seed=0) noexcept
Definition qrhi.h:161
void setScissor(int x, int y, int w, int h)
Sets the scissor position and size to x, y, w, h.
Definition qrhi.h:144
std::array< int, 4 > scissor() const
Definition qrhi.h:143
friend bool operator==(const QRhiScissor &a, const QRhiScissor &b) noexcept
Definition qrhi.h:151
friend bool operator!=(const QRhiScissor &a, const QRhiScissor &b) noexcept
Definition qrhi.h:156
QRhiScissor()=default
Constructs an empty scissor.
\inmodule QtGui
Definition qrhi.h:431
Type
Specifies type of the shader resource bound to a binding point.
Definition qrhi.h:433
static void serializeLayoutDescription(const QRhiShaderResourceBinding *first, const QRhiShaderResourceBinding *last, Output dst)
Definition qrhi.h:541
StageFlag
Flag values to indicate which stages the shader resource is visible in.
Definition qrhi.h:446
\inmodule QtGui
Definition qrhi.h:1190
void setBindings(InputIterator first, InputIterator last)
Sets the list of bindings from the iterators first and last.
Definition qrhi.h:1196
QVarLengthArray< QRhiShaderResourceBinding, BINDING_PREALLOC > m_bindings
Definition qrhi.h:1222
const QRhiShaderResourceBinding * cbeginBindings() const
Definition qrhi.h:1201
void setBindings(std::initializer_list< QRhiShaderResourceBinding > list)
Sets the list of bindings.
Definition qrhi.h:1194
QVector< quint32 > serializedLayoutDescription() const
Definition qrhi.h:1208
const QRhiShaderResourceBinding * bindingAt(qsizetype index) const
Definition qrhi.h:1203
virtual bool create()=0
qsizetype bindingCount() const
Definition qrhi.h:1204
QVector< quint32 > m_layoutDesc
Definition qrhi.h:1227
const QRhiShaderResourceBinding * cendBindings() const
Definition qrhi.h:1202
\inmodule QtGui
Definition qrhi.h:371
void setShaderVariant(QShader::Variant v)
Sets the requested shader variant v.
Definition qrhi.h:393
void setShader(const QShader &s)
Sets the shader collection s.
Definition qrhi.h:390
QRhiShaderStage()=default
Constructs a shader stage description for the vertex stage with an empty QShader.
QShader::Variant shaderVariant() const
Definition qrhi.h:392
QShader shader() const
Definition qrhi.h:389
@ TessellationControl
Definition qrhi.h:375
@ TessellationEvaluation
Definition qrhi.h:376
Type type() const
Definition qrhi.h:386
friend bool operator!=(const QRhiShaderStage &a, const QRhiShaderStage &b) noexcept
Definition qrhi.h:407
friend bool operator==(const QRhiShaderStage &a, const QRhiShaderStage &b) noexcept
Definition qrhi.h:400
friend size_t qHash(const QRhiShaderStage &v, size_t seed=0) noexcept
Definition qrhi.h:412
void setType(Type t)
Sets the type of the stage to t.
Definition qrhi.h:387
\inmodule QtGui
Definition qrhi.h:1150
QRhiSwapChain * swapChain() const
Definition qrhi.h:1153
QRhiSwapChain * m_swapchain
Definition qrhi.h:1157
\inmodule QtGui
Definition qrhi.h:1513
QSize currentPixelSize() const
Definition qrhi.h:1559
void setDepthStencil(QRhiRenderBuffer *ds)
Sets the renderbuffer ds for use as a depth-stencil buffer.
Definition qrhi.h:1551
int sampleCount() const
Definition qrhi.h:1553
virtual QRhiRenderPassDescriptor * newCompatibleRenderPassDescriptor()=0
Format format() const
Definition qrhi.h:1547
QRhiSwapChainProxyData m_proxyData
Definition qrhi.h:1579
virtual bool createOrResize()=0
Creates the swapchain if not already done and resizes the swapchain buffers to match the current size...
virtual QRhiRenderTarget * currentFrameRenderTarget()=0
virtual QSize surfacePixelSize()=0
QRhiSwapChainProxyData proxyData() const
Definition qrhi.h:1541
Flag
Flag values to describe swapchain properties.
Definition qrhi.h:1515
void setSampleCount(int samples)
Sets the sample count.
Definition qrhi.h:1554
QSize m_currentPixelSize
Definition qrhi.h:1578
Flags flags() const
Definition qrhi.h:1544
void setFlags(Flags f)
Sets the flags f.
Definition qrhi.h:1545
Flags m_flags
Definition qrhi.h:1573
QRhiRenderPassDescriptor * renderPassDescriptor() const
Definition qrhi.h:1556
Format
Describes the swapchain format.
Definition qrhi.h:1525
@ HDRExtendedSrgbLinear
Definition qrhi.h:1527
void setWindow(QWindow *window)
Sets the window.
Definition qrhi.h:1539
StereoTargetBuffer
Selects the backbuffer to use with a stereoscopic swapchain.
Definition qrhi.h:1531
virtual bool isFormatSupported(Format f)=0
void setProxyData(const QRhiSwapChainProxyData &d)
Sets the proxy data d.
Definition qrhi.h:1542
virtual QRhiCommandBuffer * currentFrameCommandBuffer()=0
QRhiRenderBuffer * depthStencil() const
Definition qrhi.h:1550
QWindow * window() const
Definition qrhi.h:1538
void setFormat(Format f)
Sets the format f.
Definition qrhi.h:1548
void setRenderPassDescriptor(QRhiRenderPassDescriptor *desc)
Associates with the QRhiRenderPassDescriptor desc.
Definition qrhi.h:1557
\inmodule QtGui
Definition qrhi.h:727
void setSourceLevel(int level)
Sets the source mip level.
Definition qrhi.h:738
QPoint destinationTopLeft() const
Definition qrhi.h:749
QPoint sourceTopLeft() const
Definition qrhi.h:740
void setPixelSize(const QSize &sz)
Sets the size of the region to copy to sz.
Definition qrhi.h:732
void setDestinationLevel(int level)
Sets the destination mip level.
Definition qrhi.h:747
void setDestinationTopLeft(const QPoint &p)
Sets the destination top-left position p.
Definition qrhi.h:750
int destinationLevel() const
Definition qrhi.h:746
int sourceLevel() const
Definition qrhi.h:737
QSize pixelSize() const
Definition qrhi.h:731
void setDestinationLayer(int layer)
Sets the destination array layer.
Definition qrhi.h:744
int sourceLayer() const
Definition qrhi.h:734
void setSourceTopLeft(const QPoint &p)
Sets the source top-left position to p.
Definition qrhi.h:741
int destinationLayer() const
Definition qrhi.h:743
void setSourceLayer(int layer)
Sets the source array layer.
Definition qrhi.h:735
QRhiTextureCopyDescription()=default
Constructs an empty texture copy description.
const QRhiColorAttachment * cbeginColorAttachments() const
Definition qrhi.h:626
void setDepthTexture(QRhiTexture *texture)
Sets the texture for depth-stencil.
Definition qrhi.h:635
QRhiTexture * depthTexture() const
Definition qrhi.h:634
void setDepthStencilBuffer(QRhiRenderBuffer *renderBuffer)
Sets the renderBuffer for depth-stencil.
Definition qrhi.h:632
const QRhiColorAttachment * cendColorAttachments() const
Definition qrhi.h:627
QRhiRenderBuffer * depthStencilBuffer() const
Definition qrhi.h:631
void setColorAttachments(std::initializer_list< QRhiColorAttachment > list)
Sets the list of color attachments.
Definition qrhi.h:619
const QRhiColorAttachment * colorAttachmentAt(qsizetype index) const
Definition qrhi.h:628
void setColorAttachments(InputIterator first, InputIterator last)
Sets the list of color attachments via the iterators first and last.
Definition qrhi.h:621
qsizetype colorAttachmentCount() const
Definition qrhi.h:629
QRhiTextureRenderTargetDescription()=default
Constructs an empty texture render target description.
\inmodule QtGui
Definition qrhi.h:1161
void setDescription(const QRhiTextureRenderTargetDescription &desc)
Sets the render target description desc.
Definition qrhi.h:1172
Flags flags() const
Definition qrhi.h:1174
void setFlags(Flags f)
Sets the flags to f.
Definition qrhi.h:1175
QRhiTextureRenderTargetDescription m_desc
Definition qrhi.h:1183
virtual QRhiRenderPassDescriptor * newCompatibleRenderPassDescriptor()=0
Flag
Flag values describing the load/store behavior for the render target.
Definition qrhi.h:1163
virtual bool create()=0
Creates the corresponding native graphics resources.
QRhiTextureRenderTargetDescription description() const
Definition qrhi.h:1171
void setSourceTopLeft(const QPoint &p)
Sets the source top-left position p.
Definition qrhi.h:667
QRhiTextureSubresourceUploadDescription()=default
Constructs an empty subresource description.
void setDataStride(quint32 stride)
Sets the data stride in bytes.
Definition qrhi.h:658
void setDestinationTopLeft(const QPoint &p)
Sets the destination top-left position p.
Definition qrhi.h:661
void setData(const QByteArray &data)
Sets data.
Definition qrhi.h:655
void setSourceSize(const QSize &size)
Sets the source size in pixels.
Definition qrhi.h:664
void setImage(const QImage &image)
Sets image.
Definition qrhi.h:652
\inmodule QtGui
Definition qrhi.h:704
const QRhiTextureUploadEntry * cendEntries() const
Definition qrhi.h:718
const QRhiTextureUploadEntry * cbeginEntries() const
Definition qrhi.h:717
QRhiTextureUploadDescription()=default
Constructs an empty texture upload description.
void setEntries(std::initializer_list< QRhiTextureUploadEntry > list)
Sets the list of entries.
Definition qrhi.h:710
const QRhiTextureUploadEntry * entryAt(qsizetype index) const
Definition qrhi.h:719
void setEntries(InputIterator first, InputIterator last)
Sets the list of entries using the iterators first and last.
Definition qrhi.h:712
qsizetype entryCount() const
Definition qrhi.h:720
\inmodule QtGui
Definition qrhi.h:681
void setLevel(int level)
Sets the mip level.
Definition qrhi.h:690
void setDescription(const QRhiTextureSubresourceUploadDescription &desc)
Sets the subresource description desc.
Definition qrhi.h:693
QRhiTextureSubresourceUploadDescription description() const
Definition qrhi.h:692
int layer() const
Definition qrhi.h:686
void setLayer(int layer)
Sets the layer.
Definition qrhi.h:687
int level() const
Definition qrhi.h:689
QRhiTextureUploadEntry()=default
Constructs an empty QRhiTextureUploadEntry targeting layer 0 and level 0.
\inmodule QtGui
Definition qrhi.h:883
QSize m_pixelSize
Definition qrhi.h:995
int m_arraySize
Definition qrhi.h:997
int m_depth
Definition qrhi.h:996
Format format() const
Definition qrhi.h:960
void setArrayRange(int startIndex, int count)
Normally all array layers are exposed and it is up to the shader to select the layer via the third co...
Definition qrhi.h:974
int arraySize() const
Definition qrhi.h:969
void setFormat(Format fmt)
Sets the requested texture format to fmt.
Definition qrhi.h:961
int depth() const
Definition qrhi.h:966
void setFlags(Flags f)
Sets the texture flags to f.
Definition qrhi.h:981
Flag
Flag values to specify how the texture is going to be used.
Definition qrhi.h:885
int arrayRangeStart() const
Definition qrhi.h:972
void setDepth(int depth)
Sets the depth for a 3D texture.
Definition qrhi.h:967
int sampleCount() const
Definition qrhi.h:983
virtual bool create()=0
Creates the corresponding native graphics resources.
Format
Specifies the texture format.
Definition qrhi.h:902
@ ASTC_10x8
Definition qrhi.h:947
@ ASTC_8x5
Definition qrhi.h:942
@ ASTC_10x5
Definition qrhi.h:945
@ RGBA32F
Definition qrhi.h:914
@ ETC2_RGBA8
Definition qrhi.h:935
@ ASTC_5x5
Definition qrhi.h:939
@ ASTC_4x4
Definition qrhi.h:937
@ ASTC_6x6
Definition qrhi.h:941
@ ASTC_12x10
Definition qrhi.h:949
@ ETC2_RGB8
Definition qrhi.h:933
@ ASTC_5x4
Definition qrhi.h:938
@ RED_OR_ALPHA8
Definition qrhi.h:911
@ ASTC_6x5
Definition qrhi.h:940
@ ASTC_8x8
Definition qrhi.h:944
@ RGBA16F
Definition qrhi.h:913
@ RGB10A2
Definition qrhi.h:918
@ ASTC_10x6
Definition qrhi.h:946
@ ASTC_10x10
Definition qrhi.h:948
@ UnknownFormat
Definition qrhi.h:903
@ ETC2_RGB8A1
Definition qrhi.h:934
@ ASTC_8x6
Definition qrhi.h:943
Flags flags() const
Definition qrhi.h:980
void setArraySize(int arraySize)
Sets the texture arraySize.
Definition qrhi.h:970
void setSampleCount(int s)
Sets the sample count to s.
Definition qrhi.h:984
QSize pixelSize() const
Definition qrhi.h:963
Format m_format
Definition qrhi.h:994
Flags m_flags
Definition qrhi.h:999
int m_sampleCount
Definition qrhi.h:998
void setPixelSize(const QSize &sz)
Sets the texture size, specified in pixels, to sz.
Definition qrhi.h:964
int arrayRangeLength() const
Definition qrhi.h:973
\inmodule QtGui
Definition qrhi.h:232
int binding() const
Definition qrhi.h:259
void setMatrixSlice(int slice)
Sets the matrix slice.
Definition qrhi.h:272
int matrixSlice() const
Definition qrhi.h:271
friend size_t qHash(const QRhiVertexInputAttribute &v, size_t seed=0) noexcept
Definition qrhi.h:295
void setLocation(int loc)
Sets the location of the vertex input element to loc.
Definition qrhi.h:263
friend bool operator!=(const QRhiVertexInputAttribute &a, const QRhiVertexInputAttribute &b) noexcept
Definition qrhi.h:290
QRhiVertexInputAttribute()=default
Constructs a default vertex input attribute description.
void setFormat(Format f)
Sets the format of the vertex input element to f.
Definition qrhi.h:266
void setBinding(int b)
Sets the binding point index to b.
Definition qrhi.h:260
Format
Specifies the type of the element data.
Definition qrhi.h:234
Format format() const
Definition qrhi.h:265
quint32 offset() const
Definition qrhi.h:268
void setOffset(quint32 ofs)
Sets the byte offset for the input element to ofs.
Definition qrhi.h:269
friend bool operator==(const QRhiVertexInputAttribute &a, const QRhiVertexInputAttribute &b) noexcept
Definition qrhi.h:281
int location() const
Definition qrhi.h:262
\inmodule QtGui
Definition qrhi.h:179
void setInstanceStepRate(quint32 rate)
Sets the instance step rate.
Definition qrhi.h:196
void setClassification(Classification c)
Sets the input data classification c.
Definition qrhi.h:193
friend bool operator!=(const QRhiVertexInputBinding &a, const QRhiVertexInputBinding &b) noexcept
Definition qrhi.h:210
void setStride(quint32 s)
Sets the stride to s.
Definition qrhi.h:190
Classification
Describes the input data classification.
Definition qrhi.h:181
quint32 instanceStepRate() const
Definition qrhi.h:195
QRhiVertexInputBinding()=default
Constructs a default vertex input binding description.
friend bool operator==(const QRhiVertexInputBinding &a, const QRhiVertexInputBinding &b) noexcept
Definition qrhi.h:203
Classification classification() const
Definition qrhi.h:192
quint32 stride() const
Definition qrhi.h:189
friend size_t qHash(const QRhiVertexInputBinding &v, size_t seed=0) noexcept
Definition qrhi.h:215
\inmodule QtGui
Definition qrhi.h:313
QRhiVertexInputLayout()=default
Constructs an empty vertex input layout description.
const QRhiVertexInputBinding * bindingAt(qsizetype index) const
Definition qrhi.h:326
const QRhiVertexInputAttribute * cendAttributes() const
Definition qrhi.h:337
friend size_t qHash(const QRhiVertexInputLayout &v, size_t seed=0) noexcept
Definition qrhi.h:355
void setBindings(std::initializer_list< QRhiVertexInputBinding > list)
Sets the bindings from the specified list.
Definition qrhi.h:317
const QRhiVertexInputBinding * cendBindings() const
Definition qrhi.h:325
friend bool operator==(const QRhiVertexInputLayout &a, const QRhiVertexInputLayout &b) noexcept
Definition qrhi.h:345
void setAttributes(std::initializer_list< QRhiVertexInputAttribute > list)
Sets the attributes from the specified list.
Definition qrhi.h:329
void setAttributes(InputIterator first, InputIterator last)
Sets the attributes using the iterators first and last.
Definition qrhi.h:331
const QRhiVertexInputAttribute * cbeginAttributes() const
Definition qrhi.h:336
const QRhiVertexInputBinding * cbeginBindings() const
Definition qrhi.h:324
qsizetype attributeCount() const
Definition qrhi.h:339
friend bool operator!=(const QRhiVertexInputLayout &a, const QRhiVertexInputLayout &b) noexcept
Definition qrhi.h:350
void setBindings(InputIterator first, InputIterator last)
Sets the bindings using the iterators first and last.
Definition qrhi.h:319
const QRhiVertexInputAttribute * attributeAt(qsizetype index) const
Definition qrhi.h:338
qsizetype bindingCount() const
Definition qrhi.h:327
\inmodule QtGui
Definition qrhi.h:85
void setMinDepth(float minDepth)
Sets the minDepth of the depth range of the viewport.
Definition qrhi.h:96
friend bool operator!=(const QRhiViewport &a, const QRhiViewport &b) noexcept
Definition qrhi.h:113
float maxDepth() const
Definition qrhi.h:98
void setMaxDepth(float maxDepth)
Sets the maxDepth of the depth range of the viewport.
Definition qrhi.h:99
float minDepth() const
Definition qrhi.h:95
void setViewport(float x, float y, float w, float h)
Sets the viewport's position and size to x, y, w, and h.
Definition qrhi.h:91
std::array< float, 4 > viewport() const
Definition qrhi.h:90
friend size_t qHash(const QRhiViewport &v, size_t seed=0) noexcept
Definition qrhi.h:118
QRhiViewport()=default
Constructs a viewport description with an empty rectangle and a depth range of 0.0f - 1....
friend bool operator==(const QRhiViewport &a, const QRhiViewport &b) noexcept
Definition qrhi.h:106
\inmodule QtGui
Definition qrhi.h:1767
Implementation
Describes which graphics API-specific backend gets used by a QRhi instance.
Definition qrhi.h:1769
@ Metal
Definition qrhi.h:1774
@ Vulkan
Definition qrhi.h:1771
@ Null
Definition qrhi.h:1770
@ D3D11
Definition qrhi.h:1773
@ OpenGLES2
Definition qrhi.h:1772
BeginFrameFlag
Flag values for QRhi::beginFrame()
Definition qrhi.h:1837
ResourceLimit
Describes the resource limit to query.
Definition qrhi.h:1846
@ MaxThreadsPerThreadGroup
Definition qrhi.h:1853
@ MaxThreadGroupZ
Definition qrhi.h:1856
@ FramesInFlight
Definition qrhi.h:1850
@ MaxThreadGroupsPerDimension
Definition qrhi.h:1852
@ MaxAsyncReadbackFrames
Definition qrhi.h:1851
@ TextureArraySizeMax
Definition qrhi.h:1857
@ MaxColorAttachments
Definition qrhi.h:1849
@ MaxThreadGroupY
Definition qrhi.h:1855
@ MaxVertexInputs
Definition qrhi.h:1859
@ MaxThreadGroupX
Definition qrhi.h:1854
@ TextureSizeMax
Definition qrhi.h:1848
@ MaxUniformBufferRange
Definition qrhi.h:1858
EndFrameFlag
Flag values for QRhi::endFrame()
Definition qrhi.h:1841
Feature
Flag values to indicate what features are supported by the backend currently in use.
Definition qrhi.h:1793
@ HalfAttributes
Definition qrhi.h:1831
@ CustomInstanceStepRate
Definition qrhi.h:1799
@ NonDynamicUniformBuffers
Definition qrhi.h:1801
@ ElementIndexUint
Definition qrhi.h:1805
@ RenderToNonBaseMipLevel
Definition qrhi.h:1815
@ MultisampleRenderBuffer
Definition qrhi.h:1795
@ RenderTo3DTextureSlice
Definition qrhi.h:1823
@ Tessellation
Definition qrhi.h:1825
@ IntAttributes
Definition qrhi.h:1816
@ TextureArrays
Definition qrhi.h:1824
@ PipelineCacheDataLoadSave
Definition qrhi.h:1819
@ ReadBackNonUniformBuffer
Definition qrhi.h:1812
@ TexelFetch
Definition qrhi.h:1814
@ TextureArrayRange
Definition qrhi.h:1827
@ RenderToOneDimensionalTexture
Definition qrhi.h:1832
@ BaseVertex
Definition qrhi.h:1809
@ GeometryShader
Definition qrhi.h:1826
@ Compute
Definition qrhi.h:1806
@ OneDimensionalTextureMipmaps
Definition qrhi.h:1830
@ WideLines
Definition qrhi.h:1807
@ TriangleFanTopology
Definition qrhi.h:1811
@ OneDimensionalTextures
Definition qrhi.h:1829
@ ImageDataStride
Definition qrhi.h:1820
@ BaseInstance
Definition qrhi.h:1810
@ DebugMarkers
Definition qrhi.h:1796
@ ReadBackNonBaseMipLevel
Definition qrhi.h:1813
@ ThreeDimensionalTextureMipmaps
Definition qrhi.h:1833
@ NonFourAlignedEffectiveIndexBufferOffset
Definition qrhi.h:1802
@ RedOrAlpha8IsRed
Definition qrhi.h:1804
@ NonFillPolygonMode
Definition qrhi.h:1828
@ Timestamps
Definition qrhi.h:1797
@ ThreeDimensionalTextures
Definition qrhi.h:1822
@ PrimitiveRestart
Definition qrhi.h:1800
@ ReadBackAnyTextureFormat
Definition qrhi.h:1818
@ RenderBufferImport
Definition qrhi.h:1821
@ ScreenSpaceDerivatives
Definition qrhi.h:1817
@ VertexShaderPointSize
Definition qrhi.h:1808
@ NPOTTextureRepeat
Definition qrhi.h:1803
@ Instancing
Definition qrhi.h:1798
FrameOpResult
Describes the result of operations that can have a soft failure.
Definition qrhi.h:1786
@ FrameOpSwapChainOutOfDate
Definition qrhi.h:1789
@ FrameOpError
Definition qrhi.h:1788
std::function< void(QRhi *)> CleanupCallback
Definition qrhi.h:1877
Flag
Describes what special features to enable.
Definition qrhi.h:1778
\inmodule QtGui
Definition qshader.h:81
Variant
Describes what kind of shader code an entry contains.
Definition qshader.h:103
@ StandardShader
Definition qshader.h:104
\inmodule QtCore
Definition qsize.h:25
\inmodule QtGui
Definition qwindow.h:63
Format
Definition ddsheader.h:14
QHash< int, QWidget * > hash
[35multi]
employee setName("Richard Schmit")
else opt state
[0]
Combined button and popup list for selecting options.
Definition image.cpp:4
static std::unique_ptr< QRhiGraphicsPipeline > newGraphicsPipeline(QRhi *rhi, QRhiShaderResourceBindings *shaderResourceBindings, QRhiRenderPassDescriptor *renderPassDescriptor, QShader vertexShader, QShader fragmentShader)
std::pair< T1, T2 > QPair
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter int const void return DBusMessageIter DBusMessageIter return DBusMessageIter void DBusMessageIter void int return DBusMessage DBusMessageIter return DBusMessageIter return DBusMessageIter DBusMessageIter const char const char const char const char return DBusMessage return DBusMessage const char return DBusMessage dbus_bool_t return DBusMessage dbus_uint32_t return DBusMessage void
static int instanceCount
@ One
static int resourceType(const QByteArray &key)
EGLOutputLayerEXT layer
#define Q_DECLARE_FLAGS(Flags, Enum)
Definition qflags.h:174
#define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags)
Definition qflags.h:194
Flags
static QString backendName
n varying highp vec2 A
GLint location
GLboolean GLboolean GLboolean b
GLsizei const GLfloat * v
[13]
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat z
GLint GLint GLint GLint GLint x
[0]
GLint GLenum GLsizei GLsizei GLsizei depth
GLsizei samples
GLenum mode
GLenum GLuint GLint level
GLfloat GLfloat GLfloat w
[0]
GLint GLsizei GLsizei height
GLboolean GLboolean GLboolean GLboolean a
[7]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLuint index
[2]
GLuint const GLuint GLuint const GLuint * textures
GLuint sampler
GLenum GLenum GLenum GLenum dstAlpha
GLenum GLenum GLsizei count
GLfloat GLfloat f
GLenum GLenum GLenum srcAlpha
GLenum src
const void GLsizei GLsizei stride
GLint GLsizei width
GLenum type
GLenum GLenum dst
GLenum GLuint GLenum GLsizei const GLchar * buf
GLbitfield flags
GLboolean enable
GLenum GLuint texture
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum GLuint GLintptr offset
GLuint name
GLint first
GLint GLint GLint GLint GLint GLint GLint GLbitfield mask
GLint GLsizei GLsizei GLenum format
GLint y
GLfloat GLfloat GLfloat GLfloat h
void ** params
const GLubyte * c
GLuint entry
GLfloat bias
GLuint GLenum * rate
GLuint shader
Definition qopenglext.h:665
GLint limit
GLdouble GLdouble t
Definition qopenglext.h:243
GLuint64EXT * result
[6]
GLdouble s
[6]
Definition qopenglext.h:235
GLfloat GLfloat p
[1]
GLsizeiptr const void GLenum usage
Definition qopenglext.h:543
static Q_CONSTINIT QBasicAtomicInteger< unsigned > seed
Definition qrandom.cpp:196
Q_GUI_EXPORT QDebug operator<<(QDebug, const QRhiDepthStencilClearValue &)
Definition qrhi.cpp:1182
Q_GUI_EXPORT size_t qHash(const QRhiShaderResourceBinding &b, size_t seed=0) noexcept
static constexpr QSize sizeForMipLevel(int mipLevel, const QSize &baseLevelSize)
SSL_CTX int(* cb)(SSL *ssl, unsigned char **out, unsigned char *outlen, const unsigned char *in, unsigned int inlen, void *arg)
@ desc
@ Q_PRIMITIVE_TYPE
Definition qtypeinfo.h:144
@ 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
ptrdiff_t qsizetype
Definition qtypes.h:70
long long qint64
Definition qtypes.h:55
QVideoFrameFormat::PixelFormat fmt
static QInputDevice::DeviceType deviceType(const UINT cursorType)
QList< int > list
[14]
QDataStream & operator<<(QDataStream &out, const MyClass &myObj)
[4]
QVBoxLayout * layout
sem release()
QSharedPointer< T > other(t)
[5]
view viewport() -> scroll(dx, dy, deviceRect)
myFilter draw(painter, QPoint(0, 0), originalPixmap)
aWidget window() -> setWindowTitle("New Window Title")
[2]
view create()
\inmodule QtGui
Definition qrhi.h:850
\inmodule QtGui
Definition qrhi.h:1722
QByteArray deviceName
Definition qrhi.h:1732
DeviceType
Specifies the graphics device's type, when the information is available.
Definition qrhi.h:1723
@ IntegratedDevice
Definition qrhi.h:1725
\variable QRhiGraphicsPipeline::TargetBlend::colorWrite
Definition qrhi.h:1343
\inmodule QtGui
Definition qrhi.h:1763
\variable QRhiReadbackResult::completed
Definition qrhi.h:788
\inmodule QtGui
Definition qrhi.h:1686
QByteArray data
Definition qrhi.h:1690
QRhiTexture::Format format
Definition qrhi.h:1688
StorageBufferData sbuf
Definition qrhi.h:516
TextureAndOrSamplerData stex
Definition qrhi.h:514
QRhiShaderResourceBinding::StageFlags stage
Definition qrhi.h:490
StorageImageData simage
Definition qrhi.h:515
UniformBufferData ubuf
Definition qrhi.h:513
Output serialize(Output dst) const
Definition qrhi.h:527
QRhiShaderResourceBinding::Type type
Definition qrhi.h:491
\inmodule QtGui
Definition qrhi.h:1745
\inmodule QtGui
Definition qrhi.h:1482
LimitsType limitsType
Definition qrhi.h:1488
float maxPotentialColorComponentValue
Definition qrhi.h:1496
LimitsType
\value LuminanceInNits Indicates that the \l limits union has its luminanceInNits struct set
Definition qrhi.h:1484
bool isHardCodedDefaults
Definition qrhi.h:1483
float maxColorComponentValue
Definition qrhi.h:1495
\inmodule QtGui
Definition qrhi.h:1508
\inmodule QtGui
Definition qrhi.h:953
Definition moc.h:24
\qmltype MapCircle \instantiates QDeclarativeCircleMapItem \inqmlmodule QtLocation