Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qrhigles2_p.h
Go to the documentation of this file.
1// Copyright (C) 2023 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#ifndef QRHIGLES2_P_H
6#define QRHIGLES2_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include "qrhi_p.h"
20#include <rhi/qshaderdescription.h>
21#include <qopengl.h>
22#include <QByteArray>
23#include <QWindow>
24#include <QPointer>
25#include <QtCore/private/qduplicatetracker_p.h>
26#include <optional>
27
28QT_BEGIN_NAMESPACE
29
30class QOpenGLExtensions;
31class QRhiGles2;
32
65
67{
68 QGles2RenderBuffer(QRhiImplementation *rhi, Type type, const QSize &pixelSize,
69 int sampleCount, QRhiRenderBuffer::Flags flags,
70 QRhiTexture::Format backingFormatHint);
72 void destroy() override;
73 bool create() override;
74 bool createFrom(NativeRenderBuffer src) override;
75 QRhiTexture::Format backingFormat() const override;
76
78 GLuint stencilRenderbuffer = 0; // when packed depth-stencil not supported
80 bool owns = true;
81 uint generation = 0;
82 friend class QRhiGles2;
83};
84
94
95inline bool operator==(const QGles2SamplerData &a, const QGles2SamplerData &b)
96{
97 return a.glminfilter == b.glminfilter
98 && a.glmagfilter == b.glmagfilter
99 && a.glwraps == b.glwraps
100 && a.glwrapt == b.glwrapt
101 && a.glwrapr == b.glwrapr
102 && a.gltexcomparefunc == b.gltexcomparefunc;
103}
104
105inline bool operator!=(const QGles2SamplerData &a, const QGles2SamplerData &b)
106{
107 return !(a == b);
108}
109
111{
112 QGles2Texture(QRhiImplementation *rhi, Format format, const QSize &pixelSize, int depth,
113 int arraySize, int sampleCount, Flags flags);
114 ~QGles2Texture();
115 void destroy() override;
116 bool create() override;
117 bool createFrom(NativeTexture src) override;
118 NativeTexture nativeTexture() override;
119
120 bool prepareCreate(QSize *adjustedSize = nullptr);
121
123 bool owns = true;
130 bool specified = false;
131 // when !specified (compressed format without texture storage support), the mip levels
132 // are allocated lazily, one bitmask of mip levels per cubemap face
136
137 bool isLevelAllocated(int face, int level) const
138 {
139 return specified || (allocatedLevels[face] & (1u << uint(level)));
140 }
141
152 struct UsageState {
154 };
156
157 uint generation = 0;
158 friend class QRhiGles2;
159};
160
162{
163 QGles2Sampler(QRhiImplementation *rhi, Filter magFilter, Filter minFilter, Filter mipmapMode,
164 AddressMode u, AddressMode v, AddressMode w);
165 ~QGles2Sampler();
166 void destroy() override;
167 bool create() override;
168
170 uint generation = 0;
171 friend class QRhiGles2;
172};
173
175{
176 QGles2RenderPassDescriptor(QRhiImplementation *rhi);
178 void destroy() override;
179 bool isCompatible(const QRhiRenderPassDescriptor *other) const override;
181 QVector<quint32> serializedFormat() const override;
182};
183
200
202{
203 QGles2SwapChainRenderTarget(QRhiImplementation *rhi, QRhiSwapChain *swapchain);
205 void destroy() override;
206
207 QSize pixelSize() const override;
208 float devicePixelRatio() const override;
209 int sampleCount() const override;
210
212};
213
215{
216 QGles2TextureRenderTarget(QRhiImplementation *rhi, const QRhiTextureRenderTargetDescription &desc, Flags flags);
218 void destroy() override;
219
220 QSize pixelSize() const override;
221 float devicePixelRatio() const override;
222 int sampleCount() const override;
223
225 bool create() override;
226
230 friend class QRhiGles2;
231};
232
234{
235 QGles2ShaderResourceBindings(QRhiImplementation *rhi);
237 void destroy() override;
238 bool create() override;
239 void updateResources(UpdateFlags flags) override;
240
241 bool hasDynamicOffset = false;
242 bool hasStorageBinding = false;
244 uint generation = 0;
245 friend class QRhiGles2;
246};
247
249{
256 // Distance in bytes between the array elements, or between the matrix
257 // columns for matrix types. 0 means the std140 default (16). Uniform
258 // blocks are std140, but push constant blocks are std430, where arrays of
259 // scalars and vec2 are tightly packed.
261 int stateIndex; // -1 when not tracked (arrays, matrices, int types)
262};
263
265
273
275
276using QGles2UniformDescriptionVector = QVarLengthArray<QGles2UniformDescription, 8>;
277using QGles2SamplerDescriptionVector = QVarLengthArray<QGles2SamplerDescription, 4>;
278
280{
282 float v[4];
283};
284
286
287using QGles2UniformStateVector = QVarLengthArray<QGles2UniformState, 8>;
288
309
329
331{
332 QGles2CommandBuffer(QRhiImplementation *rhi);
334 void destroy() override;
335
336 struct Command {
380
381 // QRhi*/QGles2* references should be kept at minimum (so no
382 // QRhiTexture/Buffer/etc. pointers).
383 union Args {
384 struct {
385 GLuint timestampQuery;
386 } beginFrame;
387 struct {
388 GLuint timestampQuery;
389 } endFrame;
390 struct {
391 float x, y, w, h;
392 float d0, d1;
393 } viewport;
394 struct {
395 int x, y, w, h;
396 } scissor;
397 struct {
398 float r, g, b, a;
399 } blendConstants;
400 struct {
401 quint32 ref;
402 QRhiGraphicsPipeline *ps;
403 } stencilRef;
404 struct {
405 QRhiGraphicsPipeline *ps;
406 GLuint buffer;
407 quint32 offset;
408 int binding;
409 } bindVertexBuffer;
410 struct {
411 GLuint buffer;
412 quint32 offset;
413 GLenum type;
414 } bindIndexBuffer;
415 struct {
416 QRhiGraphicsPipeline *ps;
417 quint32 vertexCount;
418 quint32 firstVertex;
419 quint32 instanceCount;
420 quint32 baseInstance;
421 } draw;
422 struct {
423 QRhiGraphicsPipeline *ps;
424 quint32 indexCount;
425 quint32 firstIndex;
426 quint32 instanceCount;
427 quint32 baseInstance;
428 qint32 baseVertex;
429 } drawIndexed;
430 struct {
431 QRhiGraphicsPipeline *ps;
432 GLuint buffer;
433 quint32 offset;
434 quint32 drawCount;
435 quint32 stride;
436 } drawIndirect;
437 struct {
438 QRhiGraphicsPipeline *ps;
439 GLuint buffer;
440 quint32 offset;
441 quint32 drawCount;
442 quint32 stride;
443 } drawIndexedIndirect;
444 struct {
445 QRhiGraphicsPipeline *ps;
446 GLuint buffer;
447 quint32 offset;
448 GLuint countBuffer;
449 quint32 countOffset;
450 quint32 maxDrawCount;
451 quint32 stride;
452 } drawIndirectCount;
453 struct {
454 QRhiGraphicsPipeline *ps;
455 GLuint buffer;
456 quint32 offset;
457 GLuint countBuffer;
458 quint32 countOffset;
459 quint32 maxDrawCount;
460 quint32 stride;
461 } drawIndexedIndirectCount;
462 struct {
463 QRhiGraphicsPipeline *ps;
464 } bindGraphicsPipeline;
465 struct {
466 QRhiGraphicsPipeline *maybeGraphicsPs;
467 QRhiComputePipeline *maybeComputePs;
468 QRhiShaderResourceBindings *srb;
469 int dynamicOffsetCount;
470 quint32 dynamicOffsetPoolOffset;
471 } bindShaderResources;
472 struct {
473 QRhiGraphicsPipeline *maybeGraphicsPs;
474 QRhiComputePipeline *maybeComputePs;
475 quint32 dataOffset; // into pushConstantPool
476 quint32 size;
477 } setPushConstants;
478 struct {
479 GLbitfield mask;
480 float c[4];
481 float d;
482 quint32 s;
483 } clear;
484 struct {
485 GLuint fbo;
486 bool srgb;
487 int colorAttCount;
488 bool stereo;
489 QRhiSwapChain::StereoTargetBuffer stereoTarget;
490 } bindFramebuffer;
491 struct {
492 GLenum target;
493 GLuint buffer;
494 int offset;
495 int size;
496 const void *data; // must come from retainData()
497 } bufferSubData;
498 struct {
499 QRhiReadbackResult *result;
500 GLenum target;
501 GLuint buffer;
502 int offset;
503 int size;
504 } getBufferSubData;
505 struct {
506 GLuint srcBuffer;
507 GLuint dstBuffer;
508 int srcOffset;
509 int dstOffset;
510 int size;
511 } copyBuf;
512 struct {
513 GLenum target;
514 GLuint buffer;
515 int offset;
516 int size;
517 quint8 value;
518 } clearBufferSubData;
519 struct {
520 GLuint buffer;
521 quint32 offsetWords;
522 quint32 countWords;
523 quint32 value;
524 } clearBufferCompute;
525 struct {
526 GLenum srcTarget;
527 GLenum srcFaceTarget;
528 GLuint srcTexture;
529 int srcLevel;
530 int srcX;
531 int srcY;
532 int srcZ;
533 GLenum dstTarget;
534 GLuint dstTexture;
535 GLenum dstFaceTarget;
536 int dstLevel;
537 int dstX;
538 int dstY;
539 int dstZ;
540 int w;
541 int h;
542 } copyTex;
543 struct {
544 QRhiReadbackResult *result;
545 GLuint texture;
546 int x;
547 int y;
548 int w;
549 int h;
550 QRhiTexture::Format format;
551 GLenum readTarget;
552 int level;
553 int slice3D;
554 } readPixels;
555 struct {
556 GLenum target;
557 GLuint texture;
558 GLenum faceTarget;
559 int level;
560 int dx;
561 int dy;
562 int dz;
563 int w;
564 int h;
565 GLenum glformat;
566 GLenum gltype;
567 int rowStartAlign;
568 int rowLength;
569 const void *data; // must come from retainImage()
570 } subImage;
571 struct {
572 GLenum target;
573 GLuint texture;
574 GLenum faceTarget;
575 int level;
576 GLenum glintformat;
577 int w;
578 int h;
579 int depth;
580 int size;
581 const void *data; // must come from retainData()
582 } compressedImage;
583 struct {
584 GLenum target;
585 GLuint texture;
586 GLenum faceTarget;
587 int level;
588 int dx;
589 int dy;
590 int dz;
591 int w;
592 int h;
593 GLenum glintformat;
594 int size;
595 const void *data; // must come from retainData()
596 } compressedSubImage;
597 struct {
598 GLuint renderbuffer;
599 GLuint stencilRenderbuffer;
600 int w;
601 int h;
602 GLenum target;
603 GLuint dstTexture;
604 int dstLevel;
605 int dstLayer;
606 bool isDepthStencil;
607 bool hasStencil;
608 } blitFromRenderbuffer;
609 struct {
610 GLenum srcTarget;
611 GLuint srcTexture;
612 int srcLevel;
613 int srcLayer;
614 int w;
615 int h;
616 GLenum dstTarget;
617 GLuint dstTexture;
618 int dstLevel;
619 int dstLayer;
620 bool isDepthStencil;
621 bool hasStencil;
622 } blitFromTexture;
623 struct {
624 GLenum target;
625 GLuint texture;
626 } genMip;
627 struct {
628 QRhiComputePipeline *ps;
629 } bindComputePipeline;
630 struct {
631 GLuint x;
632 GLuint y;
633 GLuint z;
634 } dispatch;
635 struct {
636 GLuint buffer;
637 quint32 offset;
638 } dispatchIndirect;
639 struct {
640 int trackerIndex;
641 } barriersForPass;
642 struct {
643 GLbitfield barriers;
644 } barrier;
645 struct {
646 GLuint fbo;
647 int attCount;
648 GLenum att[3];
649 } invalidateFramebuffer;
650 } args;
651 };
652
658
662
666 double lastGpuTime = 0;
675
677 bool valid = false;
682 bool blendEnabled[16];
683 struct ColorMask { bool r, g, b, a; } colorMask[16];
699 GLint stencilRef; // value currently applied in GL; may differ from dynamic.stencilRef
712 void reset() { valid = false; }
713 struct {
714 // not part of QRhiGraphicsPipeline but used by setGraphicsPipeline()
715 GLint stencilRef = 0;
716 } dynamic;
717 } graphicsPassState;
718
720 enum Access {
721 Read = 0x01,
722 Write = 0x02
723 };
725 void reset() {
726 writtenResources.clear();
727 }
728 } computePassState;
729
731 void *ps;
734 } textureUnitState[16];
735
738 QVarLengthArray<uint, 32> dynamicOffsetPool; // (binding, offset) pairs
741
742 // relies heavily on implicit sharing (no copies of the actual data will be made)
743 const void *retainData(const QByteArray &data) {
744 dataRetainPool.append(data);
745 return dataRetainPool.last().constData();
746 }
748 bufferDataRetainPool.append(data);
749 return reinterpret_cast<const uchar *>(bufferDataRetainPool.last().constData());
750 }
751 const void *retainImage(const QImage &image) {
752 imageRetainPool.append(image);
753 return imageRetainPool.last().constBits();
754 }
756 commands.reset();
757 pushConstantPool.clear();
758 dynamicOffsetPool.clear();
759 dataRetainPool.clear();
760 bufferDataRetainPool.clear();
761 imageRetainPool.clear();
762
763 passResTrackers.clear();
765 }
766 void resetState() {
770 // do not zero lastGpuTime
771 currentTarget = nullptr;
774 }
776 currentGraphicsPipeline = nullptr;
777 currentComputePipeline = nullptr;
779 currentGraphicsSrb = nullptr;
780 currentComputeSrb = nullptr;
782 pushConstantData.clear();
783 graphicsPassState.reset();
784 computePassState.reset();
785 memset(textureUnitState, 0, sizeof(textureUnitState));
786 }
787};
788
791{
792 return a.func == b.func
793 && a.failOp == b.failOp
794 && a.zfailOp == b.zfailOp
795 && a.zpassOp == b.zpassOp;
796}
797
800{
801 return !(a == b);
802}
803
806{
807 return a.r == b.r && a.g == b.g && a.b == b.b && a.a == b.a;
808}
809
812{
813 return !(a == b);
814}
815
818{
819 return a.srcColor == b.srcColor
820 && a.dstColor == b.dstColor
821 && a.srcAlpha == b.srcAlpha
822 && a.dstAlpha == b.dstAlpha
823 && a.opColor == b.opColor
824 && a.opAlpha == b.opAlpha;
825}
826
829{
830 return !(a == b);
831}
832
834{
835 static const int TIMESTAMP_PAIRS = 2;
836
839
840 void prepare(QRhiGles2 *rhiD);
841 void destroy(QRhiGles2 *rhiD);
842 bool tryQueryTimestamps(int pairIndex, QRhiGles2 *rhiD, double *elapsedSec);
843};
844
872
874{
875public:
876 QRhiGles2(QRhiGles2InitParams *params, QRhiGles2NativeHandles *importDevice = nullptr);
877
878 bool create(QRhi::Flags flags) override;
879 void destroy() override;
880
884 QRhiBuffer *createBuffer(QRhiBuffer::Type type,
885 QRhiBuffer::UsageFlags usage,
886 quint32 size) override;
887 QRhiRenderBuffer *createRenderBuffer(QRhiRenderBuffer::Type type,
888 const QSize &pixelSize,
889 int sampleCount,
890 QRhiRenderBuffer::Flags flags,
891 QRhiTexture::Format backingFormatHint) override;
892 QRhiTexture *createTexture(QRhiTexture::Format format,
893 const QSize &pixelSize,
894 int depth,
895 int arraySize,
896 int sampleCount,
897 QRhiTexture::Flags flags) override;
898 QRhiSampler *createSampler(QRhiSampler::Filter magFilter,
899 QRhiSampler::Filter minFilter,
900 QRhiSampler::Filter mipmapMode,
901 QRhiSampler:: AddressMode u,
902 QRhiSampler::AddressMode v,
903 QRhiSampler::AddressMode w) override;
904
905 QRhiTextureRenderTarget *createTextureRenderTarget(const QRhiTextureRenderTargetDescription &desc,
906 QRhiTextureRenderTarget::Flags flags) override;
907
908 QRhiShadingRateMap *createShadingRateMap() override;
909
910 QRhiSwapChain *createSwapChain() override;
911 QRhi::FrameOpResult beginFrame(QRhiSwapChain *swapChain, QRhi::BeginFrameFlags flags) override;
912 QRhi::FrameOpResult endFrame(QRhiSwapChain *swapChain, QRhi::EndFrameFlags flags) override;
913 QRhi::FrameOpResult beginOffscreenFrame(QRhiCommandBuffer **cb, QRhi::BeginFrameFlags flags) override;
914 QRhi::FrameOpResult endOffscreenFrame(QRhi::EndFrameFlags flags) override;
915 QRhi::FrameOpResult finish() override;
916
917 void resourceUpdate(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override;
918
919 void beginPass(QRhiCommandBuffer *cb,
920 QRhiRenderTarget *rt,
921 const QColor &colorClearValue,
922 const QRhiDepthStencilClearValue &depthStencilClearValue,
923 QRhiResourceUpdateBatch *resourceUpdates,
924 QRhiCommandBuffer::BeginPassFlags flags) override;
925 void endPass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override;
926
927 void setGraphicsPipeline(QRhiCommandBuffer *cb,
928 QRhiGraphicsPipeline *ps) override;
929
930 void setShaderResources(QRhiCommandBuffer *cb,
931 QRhiShaderResourceBindings *srb,
932 int dynamicOffsetCount,
933 const QRhiCommandBuffer::DynamicOffset *dynamicOffsets) override;
934
935 void setVertexInput(QRhiCommandBuffer *cb,
936 int startBinding, int bindingCount, const QRhiCommandBuffer::VertexInput *bindings,
937 QRhiBuffer *indexBuf, quint32 indexOffset,
938 QRhiCommandBuffer::IndexFormat indexFormat) override;
939
940 void setViewport(QRhiCommandBuffer *cb, const QRhiViewport &viewport) override;
941 void setScissor(QRhiCommandBuffer *cb, const QRhiScissor &scissor) override;
942 void setBlendConstants(QRhiCommandBuffer *cb, const QColor &c) override;
943 void setStencilRef(QRhiCommandBuffer *cb, quint32 refValue) override;
944 void setPushConstants(QRhiCommandBuffer *cb, quint32 offset, quint32 size, const void *data) override;
945 static constexpr quint32 MAX_PUSH_CONSTANTS_SIZE = 128;
946 void setShadingRate(QRhiCommandBuffer *cb, const QSize &coarsePixelSize) override;
947
948 void draw(QRhiCommandBuffer *cb, quint32 vertexCount,
949 quint32 instanceCount, quint32 firstVertex, quint32 firstInstance) override;
950
951 void drawIndexed(QRhiCommandBuffer *cb, quint32 indexCount,
952 quint32 instanceCount, quint32 firstIndex,
953 qint32 vertexOffset, quint32 firstInstance) override;
954
955 void drawIndirect(QRhiCommandBuffer *cb, QRhiBuffer *indirectBuffer,
956 quint32 indirectBufferOffset, quint32 drawCount, quint32 stride) override;
957
958 void drawIndexedIndirect(QRhiCommandBuffer *cb, QRhiBuffer *indirectBuffer,
959 quint32 indirectBufferOffset, quint32 drawCount, quint32 stride) override;
960
961 void drawIndirectCount(QRhiCommandBuffer *cb,
962 QRhiBuffer *indirectBuffer, quint32 indirectBufferOffset,
963 QRhiBuffer *countBuffer, quint32 countBufferOffset,
964 quint32 maxDrawCount, quint32 stride) override;
965 void drawIndexedIndirectCount(QRhiCommandBuffer *cb,
966 QRhiBuffer *indirectBuffer, quint32 indirectBufferOffset,
967 QRhiBuffer *countBuffer, quint32 countBufferOffset,
968 quint32 maxDrawCount, quint32 stride) override;
969
970 void dispatchIndirect(QRhiCommandBuffer *cb, QRhiBuffer *indirectBuffer,
971 quint32 indirectBufferOffset) override;
972
973 void debugMarkBegin(QRhiCommandBuffer *cb, const QByteArray &name) override;
974 void debugMarkEnd(QRhiCommandBuffer *cb) override;
975 void debugMarkMsg(QRhiCommandBuffer *cb, const QByteArray &msg) override;
976
977 void beginComputePass(QRhiCommandBuffer *cb,
978 QRhiResourceUpdateBatch *resourceUpdates,
979 QRhiCommandBuffer::BeginPassFlags flags) override;
980 void endComputePass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override;
981 void setComputePipeline(QRhiCommandBuffer *cb, QRhiComputePipeline *ps) override;
982 void dispatch(QRhiCommandBuffer *cb, int x, int y, int z) override;
983
984 const QRhiNativeHandles *nativeHandles(QRhiCommandBuffer *cb) override;
985 void beginExternal(QRhiCommandBuffer *cb) override;
986 void endExternal(QRhiCommandBuffer *cb) override;
987 double lastCompletedGpuTime(QRhiCommandBuffer *cb) override;
988
989 QList<int> supportedSampleCounts() const override;
990 QList<QSize> supportedShadingRates(int sampleCount) const override;
991 int ubufAlignment() const override;
992 bool isYUpInFramebuffer() const override;
993 bool isYUpInNDC() const override;
994 bool isClipDepthZeroToOne() const override;
995 QMatrix4x4 clipSpaceCorrMatrix() const override;
996 bool isTextureFormatSupported(QRhiTexture::Format format, QRhiTexture::Flags flags) const override;
997 bool isFeatureSupported(QRhi::Feature feature) const override;
998 int resourceLimit(QRhi::ResourceLimit limit) const override;
999 const QRhiNativeHandles *nativeHandles() override;
1000 QRhiDriverInfo driverInfo() const override;
1001 QRhiStats statistics() override;
1003 void setQueueSubmitParams(QRhiNativeHandles *params) override;
1005 bool isDeviceLost() const override;
1006
1007 QByteArray pipelineCacheData() override;
1008 void setPipelineCacheData(const QByteArray &data) override;
1009
1010 bool ensureContext(QSurface *surface = nullptr) const;
1013 GLuint genBuffer();
1018 int layer, int level, const QRhiTextureSubresourceUploadDescription &subresDesc);
1019 void enqueueResourceUpdates(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates);
1021 QGles2Buffer *bufD,
1025 QGles2Texture *texD,
1029 void executeCommandBuffer(QRhiCommandBuffer *cb);
1032 void *ps, uint psGeneration, int glslLocation,
1033 int *texUnit, bool *activeTexUnitAltered);
1035 QRhiGraphicsPipeline *maybeGraphicsPs, QRhiComputePipeline *maybeComputePs,
1036 QRhiShaderResourceBindings *srb,
1037 const uint *dynOfsPairs, int dynOfsCount);
1038 void setUniformValue(const QGles2UniformDescription &uniform, const void *src,
1039 QGles2UniformState *uniformState);
1040 static void setupUniformStateTracking(QGles2UniformDescriptionVector *uniforms,
1041 QGles2UniformDescriptionVector *pushConstantUniforms,
1042 QGles2UniformStateVector *uniformState);
1043 void setUniformsFromBlock(const QGles2UniformDescriptionVector &uniforms, int binding,
1044 const char *blockData, qint64 blockSize, quint32 blockOffset,
1045 QGles2UniformState *uniformState);
1047 bool *wantsColorClear = nullptr, bool *wantsDsClear = nullptr);
1050 std::optional<QShaderVersion> commonGlslEsVersion(const QRhiShaderStage *stages, int stageCount) const;
1051 QByteArray shaderSource(const QRhiShaderStage &shaderStage, QShaderVersion *shaderVersion,
1052 std::optional<QShaderVersion> commonVersion = std::nullopt);
1053 bool compileShader(GLuint program, const QRhiShaderStage &shaderStage, QShaderVersion *shaderVersion,
1054 std::optional<QShaderVersion> commonVersion = std::nullopt);
1055 bool linkProgram(GLuint program);
1058 void registerUniformIfActive(const QShaderDescription::BlockVariable &var,
1059 const QByteArray &namePrefix, int binding, int baseOffset,
1060 GLuint program,
1061 ActiveUniformLocationTracker *activeUniformLocations,
1062 QGles2UniformDescriptionVector *dst);
1063 void gatherBlockMemberUniforms(GLuint program, const QByteArray &prefix, int binding,
1064 const QList<QShaderDescription::BlockVariable> &members,
1065 ActiveUniformLocationTracker *activeUniformLocations,
1066 QGles2UniformDescriptionVector *dst);
1067 void gatherUniforms(GLuint program, const QShaderDescription::UniformBlock &ub,
1068 ActiveUniformLocationTracker *activeUniformLocations, QGles2UniformDescriptionVector *dst);
1069 void gatherPushConstantUniforms(GLuint program, const QShaderDescription::PushConstantBlock &pcb,
1070 ActiveUniformLocationTracker *activeUniformLocations,
1071 QGles2UniformDescriptionVector *dst);
1072 void gatherSamplers(GLuint program, const QShaderDescription::InOutVariable &v,
1073 QGles2SamplerDescriptionVector *dst);
1074 void gatherGeneratedSamplers(GLuint program,
1075 const QShader::SeparateToCombinedImageSamplerMapping &mapping,
1076 QGles2SamplerDescriptionVector *dst);
1077 void sanityCheckVertexFragmentInterface(const QShaderDescription &vsDesc, const QShaderDescription &fsDesc);
1079
1085 ProgramCacheResult tryLoadFromDiskOrPipelineCache(const QRhiShaderStage *stages,
1086 int stageCount,
1087 GLuint program,
1088 const QVector<QShaderDescription::InOutVariable> &inputVars,
1089 QByteArray *cacheKey,
1090 std::optional<QShaderVersion> commonVersion = std::nullopt);
1091 void trySaveToDiskCache(GLuint program, const QByteArray &cacheKey);
1092 void trySaveToPipelineCache(GLuint program, const QByteArray &cacheKey, bool force = false);
1093
1096 bool importedContext = false;
1101 mutable bool needsMakeCurrentDueToSwap = false;
1102 QOpenGLExtensions *f = nullptr;
1105 const void *) = nullptr;
1108 GLboolean) = nullptr;
1110 const GLvoid *) = nullptr;
1112 GLsizei) = nullptr;
1114 const GLvoid *) = nullptr;
1116 GLsizei, const GLvoid *) = nullptr;
1118 GLint) = nullptr;
1120 GLint, GLsizei) = nullptr;
1123 GLenum, GLenum, const void *) = nullptr;
1125 void (QOPENGLF_APIENTRYP glObjectLabel)(GLenum, GLuint, GLsizei, const GLchar *) = nullptr;
1133 // Resolved when caps.baseInstance is true, left null otherwise.
1137 uint vao = 0;
1138 struct Caps {
1140 : ctxMajor(2),
1141 ctxMinor(0),
1142 maxTextureSize(2048),
1143 maxDrawBuffers(4),
1144 maxSamples(16),
1151 maxUniformVectors(4096),
1152 maxVertexInputs(8),
1158 msaaRenderBuffer(false),
1159 multisampledTexture(false),
1161 npotTextureFull(true),
1162 gles(false),
1164 bgraExternalFormat(false),
1165 bgraInternalFormat(false),
1166 r8Format(false),
1167 r16Format(false),
1168 r32uiFormat(false),
1169 floatFormats(false),
1170 rgb10Formats(false),
1171 depthTexture(false),
1172 packedDepthStencil(false),
1174 srgbTextureFormat(false),
1175 srgbGenerateMipmap(false),
1177 srgbWriteControl(false),
1178 coreProfile(false),
1179 vertexArrayObject(false),
1180 uniformBuffers(false),
1181 elementIndexUint(false),
1182 depth24(false),
1183 rgba8Format(false),
1184 instancing(false),
1185 baseVertex(false),
1186 baseInstance(false),
1187 compute(false),
1188 textureCompareMode(false),
1189 depthClamp(false),
1190 properMapBuffer(false),
1192 texelFetch(false),
1193 intAttributes(true),
1195 programBinary(false),
1196 texture3D(false),
1197 textureStorage(false),
1198 tessellation(false),
1199 geometryShader(false),
1200 texture1D(false),
1201 hasDrawBuffersFunc(false),
1202 halfAttributes(false),
1203 multiView(false),
1204 timestamps(false),
1205 objectLabel(false),
1208 unpackRowLength(false),
1210 dualSourceBlending(false),
1211 dispatchIndirect(false),
1212 drawIndirectCount(false),
1213 copyBuffer(false),
1214 clearBuffer(false),
1216 { }
1235 // Multisample fb and blit are supported (GLES 3.0 or OpenGL 3.x). Not
1236 // the same as multisample textures!
1241 uint gles : 1;
1245 uint r8Format : 1;
1246 uint r16Format : 1;
1247 uint r32uiFormat : 1;
1257 uint coreProfile : 1;
1261 uint depth24 : 1;
1262 uint rgba8Format : 1;
1263 uint instancing : 1;
1264 uint baseVertex : 1;
1266 uint compute : 1;
1268 uint depthClamp : 1;
1271 uint texelFetch : 1;
1275 uint texture3D : 1;
1279 uint texture1D : 1;
1282 uint multiView : 1;
1283 uint timestamps : 1;
1284 uint objectLabel : 1;
1297 uint copyBuffer : 1;
1298 uint clearBuffer : 1;
1300 } caps;
1306 mutable bool contextLost = false;
1307 uint frameNo = 0;
1313
1323 union {
1324 struct {
1325 GLuint buffer;
1326 } buffer;
1327 struct {
1328 GLuint program;
1329 } pipeline;
1330 struct {
1331 GLuint texture;
1332 } texture;
1333 struct {
1334 GLuint renderbuffer;
1335 GLuint renderbuffer2;
1336 } renderbuffer;
1337 struct {
1338 GLuint framebuffer;
1339 GLuint nonMsaaThrowawayDepthTexture;
1340 } textureRenderTarget;
1341 };
1342 };
1344
1346 OffscreenFrame(QRhiImplementation *rhi) : cbWrapper(rhi) { }
1347 bool active = false;
1350 } ofr;
1351
1352 // Keyed by version too: it depends on the other stages of the program.
1354
1360
1380};
1381
1383
1385{
1386 return quint32(d.data.size());
1387}
1388
1389QT_END_NAMESPACE
1390
1391#endif
friend bool operator==(const QByteArray::FromBase64Result &lhs, const QByteArray::FromBase64Result &rhs) noexcept
Returns true if lhs and rhs are equal, otherwise returns false.
Definition qbytearray.h:834
friend bool operator!=(const QByteArray::FromBase64Result &lhs, const QByteArray::FromBase64Result &rhs) noexcept
Returns true if lhs and rhs are different, otherwise returns false.
Definition qbytearray.h:845
QRhiBackendCommandList()=default
T * cbegin() const
Definition qrhi_p.h:1012
bool isEmpty() const
Definition qrhi_p.h:998
void execute(QRhiCommandBuffer *cb, quint32 firstCommand, quint32 commandCount)
Definition qrhi.cpp:9449
QRhiBufferBackedIndirectCommandBuffer(QRhiImplementation *rhi, Type type, quint32 maxCommandCount)
\variable QRhiIndirectCommandBufferBuildInfo::topology
Definition qrhi.cpp:9359
void enqueueUpload(QRhiResourceUpdateBatch *u)
Definition qrhi.cpp:9413
QRhiIndirectCommandBufferBuildInfo buildInfo
Definition qrhi_p.h:387
void build(const QRhiIndirectCommandBufferBuildInfo &info)
Definition qrhi.cpp:9436
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
Definition qrhi.cpp:9371
bool create() override
Creates the corresponding native objects.
Definition qrhi.cpp:9394
void swap(QRhiBufferData &other) noexcept
Definition qrhi_p.h:484
void assign(QByteArray data)
Definition qrhi_p.h:519
QRhiBufferData()=default
void assign(const char *s, quint32 size)
Definition qrhi_p.h:500
quint32 size() const
Definition qrhi_p.h:492
QRhiBufferData(const QRhiBufferData &other)
Definition qrhi_p.h:462
quint32 largeAlloc() const
Definition qrhi_p.h:496
QRhiBufferData(QRhiBufferData &&other) noexcept
Definition qrhi_p.h:468
QRhiBufferData & operator=(const QRhiBufferData &other)
Definition qrhi_p.h:473
const char * constData() const
Definition qrhi_p.h:488
const GLvoid const GLvoid GLenum
QRhiStats statistics() override
void releaseBufferNameCache()
bool contextLost
const QRhiNativeHandles * nativeHandles(QRhiCommandBuffer *cb) override
void drawIndexed(QRhiCommandBuffer *cb, quint32 indexCount, quint32 instanceCount, quint32 firstIndex, qint32 vertexOffset, quint32 firstInstance) override
QOpenGLContext * maybeShareContext
void gatherUniforms(GLuint program, const QShaderDescription::UniformBlock &ub, ActiveUniformLocationTracker *activeUniformLocations, QGles2UniformDescriptionVector *dst)
void trackedBufferBarrier(QGles2CommandBuffer *cbD, QGles2Buffer *bufD, QGles2Buffer::Access access)
void gatherBlockMemberUniforms(GLuint program, const QByteArray &prefix, int binding, const QList< QShaderDescription::BlockVariable > &members, ActiveUniformLocationTracker *activeUniformLocations, QGles2UniformDescriptionVector *dst)
QRhi::FrameOpResult beginFrame(QRhiSwapChain *swapChain, QRhi::BeginFrameFlags flags) override
const GLvoid GLenum
std::optional< QShaderVersion > commonGlslEsVersion(const QRhiShaderStage *stages, int stageCount) const
void enqueueBarriersForPass(QGles2CommandBuffer *cbD)
QList< DeferredReleaseEntry > releaseQueue
void drawIndirectCount(QRhiCommandBuffer *cb, QRhiBuffer *indirectBuffer, quint32 indirectBufferOffset, QRhiBuffer *countBuffer, quint32 countBufferOffset, quint32 maxDrawCount, quint32 stride) override
int resourceLimit(QRhi::ResourceLimit limit) const override
void setVertexInput(QRhiCommandBuffer *cb, int startBinding, int bindingCount, const QRhiCommandBuffer::VertexInput *bindings, QRhiBuffer *indexBuf, quint32 indexOffset, QRhiCommandBuffer::IndexFormat indexFormat) override
void(QOPENGLF_APIENTRYP glRenderbufferStorageMultisampleEXT)(GLenum
bool isFeatureSupported(QRhi::Feature feature) const override
static void setupUniformStateTracking(QGles2UniformDescriptionVector *uniforms, QGles2UniformDescriptionVector *pushConstantUniforms, QGles2UniformStateVector *uniformState)
QRhiGraphicsPipeline * createGraphicsPipeline() override
void bindShaderResources(QGles2CommandBuffer *cbD, QRhiGraphicsPipeline *maybeGraphicsPs, QRhiComputePipeline *maybeComputePs, QRhiShaderResourceBindings *srb, const uint *dynOfsPairs, int dynOfsCount)
bool create(QRhi::Flags flags) override
void trackedRegisterTexture(QRhiPassResourceTracker *passResTracker, QGles2Texture *texD, QRhiPassResourceTracker::TextureAccess access, QRhiPassResourceTracker::TextureStage stage)
void executeBindGraphicsPipeline(QGles2CommandBuffer *cbD, QGles2GraphicsPipeline *psD)
void dispatchIndirect(QRhiCommandBuffer *cb, QRhiBuffer *indirectBuffer, quint32 indirectBufferOffset) override
int bufferNameCacheCount
QRhiDriverInfo driverInfo() const override
GLuint ensureClearBufferProgram()
QSurfaceFormat requestedFormat
bool isProgramBinaryDiskCacheEnabled() const
void(QOPENGLF_APIENTRYP glFramebufferTextureMultisampleMultiviewOVR)(GLenum
bool needsMakeCurrentDueToSwap
QRhiShadingRateMap * createShadingRateMap() override
const void quint64 GLuint
void setUniformsFromBlock(const QGles2UniformDescriptionVector &uniforms, int binding, const char *blockData, qint64 blockSize, quint32 blockOffset, QGles2UniformState *uniformState)
void trackedImageBarrier(QGles2CommandBuffer *cbD, QGles2Texture *texD, QGles2Texture::Access access)
QOpenGLExtensions * f
void trackedRegisterBuffer(QRhiPassResourceTracker *passResTracker, QGles2Buffer *bufD, QRhiPassResourceTracker::BufferAccess access, QRhiPassResourceTracker::BufferStage stage)
void setShadingRate(QRhiCommandBuffer *cb, const QSize &coarsePixelSize) override
void gatherPushConstantUniforms(GLuint program, const QShaderDescription::PushConstantBlock &pcb, ActiveUniformLocationTracker *activeUniformLocations, QGles2UniformDescriptionVector *dst)
QRhiComputePipeline * createComputePipeline() override
QRhiDriverInfo driverInfoStruct
QSurface * evaluateFallbackSurface() const
void resourceUpdate(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override
void sanityCheckVertexFragmentInterface(const QShaderDescription &vsDesc, const QShaderDescription &fsDesc)
QRhiGles2NativeHandles nativeHandlesStruct
QMatrix4x4 clipSpaceCorrMatrix() const override
QRhi::FrameOpResult finish() override
void setComputePipeline(QRhiCommandBuffer *cb, QRhiComputePipeline *ps) override
const void * void(QOPENGLF_APIENTRYP glGetQueryObjectui64v)(GLuint
void(QOPENGLF_APIENTRYP glMultiDrawArraysIndirect)(GLenum
QList< int > supportedSampleCounts() const override
void gatherSamplers(GLuint program, const QShaderDescription::InOutVariable &v, QGles2SamplerDescriptionVector *dst)
QSet< GLint > supportedCompressedFormats
void(QOPENGLF_APIENTRYP glMultiDrawElementsIndirectCount)(GLenum
static constexpr quint32 MAX_PUSH_CONSTANTS_SIZE
QRhiSwapChain * createSwapChain() override
GLuint genBuffer()
void dispatch(QRhiCommandBuffer *cb, int x, int y, int z) override
QRhiBinaryCache< QByteArray, PipelineCacheData > m_pipelineCache
void destroy() override
QRhiRenderBuffer * createRenderBuffer(QRhiRenderBuffer::Type type, const QSize &pixelSize, int sampleCount, QRhiRenderBuffer::Flags flags, QRhiTexture::Format backingFormatHint) override
void executeCommandBuffer(QRhiCommandBuffer *cb)
void setGraphicsPipeline(QRhiCommandBuffer *cb, QRhiGraphicsPipeline *ps) override
QList< QShaderVersion > glslVersionsToTry() const
QSurface * fallbackSurface
QRhiGles2(QRhiGles2InitParams *params, QRhiGles2NativeHandles *importDevice=nullptr)
QRhi::Flags rhiFlags
void trySaveToDiskCache(GLuint program, const QByteArray &cacheKey)
GLbitfield barriersForNextDispatch(QGles2CommandBuffer *cbD)
QList< QSize > supportedShadingRates(int sampleCount) const override
void drawIndexedIndirectCount(QRhiCommandBuffer *cb, QRhiBuffer *indirectBuffer, quint32 indirectBufferOffset, QRhiBuffer *countBuffer, quint32 countBufferOffset, quint32 maxDrawCount, quint32 stride) override
void(QOPENGLF_APIENTRYP glTexSubImage1D)(GLenum
const void GLuint
QRhiTexture * createTexture(QRhiTexture::Format format, const QSize &pixelSize, int depth, int arraySize, int sampleCount, QRhiTexture::Flags flags) override
void bindCombinedSampler(QGles2CommandBuffer *cbD, QGles2Texture *texD, QGles2Sampler *samplerD, void *ps, uint psGeneration, int glslLocation, int *texUnit, bool *activeTexUnitAltered)
void setViewport(QRhiCommandBuffer *cb, const QRhiViewport &viewport) override
QRhiTextureRenderTarget * createTextureRenderTarget(const QRhiTextureRenderTargetDescription &desc, QRhiTextureRenderTarget::Flags flags) override
QByteArray shaderSource(const QRhiShaderStage &shaderStage, QShaderVersion *shaderVersion, std::optional< QShaderVersion > commonVersion=std::nullopt)
void(QOPENGLF_APIENTRYP glMultiDrawElementsIndirect)(GLenum
QOpenGLContext * ctx
QRhiSampler * createSampler(QRhiSampler::Filter magFilter, QRhiSampler::Filter minFilter, QRhiSampler::Filter mipmapMode, QRhiSampler::AddressMode u, QRhiSampler::AddressMode v, QRhiSampler::AddressMode w) override
void beginPass(QRhiCommandBuffer *cb, QRhiRenderTarget *rt, const QColor &colorClearValue, const QRhiDepthStencilClearValue &depthStencilClearValue, QRhiResourceUpdateBatch *resourceUpdates, QRhiCommandBuffer::BeginPassFlags flags) override
QGles2SwapChain * currentSwapChain
bool isDeviceLost() const override
QRhiShaderResourceBindings * createShaderResourceBindings() override
void drawIndexedIndirect(QRhiCommandBuffer *cb, QRhiBuffer *indirectBuffer, quint32 indirectBufferOffset, quint32 drawCount, quint32 stride) override
void drawIndirect(QRhiCommandBuffer *cb, QRhiBuffer *indirectBuffer, quint32 indirectBufferOffset, quint32 drawCount, quint32 stride) override
bool isYUpInNDC() const override
void debugMarkBegin(QRhiCommandBuffer *cb, const QByteArray &name) override
void enqueueResourceUpdates(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates)
void setQueueSubmitParams(QRhiNativeHandles *params) override
std::array< GLuint, 8 > bufferNameCache
bool makeThreadLocalNativeContextCurrent() override
int ubufAlignment() const override
void beginExternal(QRhiCommandBuffer *cb) override
const GLvoid GLint
void endExternal(QRhiCommandBuffer *cb) override
bool isTextureFormatSupported(QRhiTexture::Format format, QRhiTexture::Flags flags) const override
ProgramCacheResult tryLoadFromDiskOrPipelineCache(const QRhiShaderStage *stages, int stageCount, GLuint program, const QVector< QShaderDescription::InOutVariable > &inputVars, QByteArray *cacheKey, std::optional< QShaderVersion > commonVersion=std::nullopt)
QRhiBuffer * createBuffer(QRhiBuffer::Type type, QRhiBuffer::UsageFlags usage, quint32 size) override
void(QOPENGLF_APIENTRYP glCompressedTexImage1D)(GLenum
bool importedContext
void(QOPENGLF_APIENTRYP glDrawElementsInstancedBaseVertexBaseInstance)(GLenum
void setScissor(QRhiCommandBuffer *cb, const QRhiScissor &scissor) override
void setUniformValue(const QGles2UniformDescription &uniform, const void *src, QGles2UniformState *uniformState)
void setStencilRef(QRhiCommandBuffer *cb, quint32 refValue) override
bool ensureContext(QSurface *surface=nullptr) const
void draw(QRhiCommandBuffer *cb, quint32 vertexCount, quint32 instanceCount, quint32 firstVertex, quint32 firstInstance) override
void endComputePass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override
void(QOPENGLF_APIENTRYP glQueryCounter)(GLuint
QHash< std::pair< QRhiShaderStage, QShaderVersion >, uint > m_shaderCache
void(QOPENGLF_APIENTRYP glDrawArraysInstancedBaseInstance)(GLenum
void beginComputePass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates, QRhiCommandBuffer::BeginPassFlags flags) override
void endPass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override
bool isYUpInFramebuffer() const override
bool linkProgram(GLuint program)
void debugMarkMsg(QRhiCommandBuffer *cb, const QByteArray &msg) override
QGles2RenderTargetData * enqueueBindFramebuffer(QRhiRenderTarget *rt, QGles2CommandBuffer *cbD, bool *wantsColorClear=nullptr, bool *wantsDsClear=nullptr)
void debugMarkEnd(QRhiCommandBuffer *cb) override
bool clearBufferProgramFailed
void setBlendConstants(QRhiCommandBuffer *cb, const QColor &c) override
void registerUniformIfActive(const QShaderDescription::BlockVariable &var, const QByteArray &namePrefix, int binding, int baseOffset, GLuint program, ActiveUniformLocationTracker *activeUniformLocations, QGles2UniformDescriptionVector *dst)
void setShaderResources(QRhiCommandBuffer *cb, QRhiShaderResourceBindings *srb, int dynamicOffsetCount, const QRhiCommandBuffer::DynamicOffset *dynamicOffsets) override
void releaseCachedResources() override
bool isClipDepthZeroToOne() const override
void trySaveToPipelineCache(GLuint program, const QByteArray &cacheKey, bool force=false)
bool compileShader(GLuint program, const QRhiShaderStage &shaderStage, QShaderVersion *shaderVersion, std::optional< QShaderVersion > commonVersion=std::nullopt)
void executeDeferredReleases()
QByteArray pipelineCacheData() override
GLint clearBufferUniformLoc[3]
double lastCompletedGpuTime(QRhiCommandBuffer *cb) override
QRhi::FrameOpResult beginOffscreenFrame(QRhiCommandBuffer **cb, QRhi::BeginFrameFlags flags) override
QList< int > supportedSampleCountList
QPointer< QWindow > maybeWindow
void enqueueSubresUpload(QGles2Texture *texD, QGles2CommandBuffer *cbD, int layer, int level, const QRhiTextureSubresourceUploadDescription &subresDesc)
GLuint clearBufferProgram
void setPushConstants(QRhiCommandBuffer *cb, quint32 offset, quint32 size, const void *data) override
QRhi::FrameOpResult endFrame(QRhiSwapChain *swapChain, QRhi::EndFrameFlags flags) override
void setPipelineCacheData(const QByteArray &data) override
QRhi::FrameOpResult endOffscreenFrame(QRhi::EndFrameFlags flags) override
void gatherGeneratedSamplers(GLuint program, const QShader::SeparateToCombinedImageSamplerMapping &mapping, QGles2SamplerDescriptionVector *dst)
const QRhiNativeHandles * nativeHandles() override
void setShaderResources(QRhiCommandBuffer *cb, QRhiShaderResourceBindings *srb, int dynamicOffsetCount, const QRhiCommandBuffer::DynamicOffset *dynamicOffsets) override
Definition qrhinull.cpp:267
double lastCompletedGpuTime(QRhiCommandBuffer *cb) override
Definition qrhinull.cpp:452
QRhi::FrameOpResult endOffscreenFrame(QRhi::EndFrameFlags flags) override
Definition qrhinull.cpp:481
void setPushConstants(QRhiCommandBuffer *cb, quint32 offset, quint32 size, const void *data) override
Definition qrhinull.cpp:314
void dispatchIndirect(QRhiCommandBuffer *cb, QRhiBuffer *indirectBuffer, quint32 indirectBufferOffset) override
Definition qrhinull.cpp:428
bool isFeatureSupported(QRhi::Feature feature) const override
Definition qrhinull.cpp:114
QRhiNull(QRhiNullInitParams *params)
Definition qrhinull.cpp:45
void debugMarkMsg(QRhiCommandBuffer *cb, const QByteArray &msg) override
Definition qrhinull.cpp:408
void dispatch(QRhiCommandBuffer *cb, int x, int y, int z) override
Definition qrhinull.cpp:420
QRhi::FrameOpResult beginFrame(QRhiSwapChain *swapChain, QRhi::BeginFrameFlags flags) override
Definition qrhinull.cpp:458
void resourceUpdate(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override
Definition qrhinull.cpp:566
void drawIndexed(QRhiCommandBuffer *cb, quint32 indexCount, quint32 instanceCount, quint32 firstIndex, qint32 vertexOffset, quint32 firstInstance) override
Definition qrhinull.cpp:338
void beginComputePass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates, QRhiCommandBuffer::BeginPassFlags flags) override
Definition qrhinull.cpp:669
void beginPass(QRhiCommandBuffer *cb, QRhiRenderTarget *rt, const QColor &colorClearValue, const QRhiDepthStencilClearValue &depthStencilClearValue, QRhiResourceUpdateBatch *resourceUpdates, QRhiCommandBuffer::BeginPassFlags flags) override
Definition qrhinull.cpp:642
void setQueueSubmitParams(QRhiNativeHandles *params) override
Definition qrhinull.cpp:189
bool isClipDepthZeroToOne() const override
Definition qrhinull.cpp:97
void endComputePass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override
Definition qrhinull.cpp:678
QNullCommandBuffer offscreenCommandBuffer
Definition qrhinull_p.h:313
void endPass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override
Definition qrhinull.cpp:663
QRhi::FrameOpResult endFrame(QRhiSwapChain *swapChain, QRhi::EndFrameFlags flags) override
Definition qrhinull.cpp:465
QRhi::FrameOpResult beginOffscreenFrame(QRhiCommandBuffer **cb, QRhi::BeginFrameFlags flags) override
Definition qrhinull.cpp:474
bool isYUpInNDC() const override
Definition qrhinull.cpp:92
QRhiDriverInfo driverInfo() const override
Definition qrhinull.cpp:171
void setScissor(QRhiCommandBuffer *cb, const QRhiScissor &scissor) override
Definition qrhinull.cpp:296
void simulateTextureUpload(const QRhiResourceUpdateBatchPrivate::TextureOp &u)
Definition qrhinull.cpp:492
QRhiComputePipeline * createComputePipeline() override
Definition qrhinull.cpp:251
void setPipelineCacheData(const QByteArray &data) override
Definition qrhinull.cpp:209
void setVertexInput(QRhiCommandBuffer *cb, int startBinding, int bindingCount, const QRhiCommandBuffer::VertexInput *bindings, QRhiBuffer *indexBuf, quint32 indexOffset, QRhiCommandBuffer::IndexFormat indexFormat) override
Definition qrhinull.cpp:277
void debugMarkBegin(QRhiCommandBuffer *cb, const QByteArray &name) override
Definition qrhinull.cpp:397
void draw(QRhiCommandBuffer *cb, quint32 vertexCount, quint32 instanceCount, quint32 firstVertex, quint32 firstInstance) override
Definition qrhinull.cpp:328
QByteArray pipelineCacheData() override
Definition qrhinull.cpp:204
void drawIndirectCount(QRhiCommandBuffer *cb, QRhiBuffer *indirectBuffer, quint32 indirectBufferOffset, QRhiBuffer *countBuffer, quint32 countBufferOffset, quint32 maxDrawCount, quint32 stride) override
Definition qrhinull.cpp:369
void drawIndexedIndirectCount(QRhiCommandBuffer *cb, QRhiBuffer *indirectBuffer, quint32 indirectBufferOffset, QRhiBuffer *countBuffer, quint32 countBufferOffset, quint32 maxDrawCount, quint32 stride) override
Definition qrhinull.cpp:383
void destroy() override
Definition qrhinull.cpp:57
const QRhiNativeHandles * nativeHandles() override
Definition qrhinull.cpp:166
void setGraphicsPipeline(QRhiCommandBuffer *cb, QRhiGraphicsPipeline *ps) override
Definition qrhinull.cpp:261
void releaseCachedResources() override
Definition qrhinull.cpp:194
void simulateTextureCopy(const QRhiResourceUpdateBatchPrivate::TextureOp &u)
Definition qrhinull.cpp:542
QRhiTexture * createTexture(QRhiTexture::Format format, const QSize &pixelSize, int depth, int arraySize, int sampleCount, QRhiTexture::Flags flags) override
Definition qrhinull.cpp:221
QList< QSize > supportedShadingRates(int sampleCount) const override
Definition qrhinull.cpp:66
void simulateTextureGenMips(const QRhiResourceUpdateBatchPrivate::TextureOp &u)
Definition qrhinull.cpp:557
void setShadingRate(QRhiCommandBuffer *cb, const QSize &coarsePixelSize) override
Definition qrhinull.cpp:322
QRhiRenderBuffer * createRenderBuffer(QRhiRenderBuffer::Type type, const QSize &pixelSize, int sampleCount, QRhiRenderBuffer::Flags flags, QRhiTexture::Format backingFormatHint) override
Definition qrhinull.cpp:214
bool makeThreadLocalNativeContextCurrent() override
Definition qrhinull.cpp:183
void drawIndirect(QRhiCommandBuffer *cb, QRhiBuffer *indirectBuffer, quint32 indirectBufferOffset, quint32 drawCount, quint32 stride) override
Definition qrhinull.cpp:349
const QRhiNativeHandles * nativeHandles(QRhiCommandBuffer *cb) override
Definition qrhinull.cpp:436
QRhiNullNativeHandles nativeHandlesStruct
Definition qrhinull_p.h:311
bool isYUpInFramebuffer() const override
Definition qrhinull.cpp:87
QRhi::FrameOpResult finish() override
Definition qrhinull.cpp:487
void setComputePipeline(QRhiCommandBuffer *cb, QRhiComputePipeline *ps) override
Definition qrhinull.cpp:414
QRhiBuffer * createBuffer(QRhiBuffer::Type type, QRhiBuffer::UsageFlags usage, quint32 size) override
Definition qrhinull.cpp:77
QRhiStats statistics() override
Definition qrhinull.cpp:178
QRhiShadingRateMap * createShadingRateMap() override
Definition qrhinull.cpp:241
void beginExternal(QRhiCommandBuffer *cb) override
Definition qrhinull.cpp:442
QRhiSwapChain * createSwapChain() override
Definition qrhinull.cpp:72
void setViewport(QRhiCommandBuffer *cb, const QRhiViewport &viewport) override
Definition qrhinull.cpp:290
QRhiTextureRenderTarget * createTextureRenderTarget(const QRhiTextureRenderTargetDescription &desc, QRhiTextureRenderTarget::Flags flags) override
Definition qrhinull.cpp:235
QRhiGraphicsPipeline * createGraphicsPipeline() override
Definition qrhinull.cpp:246
bool create(QRhi::Flags flags) override
Definition qrhinull.cpp:51
void setStencilRef(QRhiCommandBuffer *cb, quint32 refValue) override
Definition qrhinull.cpp:308
void debugMarkEnd(QRhiCommandBuffer *cb) override
Definition qrhinull.cpp:403
QList< int > supportedSampleCounts() const override
Definition qrhinull.cpp:61
QMatrix4x4 clipSpaceCorrMatrix() const override
Definition qrhinull.cpp:102
QRhiSampler * createSampler(QRhiSampler::Filter magFilter, QRhiSampler::Filter minFilter, QRhiSampler::Filter mipmapMode, QRhiSampler::AddressMode u, QRhiSampler::AddressMode v, QRhiSampler::AddressMode w) override
Definition qrhinull.cpp:228
void drawIndexedIndirect(QRhiCommandBuffer *cb, QRhiBuffer *indirectBuffer, quint32 indirectBufferOffset, quint32 drawCount, quint32 stride) override
Definition qrhinull.cpp:359
QRhiSwapChain * currentSwapChain
Definition qrhinull_p.h:312
int ubufAlignment() const override
Definition qrhinull.cpp:82
bool isTextureFormatSupported(QRhiTexture::Format format, QRhiTexture::Flags flags) const override
Definition qrhinull.cpp:107
int resourceLimit(QRhi::ResourceLimit limit) const override
Definition qrhinull.cpp:120
QRhiShaderResourceBindings * createShaderResourceBindings() override
Definition qrhinull.cpp:256
void setBlendConstants(QRhiCommandBuffer *cb, const QColor &c) override
Definition qrhinull.cpp:302
void endExternal(QRhiCommandBuffer *cb) override
Definition qrhinull.cpp:447
bool isDeviceLost() const override
Definition qrhinull.cpp:199
iterator end()
Definition qrhi_p.h:850
value_type * iterator
Definition qrhi_p.h:846
const value_type * const_iterator
Definition qrhi_p.h:847
bool isEmpty() const
Definition qrhi_p.h:856
iterator find(Key key)
Definition qrhi_p.h:875
const_iterator end() const
Definition qrhi_p.h:852
void append(Key key, const T &value)
Definition qrhi_p.h:884
const_iterator find(Key key) const
Definition qrhi_p.h:865
qsizetype size() const
Definition qrhi_p.h:857
std::pair< Key, T > value_type
Definition qrhi_p.h:845
const_iterator begin() const
Definition qrhi_p.h:851
bool contains(Key key) const
Definition qrhi_p.h:881
const_iterator cend() const
Definition qrhi_p.h:854
iterator begin()
Definition qrhi_p.h:849
const_iterator cbegin() const
Definition qrhi_p.h:853
static TextureStage toPassTrackerTextureStage(QRhiShaderResourceBinding::StageFlags stages)
Definition qrhi.cpp:13930
static BufferStage toPassTrackerBufferStage(QRhiShaderResourceBinding::StageFlags stages)
Definition qrhi.cpp:13911
bool isEmpty() const
Definition qrhi.cpp:13820
const QRhiPassResourceMap< QRhiTexture *, Texture, 12 > & textures() const
Definition qrhi_p.h:978
void registerBuffer(QRhiBuffer *buf, int slot, BufferAccess *access, BufferStage *stage, const UsageState &state)
Definition qrhi.cpp:13837
void registerTexture(QRhiTexture *tex, TextureAccess *access, TextureStage *stage, const UsageState &state)
Definition qrhi.cpp:13877
const QRhiPassResourceMap< QRhiBuffer *, Buffer, 12 > & buffers() const
Definition qrhi_p.h:970
QRhiPipelineCacheDataReader(const char *data, quint32 size)
Definition qrhi_p.h:1111
bool readByteArray(QByteArray *dst)
Definition qrhi_p.h:1126
bool readUInt32(quint32 *dst)
Definition qrhi_p.h:1116
QVarLengthArray< BufferOp, BUFFER_OPS_STATIC_ALLOC > bufferOps
Definition qrhi_p.h:741
QRhiImplementation * rhi
Definition qrhi_p.h:748
QVarLengthArray< TextureOp, TEXTURE_OPS_STATIC_ALLOC > textureOps
Definition qrhi_p.h:745
static const int BUFFER_OPS_STATIC_ALLOC
Definition qrhi_p.h:740
static QRhiResourceUpdateBatchPrivate * get(QRhiResourceUpdateBatch *b)
Definition qrhi_p.h:756
void merge(QRhiResourceUpdateBatchPrivate *other)
Definition qrhi.cpp:11559
QRhiResourceUpdateBatch * q
Definition qrhi_p.h:747
static const int TEXTURE_OPS_STATIC_ALLOC
Definition qrhi_p.h:744
Combined button and popup list for selecting options.
QDebug operator<<(QDebug dbg, const QFileInfo &fi)
#define QOPENGLF_APIENTRYP
Definition qopengl.h:275
static const char * resourceTypeStr(const QRhiResource *res)
Definition qrhi.cpp:9610
static QRhiPassResourceTracker::BufferStage earlierStage(QRhiPassResourceTracker::BufferStage a, QRhiPassResourceTracker::BufferStage b)
Definition qrhi.cpp:13831
QDebug operator<<(QDebug dbg, const QRhiSwapChainHdrInfo &info)
Definition qrhi.cpp:8656
static bool isImageLoadStore(QRhiPassResourceTracker::TextureAccess access)
Definition qrhi.cpp:13870
static const char * deviceTypeStr(QRhiDriverInfo::DeviceType type)
\variable QRhiDriverInfo::deviceName
Definition qrhi.cpp:10613
static auto & emplaceData(QRhiShaderResourceBinding::Data &d)
Definition qrhi.cpp:6321
static QRhiPassResourceTracker::TextureStage earlierStage(QRhiPassResourceTracker::TextureStage a, QRhiPassResourceTracker::TextureStage b)
Definition qrhi.cpp:13864
QRhiTargetRectBoundMode
Definition qrhi_p.h:391
@ UnBounded
Definition qrhi_p.h:392
@ Bounded
Definition qrhi_p.h:393
Q_DECLARE_TYPEINFO(QRhiPassResourceTracker::Texture, Q_RELOCATABLE_TYPE)
Q_DECLARE_TYPEINFO(QRhiBufferData, Q_RELOCATABLE_TYPE)
T * qrhi_objectFromProxyData(QRhiSwapChainProxyData *pd, QWindow *window, QRhi::Implementation impl, uint objectIndex)
Definition qrhi_p.h:1100
bool operator!=(const QRhiRenderTargetAttachmentTracker::ResId &a, const QRhiRenderTargetAttachmentTracker::ResId &b)
Definition qrhi_p.h:1040
Q_DECLARE_TYPEINFO(QRhiPassResourceTracker::Buffer, Q_RELOCATABLE_TYPE)
#define QRHI_RES(t, x)
Definition qrhi_p.h:32
bool operator==(const QRhiRenderTargetAttachmentTracker::ResId &a, const QRhiRenderTargetAttachmentTracker::ResId &b)
Definition qrhi_p.h:1035
quint32 qrhiBinaryCacheEntryByteSize(const QByteArray &data)
Definition qrhi_p.h:311
bool qrhi_toTopLeftRenderTargetRect(const QSize &outputSize, const std::array< T, N > &r, T *x, T *y, T *w, T *h)
Definition qrhi_p.h:397
bool operator!=(const QGles2CommandBuffer::GraphicsPassState::Blend &a, const QGles2CommandBuffer::GraphicsPassState::Blend &b)
bool operator!=(const QGles2SamplerData &a, const QGles2SamplerData &b)
bool operator==(const QGles2CommandBuffer::GraphicsPassState::StencilFace &a, const QGles2CommandBuffer::GraphicsPassState::StencilFace &b)
bool operator==(const QGles2CommandBuffer::GraphicsPassState::Blend &a, const QGles2CommandBuffer::GraphicsPassState::Blend &b)
Q_DECLARE_TYPEINFO(QRhiGles2::DeferredReleaseEntry, Q_RELOCATABLE_TYPE)
bool operator!=(const QGles2CommandBuffer::GraphicsPassState::ColorMask &a, const QGles2CommandBuffer::GraphicsPassState::ColorMask &b)
bool operator==(const QGles2CommandBuffer::GraphicsPassState::ColorMask &a, const QGles2CommandBuffer::GraphicsPassState::ColorMask &b)
Q_DECLARE_TYPEINFO(QGles2SamplerDescription, Q_RELOCATABLE_TYPE)
bool operator==(const QGles2SamplerData &a, const QGles2SamplerData &b)
Definition qrhigles2_p.h:95
bool operator!=(const QGles2CommandBuffer::GraphicsPassState::StencilFace &a, const QGles2CommandBuffer::GraphicsPassState::StencilFace &b)
Q_DECLARE_TYPEINFO(QGles2UniformState, Q_PRIMITIVE_TYPE)
Q_DECLARE_TYPEINFO(QGles2UniformDescription, Q_RELOCATABLE_TYPE)
quint32 qrhiBinaryCacheEntryByteSize(const QRhiGles2::PipelineCacheData &d)
constexpr size_t qHash(const QSize &s, size_t seed=0) noexcept
Definition qsize.h:192
QGles2Buffer(QRhiImplementation *rhi, Type type, UsageFlags usage, quint32 size)
@ AccessStorageReadWrite
Definition qrhigles2_p.h:55
QByteArray data
Definition qrhigles2_p.h:47
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
char * beginFullDynamicBufferUpdateForCurrentFrame() override
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.
GLenum targetForDataOps
Definition qrhigles2_p.h:46
quint32 nonZeroSize
Definition qrhigles2_p.h:44
void fullDynamicBufferUpdateForCurrentFrame(const void *data, quint32 size) override
UsageState usageState
Definition qrhigles2_p.h:62
GLuint buffer
Definition qrhigles2_p.h:45
QVarLengthArray< QImage, 4 > imageRetainPool
QRhiShaderResourceBindings * currentGraphicsSrb
QVarLengthArray< QRhiBufferData, 4 > bufferDataRetainPool
bool passStorageAccessFragmentOnly
QRhiBackendCommandList< Command > commands
QRhiComputePipeline * currentComputePipeline
QRhiRenderTarget * currentTarget
QRhiShaderResourceBindings * currentComputeSrb
QVarLengthArray< QRhiPassResourceTracker, 8 > passResTrackers
QVarLengthArray< char, 128 > pushConstantData
QGles2CommandBuffer(QRhiImplementation *rhi)
const void * retainImage(const QImage &image)
const void * retainData(const QByteArray &data)
QVarLengthArray< char, 1024 > pushConstantPool
QVarLengthArray< uint, 32 > dynamicOffsetPool
const uchar * retainBufferData(const QRhiBufferData &data)
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
QRhiGraphicsPipeline * currentGraphicsPipeline
QVarLengthArray< QByteArray, 4 > dataRetainPool
QGles2UniformDescriptionVector pushConstantUniforms
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
QGles2UniformDescriptionVector uniforms
QRhiShaderResourceBindings * currentSrb
QGles2UniformStateVector uniformState
QGles2ComputePipeline(QRhiImplementation *rhi)
QGles2SamplerDescriptionVector samplers
bool create() override
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
QGles2SamplerDescriptionVector samplers
bool create() override
Creates the corresponding native graphics resources.
QGles2GraphicsPipeline(QRhiImplementation *rhi)
QGles2UniformDescriptionVector pushConstantUniforms
QGles2UniformStateVector uniformState
QRhiShaderResourceBindings * currentSrb
QGles2UniformDescriptionVector uniforms
bool create() override
Creates the corresponding native graphics resources.
QGles2RenderBuffer(QRhiImplementation *rhi, Type type, const QSize &pixelSize, int sampleCount, QRhiRenderBuffer::Flags flags, QRhiTexture::Format backingFormatHint)
bool createFrom(NativeRenderBuffer src) override
Similar to create() except that no new native renderbuffer objects are created.
QRhiTexture::Format backingFormat() const override
GLuint stencilRenderbuffer
Definition qrhigles2_p.h:78
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
QVector< quint32 > serializedFormat() const override
QRhiRenderPassDescriptor * newCompatibleRenderPassDescriptor() const override
bool isCompatible(const QRhiRenderPassDescriptor *other) const override
QGles2RenderPassDescriptor(QRhiImplementation *rhi)
QGles2RenderTargetData(QRhiImplementation *)
std::optional< QRhiSwapChain::StereoTargetBuffer > stereoTarget
QGles2RenderPassDescriptor * rp
QRhiRenderTargetAttachmentTracker::ResIdList currentResIdList
GLenum gltexcomparefunc
Definition qrhigles2_p.h:92
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
bool create() override
QGles2SamplerData d
QGles2Sampler(QRhiImplementation *rhi, Filter magFilter, Filter minFilter, Filter mipmapMode, AddressMode u, AddressMode v, AddressMode w)
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
void updateResources(UpdateFlags flags) override
bool create() override
Creates the corresponding resource binding set.
QGles2ShaderResourceBindings(QRhiImplementation *rhi)
float devicePixelRatio() const override
QGles2SwapChainRenderTarget(QRhiImplementation *rhi, QRhiSwapChain *swapchain)
QSize pixelSize() const override
int sampleCount() const override
QGles2RenderTargetData d
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
void prepare(QRhiGles2 *rhiD)
bool active[TIMESTAMP_PAIRS]
bool tryQueryTimestamps(int pairIndex, QRhiGles2 *rhiD, double *elapsedSec)
static const int TIMESTAMP_PAIRS
GLuint query[TIMESTAMP_PAIRS *2]
void destroy(QRhiGles2 *rhiD)
void initSwapChainRenderTarget(QGles2SwapChainRenderTarget *rt)
QGles2SwapChainRenderTarget rtRight
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
QGles2CommandBuffer cb
QGles2SwapChainRenderTarget rt
QSurface * surface
QRhiRenderPassDescriptor * newCompatibleRenderPassDescriptor() override
int currentTimestampPairIndex
bool isFormatSupported(Format f) override
bool createOrResize() override
Creates the swapchain if not already done and resizes the swapchain buffers to match the current size...
QGles2SwapChainTimestamps timestamps
QGles2SwapChain(QRhiImplementation *rhi)
QRhiCommandBuffer * currentFrameCommandBuffer() override
QRhiRenderTarget * currentFrameRenderTarget(StereoTargetBuffer targetBuffer) override
QGles2SwapChainRenderTarget rtLeft
QSize surfacePixelSize() override
QRhiRenderTarget * currentFrameRenderTarget() override
int sampleCount() const override
QGles2TextureRenderTarget(QRhiImplementation *rhi, const QRhiTextureRenderTargetDescription &desc, Flags flags)
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
float devicePixelRatio() const override
QSize pixelSize() const override
QRhiRenderPassDescriptor * newCompatibleRenderPassDescriptor() override
bool create() override
Creates the corresponding native graphics resources.
QGles2RenderTargetData d
bool createFrom(NativeTexture src) override
Similar to create(), except that no new native textures are created.
QGles2Texture(QRhiImplementation *rhi, Format format, const QSize &pixelSize, int depth, int arraySize, int sampleCount, Flags flags)
bool isLevelAllocated(int face, int level) const
QGles2SamplerData samplerState
GLenum glsizedintformat
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
UsageState usageState
bool prepareCreate(QSize *adjustedSize=nullptr)
GLenum glintformat
quint32 allocatedLevels[6]
bool create() override
Creates the corresponding native graphics resources.
NativeTexture nativeTexture() override
char * data
Definition qrhinull_p.h:31
QNullBuffer(QRhiImplementation *rhi, Type type, UsageFlags usage, quint32 size)
Definition qrhinull.cpp:684
bool create() override
Creates the corresponding native graphics resources.
Definition qrhinull.cpp:704
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
Definition qrhinull.cpp:694
char * beginFullDynamicBufferUpdateForCurrentFrame() override
Definition qrhinull.cpp:718
QNullCommandBuffer(QRhiImplementation *rhi)
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
bool create() override
QNullComputePipeline(QRhiImplementation *rhi)
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
bool create() override
Creates the corresponding native graphics resources.
QNullGraphicsPipeline(QRhiImplementation *rhi)
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
Definition qrhinull.cpp:736
bool create() override
Creates the corresponding native graphics resources.
Definition qrhinull.cpp:745
QNullRenderBuffer(QRhiImplementation *rhi, Type type, const QSize &pixelSize, int sampleCount, QRhiRenderBuffer::Flags flags, QRhiTexture::Format backingFormatHint)
Definition qrhinull.cpp:724
QRhiTexture::Format backingFormat() const override
Definition qrhinull.cpp:759
QNullRenderPassDescriptor(QRhiImplementation *rhi)
Definition qrhinull.cpp:869
QRhiRenderPassDescriptor * newCompatibleRenderPassDescriptor() const override
Definition qrhinull.cpp:892
QVector< quint32 > serializedFormat() const override
Definition qrhinull.cpp:900
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
Definition qrhinull.cpp:879
bool isCompatible(const QRhiRenderPassDescriptor *other) const override
Definition qrhinull.cpp:886
QRhiRenderTargetAttachmentTracker::ResIdList currentResIdList
Definition qrhinull_p.h:88
QNullRenderPassDescriptor * rp
Definition qrhinull_p.h:85
QNullRenderTargetData(QRhiImplementation *)
Definition qrhinull_p.h:83
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
Definition qrhinull.cpp:855
QNullSampler(QRhiImplementation *rhi, Filter magFilter, Filter minFilter, Filter mipmapMode, AddressMode u, AddressMode v, AddressMode w)
Definition qrhinull.cpp:844
bool create() override
Definition qrhinull.cpp:862
QNullShaderResourceBindings(QRhiImplementation *rhi)
bool create() override
Creates the corresponding resource binding set.
void updateResources(UpdateFlags flags) override
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
QSize pixelSize() const override
Definition qrhinull.cpp:920
float devicePixelRatio() const override
Definition qrhinull.cpp:925
QNullRenderTargetData d
Definition qrhinull_p.h:101
QNullSwapChainRenderTarget(QRhiImplementation *rhi, QRhiSwapChain *swapchain)
Definition qrhinull.cpp:905
int sampleCount() const override
Definition qrhinull.cpp:930
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
Definition qrhinull.cpp:916
bool createOrResize() override
Creates the swapchain if not already done and resizes the swapchain buffers to match the current size...
QWindow * window
Definition qrhinull_p.h:167
QSize surfacePixelSize() override
QNullSwapChainRenderTarget rt
Definition qrhinull_p.h:168
bool isFormatSupported(Format f) override
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
QRhiCommandBuffer * currentFrameCommandBuffer() override
QRhiRenderPassDescriptor * newCompatibleRenderPassDescriptor() override
QRhiRenderTarget * currentFrameRenderTarget() override
QNullSwapChain(QRhiImplementation *rhi)
QNullCommandBuffer cb
Definition qrhinull_p.h:169
QSize pixelSize() const override
Definition qrhinull.cpp:982
int sampleCount() const override
Definition qrhinull.cpp:995
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
Definition qrhinull.cpp:948
QRhiRenderPassDescriptor * newCompatibleRenderPassDescriptor() override
Definition qrhinull.cpp:955
bool create() override
Creates the corresponding native graphics resources.
Definition qrhinull.cpp:963
QNullTextureRenderTarget(QRhiImplementation *rhi, const QRhiTextureRenderTargetDescription &desc, Flags flags)
Definition qrhinull.cpp:935
QNullRenderTargetData d
Definition qrhinull_p.h:117
float devicePixelRatio() const override
Definition qrhinull.cpp:990
bool create() override
Creates the corresponding native graphics resources.
Definition qrhinull.cpp:784
bool createFrom(NativeTexture src) override
Similar to create(), except that no new native textures are created.
Definition qrhinull.cpp:828
QVarLengthArray< std::array< QImage, QRhi::MAX_MIP_LEVELS >, 6 > image
Definition qrhinull_p.h:58
QNullTexture(QRhiImplementation *rhi, Format format, const QSize &pixelSize, int depth, int arraySize, int sampleCount, Flags flags)
Definition qrhinull.cpp:764
uint generation
Definition qrhinull_p.h:59
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
Definition qrhinull.cpp:775
bool operator!=(const Batch &other) const
Definition qrhi_p.h:796
QVector< T > resources
Definition qrhi_p.h:789
bool operator==(const Batch &other) const
Definition qrhi_p.h:791
void feed(int binding, T resource)
Definition qrhi_p.h:762
QVector< Batch > batches
Definition qrhi_p.h:805
bool operator!=(const QRhiBatchedBindings< T > &other) const
Definition qrhi_p.h:812
bool operator==(const QRhiBatchedBindings< T > &other) const
Definition qrhi_p.h:807
void insertWithCapacityLimit(const Key &key, const Value &value)
Definition qrhi_p.h:332
quint32 dataByteSize
Definition qrhi_p.h:323
void clear()
Definition qrhi_p.h:326
const char * name
Definition qrhi_p.h:324
QHash< Key, Value > data
Definition qrhi_p.h:322
QRhiBinaryCache(const char *name)
Definition qrhi_p.h:320
char smallData[SMALL_DATA_SIZE]
Definition qrhi_p.h:449
QByteArray largeData
Definition qrhi_p.h:447
static constexpr quint32 SMALL_DATA_SIZE
Definition qrhi_p.h:448
void(*) frameEnd(QRhiImplementation *d, QRhiSwapChain *swapChain, QRhiCommandBuffer *cb)
Definition qrhi_p.h:363
void(*) rhiAboutToBeDestroyed(QRhiImplementation *d)
Definition qrhi_p.h:364
uint needsDepthStencilCombinedAttach
uint perRenderTargetBlending
int maxThreadGroupsPerDimension
uint glesMultisampleRenderToTexture
uint srgbTextureRenderTarget
uint multisampledTextureStorage
int maxFragmentStorageBuffers
uint fixedIndexPrimitiveRestart
uint screenSpaceDerivatives
uint nonBaseLevelFramebufferTexture
uint glesMultiviewMultisampleRenderToTexture
OffscreenFrame(QRhiImplementation *rhi)
QGles2CommandBuffer cbWrapper
QVarLengthArray< data32_t, 128 > packedArray
QVarLengthArray< SeparateTexture, 8 > separateTextureBindings
QVarLengthArray< SeparateSampler, 4 > separateSamplerBindings
static void updateResIdList(const QRhiTextureRenderTargetDescription &desc, ResIdList *dst)
Definition qrhi_p.h:1046
static bool isUpToDate(const QRhiTextureRenderTargetDescription &desc, const ResIdList &currentResIdList)
Definition qrhi_p.h:1084
static void changeToDynamicUpdate(BufferOp *op, QRhiBuffer *buf, quint32 offset, QByteArray data)
Definition qrhi_p.h:586
static void changeToStaticUpload(BufferOp *op, QRhiBuffer *buf, quint32 offset, QByteArray data)
Definition qrhi_p.h:617
static BufferOp clear(QRhiBuffer *buf, quint32 offset, quint32 size, quint8 value)
Definition qrhi_p.h:649
static void changeToStaticUpload(BufferOp *op, QRhiBuffer *buf, quint32 offset, quint32 size, const void *data)
Definition qrhi_p.h:601
static BufferOp dynamicUpdate(QRhiBuffer *buf, quint32 offset, QByteArray data)
Definition qrhi_p.h:579
static BufferOp staticUpload(QRhiBuffer *buf, quint32 offset, QByteArray data)
Definition qrhi_p.h:610
static BufferOp copy(QRhiBuffer *dst, QRhiBuffer *src, quint32 dstOffset, quint32 srcOffset, quint32 size)
Definition qrhi_p.h:636
static BufferOp staticUpload(QRhiBuffer *buf, quint32 offset, quint32 size, const void *data)
Definition qrhi_p.h:594
static BufferOp read(QRhiBuffer *buf, quint32 offset, quint32 size, QRhiReadbackResult *result)
Definition qrhi_p.h:625
static BufferOp dynamicUpdate(QRhiBuffer *buf, quint32 offset, quint32 size, const void *data)
Definition qrhi_p.h:563
static void changeToDynamicUpdate(BufferOp *op, QRhiBuffer *buf, quint32 offset, quint32 size, const void *data)
Definition qrhi_p.h:570
QRhiTextureSubresourceUploadDescription desc
Definition qrhi_p.h:689
QRhiTextureCopyDescription desc
Definition qrhi_p.h:693
static TextureOp copy(QRhiTexture *dst, QRhiTexture *src, const QRhiTextureCopyDescription &desc)
Definition qrhi_p.h:711
QVarLengthArray< SubresourceUpload, 4 > subresDesc
Definition qrhi_p.h:691
static TextureOp upload(QRhiTexture *tex, const QRhiTextureUploadDescription &desc)
Definition qrhi_p.h:697
static TextureOp genMips(QRhiTexture *tex)
Definition qrhi_p.h:730
static TextureOp read(const QRhiReadbackDescription &rb, QRhiReadbackResult *result)
Definition qrhi_p.h:721
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
Definition qrhi.h:1616
LimitsType limitsType
Definition qrhi.h:1627
LuminanceBehavior luminanceBehavior
Definition qrhi.h:1638
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
Definition qrhi.h:1649
void * reserved[2]
Definition qrhi.h:1650