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
64
66{
67 QGles2RenderBuffer(QRhiImplementation *rhi, Type type, const QSize &pixelSize,
68 int sampleCount, QRhiRenderBuffer::Flags flags,
69 QRhiTexture::Format backingFormatHint);
71 void destroy() override;
72 bool create() override;
73 bool createFrom(NativeRenderBuffer src) override;
74 QRhiTexture::Format backingFormat() const override;
75
77 GLuint stencilRenderbuffer = 0; // when packed depth-stencil not supported
79 bool owns = true;
80 uint generation = 0;
81 friend class QRhiGles2;
82};
83
93
94inline bool operator==(const QGles2SamplerData &a, const QGles2SamplerData &b)
95{
96 return a.glminfilter == b.glminfilter
97 && a.glmagfilter == b.glmagfilter
98 && a.glwraps == b.glwraps
99 && a.glwrapt == b.glwrapt
100 && a.glwrapr == b.glwrapr
101 && a.gltexcomparefunc == b.gltexcomparefunc;
102}
103
104inline bool operator!=(const QGles2SamplerData &a, const QGles2SamplerData &b)
105{
106 return !(a == b);
107}
108
110{
111 QGles2Texture(QRhiImplementation *rhi, Format format, const QSize &pixelSize, int depth,
112 int arraySize, int sampleCount, Flags flags);
113 ~QGles2Texture();
114 void destroy() override;
115 bool create() override;
116 bool createFrom(NativeTexture src) override;
117 NativeTexture nativeTexture() override;
118
119 bool prepareCreate(QSize *adjustedSize = nullptr);
120
122 bool owns = true;
129 bool specified = false;
130 bool zeroInitialized = false;
133
144 struct UsageState {
146 };
148
149 uint generation = 0;
150 friend class QRhiGles2;
151};
152
154{
155 QGles2Sampler(QRhiImplementation *rhi, Filter magFilter, Filter minFilter, Filter mipmapMode,
156 AddressMode u, AddressMode v, AddressMode w);
157 ~QGles2Sampler();
158 void destroy() override;
159 bool create() override;
160
162 uint generation = 0;
163 friend class QRhiGles2;
164};
165
167{
168 QGles2RenderPassDescriptor(QRhiImplementation *rhi);
170 void destroy() override;
171 bool isCompatible(const QRhiRenderPassDescriptor *other) const override;
173 QVector<quint32> serializedFormat() const override;
174};
175
192
194{
195 QGles2SwapChainRenderTarget(QRhiImplementation *rhi, QRhiSwapChain *swapchain);
197 void destroy() override;
198
199 QSize pixelSize() const override;
200 float devicePixelRatio() const override;
201 int sampleCount() const override;
202
204};
205
207{
208 QGles2TextureRenderTarget(QRhiImplementation *rhi, const QRhiTextureRenderTargetDescription &desc, Flags flags);
210 void destroy() override;
211
212 QSize pixelSize() const override;
213 float devicePixelRatio() const override;
214 int sampleCount() const override;
215
217 bool create() override;
218
222 friend class QRhiGles2;
223};
224
226{
227 QGles2ShaderResourceBindings(QRhiImplementation *rhi);
229 void destroy() override;
230 bool create() override;
231 void updateResources(UpdateFlags flags) override;
232
233 bool hasDynamicOffset = false;
234 uint generation = 0;
235 friend class QRhiGles2;
236};
237
247
249
257
259
260using QGles2UniformDescriptionVector = QVarLengthArray<QGles2UniformDescription, 8>;
261using QGles2SamplerDescriptionVector = QVarLengthArray<QGles2SamplerDescription, 4>;
262
264{
265 static constexpr int MAX_TRACKED_LOCATION = 1023;
267 float v[4];
268};
269
288
306
308{
309 QGles2CommandBuffer(QRhiImplementation *rhi);
311 void destroy() override;
312
313 // keep at a reasonably low value otherwise sizeof Command explodes
314 static const int MAX_DYNAMIC_OFFSET_COUNT = 8;
315
316 struct Command {
352
353 // QRhi*/QGles2* references should be kept at minimum (so no
354 // QRhiTexture/Buffer/etc. pointers).
355 union Args {
356 struct {
358 } beginFrame;
359 struct {
360 GLuint timestampQuery;
361 } endFrame;
362 struct {
363 float x, y, w, h;
364 float d0, d1;
365 } viewport;
366 struct {
367 int x, y, w, h;
368 } scissor;
369 struct {
370 float r, g, b, a;
371 } blendConstants;
372 struct {
375 } stencilRef;
376 struct {
377 QRhiGraphicsPipeline *ps;
381 } bindVertexBuffer;
382 struct {
383 GLuint buffer;
384 quint32 offset;
386 } bindIndexBuffer;
387 struct {
388 QRhiGraphicsPipeline *ps;
393 } draw;
394 struct {
395 QRhiGraphicsPipeline *ps;
398 quint32 instanceCount;
399 quint32 baseInstance;
401 } drawIndexed;
402 struct {
403 QRhiGraphicsPipeline *ps;
404 GLuint buffer;
405 quint32 offset;
408 } drawIndirect;
409 struct {
410 QRhiGraphicsPipeline *ps;
411 GLuint buffer;
412 quint32 offset;
413 quint32 drawCount;
414 quint32 stride;
415 } drawIndexedIndirect;
416 struct {
417 QRhiGraphicsPipeline *ps;
418 } bindGraphicsPipeline;
419 struct {
424 uint dynamicOffsetPairs[MAX_DYNAMIC_OFFSET_COUNT * 2]; // binding, offset
425 } bindShaderResources;
426 struct {
428 float c[4];
429 float d;
431 } clear;
432 struct {
434 bool srgb;
436 bool stereo;
438 } bindFramebuffer;
439 struct {
441 GLuint buffer;
443 int size;
444 const void *data; // must come from retainData()
445 } bufferSubData;
446 struct {
448 GLenum target;
449 GLuint buffer;
450 int offset;
451 int size;
452 } getBufferSubData;
453 struct {
458 int srcX;
459 int srcY;
460 int srcZ;
465 int dstX;
466 int dstY;
467 int dstZ;
468 int w;
469 int h;
470 } copyTex;
471 struct {
472 QRhiReadbackResult *result;
474 int x;
475 int y;
476 int w;
477 int h;
480 int level;
482 } readPixels;
483 struct {
484 GLenum target;
485 GLuint texture;
487 int level;
488 int dx;
489 int dy;
490 int dz;
491 int w;
492 int h;
497 const void *data; // must come from retainImage()
498 } subImage;
499 struct {
500 GLenum target;
501 GLuint texture;
502 GLenum faceTarget;
503 int level;
505 int w;
506 int h;
507 int depth;
508 int size;
509 const void *data; // must come from retainData()
510 } compressedImage;
511 struct {
512 GLenum target;
513 GLuint texture;
514 GLenum faceTarget;
515 int level;
516 int dx;
517 int dy;
518 int dz;
519 int w;
520 int h;
521 GLenum glintformat;
522 int size;
523 const void *data; // must come from retainData()
524 } compressedSubImage;
525 struct {
527 int w;
528 int h;
529 GLenum target;
530 GLuint dstTexture;
531 int dstLevel;
534 } blitFromRenderbuffer;
535 struct {
536 GLenum srcTarget;
537 GLuint srcTexture;
538 int srcLevel;
540 int w;
541 int h;
542 GLenum dstTarget;
543 GLuint dstTexture;
544 int dstLevel;
545 int dstLayer;
546 bool isDepthStencil;
547 } blitFromTexture;
548 struct {
549 GLenum target;
550 GLuint texture;
551 } genMip;
552 struct {
554 } bindComputePipeline;
555 struct {
559 } dispatch;
560 struct {
562 } barriersForPass;
563 struct {
565 } barrier;
566 struct {
567 GLuint fbo;
570 } invalidateFramebuffer;
571 } args;
572 };
573
579
583
586 double lastGpuTime = 0;
594
596 bool valid = false;
601 bool blendEnabled[16];
602 struct ColorMask { bool r, g, b, a; } colorMask[16];
630 void reset() { valid = false; }
631 struct {
632 // not part of QRhiGraphicsPipeline but used by setGraphicsPipeline()
634 } dynamic;
635 } graphicsPassState;
636
638 enum Access {
639 Read = 0x01,
640 Write = 0x02
641 };
643 void reset() {
644 writtenResources.clear();
645 }
646 } computePassState;
647
649 void *ps;
652 } textureUnitState[16];
653
657
658 // relies heavily on implicit sharing (no copies of the actual data will be made)
659 const void *retainData(const QByteArray &data) {
660 dataRetainPool.append(data);
661 return dataRetainPool.last().constData();
662 }
664 bufferDataRetainPool.append(data);
665 return reinterpret_cast<const uchar *>(bufferDataRetainPool.last().constData());
666 }
667 const void *retainImage(const QImage &image) {
668 imageRetainPool.append(image);
669 return imageRetainPool.last().constBits();
670 }
672 commands.reset();
673 dataRetainPool.clear();
674 bufferDataRetainPool.clear();
675 imageRetainPool.clear();
676
677 passResTrackers.clear();
679 }
680 void resetState() {
683 // do not zero lastGpuTime
684 currentTarget = nullptr;
687 }
689 currentGraphicsPipeline = nullptr;
690 currentComputePipeline = nullptr;
692 currentGraphicsSrb = nullptr;
693 currentComputeSrb = nullptr;
695 graphicsPassState.reset();
696 computePassState.reset();
697 memset(textureUnitState, 0, sizeof(textureUnitState));
698 }
699};
700
703{
704 return a.func == b.func
705 && a.failOp == b.failOp
706 && a.zfailOp == b.zfailOp
707 && a.zpassOp == b.zpassOp;
708}
709
712{
713 return !(a == b);
714}
715
718{
719 return a.r == b.r && a.g == b.g && a.b == b.b && a.a == b.a;
720}
721
724{
725 return !(a == b);
726}
727
730{
731 return a.srcColor == b.srcColor
732 && a.dstColor == b.dstColor
733 && a.srcAlpha == b.srcAlpha
734 && a.dstAlpha == b.dstAlpha
735 && a.opColor == b.opColor
736 && a.opAlpha == b.opAlpha;
737}
738
741{
742 return !(a == b);
743}
744
746{
747 static const int TIMESTAMP_PAIRS = 2;
748
751
752 void prepare(QRhiGles2 *rhiD);
753 void destroy(QRhiGles2 *rhiD);
754 bool tryQueryTimestamps(int pairIndex, QRhiGles2 *rhiD, double *elapsedSec);
755};
756
784
786{
787public:
788 QRhiGles2(QRhiGles2InitParams *params, QRhiGles2NativeHandles *importDevice = nullptr);
789
790 bool create(QRhi::Flags flags) override;
791 void destroy() override;
792
796 QRhiBuffer *createBuffer(QRhiBuffer::Type type,
797 QRhiBuffer::UsageFlags usage,
798 quint32 size) override;
799 QRhiRenderBuffer *createRenderBuffer(QRhiRenderBuffer::Type type,
800 const QSize &pixelSize,
801 int sampleCount,
802 QRhiRenderBuffer::Flags flags,
803 QRhiTexture::Format backingFormatHint) override;
804 QRhiTexture *createTexture(QRhiTexture::Format format,
805 const QSize &pixelSize,
806 int depth,
807 int arraySize,
808 int sampleCount,
809 QRhiTexture::Flags flags) override;
810 QRhiSampler *createSampler(QRhiSampler::Filter magFilter,
811 QRhiSampler::Filter minFilter,
812 QRhiSampler::Filter mipmapMode,
813 QRhiSampler:: AddressMode u,
814 QRhiSampler::AddressMode v,
815 QRhiSampler::AddressMode w) override;
816
817 QRhiTextureRenderTarget *createTextureRenderTarget(const QRhiTextureRenderTargetDescription &desc,
818 QRhiTextureRenderTarget::Flags flags) override;
819
820 QRhiShadingRateMap *createShadingRateMap() override;
821
822 QRhiSwapChain *createSwapChain() override;
823 QRhi::FrameOpResult beginFrame(QRhiSwapChain *swapChain, QRhi::BeginFrameFlags flags) override;
824 QRhi::FrameOpResult endFrame(QRhiSwapChain *swapChain, QRhi::EndFrameFlags flags) override;
825 QRhi::FrameOpResult beginOffscreenFrame(QRhiCommandBuffer **cb, QRhi::BeginFrameFlags flags) override;
826 QRhi::FrameOpResult endOffscreenFrame(QRhi::EndFrameFlags flags) override;
827 QRhi::FrameOpResult finish() override;
828
829 void resourceUpdate(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override;
830
831 void beginPass(QRhiCommandBuffer *cb,
832 QRhiRenderTarget *rt,
833 const QColor &colorClearValue,
834 const QRhiDepthStencilClearValue &depthStencilClearValue,
835 QRhiResourceUpdateBatch *resourceUpdates,
836 QRhiCommandBuffer::BeginPassFlags flags) override;
837 void endPass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override;
838
839 void setGraphicsPipeline(QRhiCommandBuffer *cb,
840 QRhiGraphicsPipeline *ps) override;
841
842 void setShaderResources(QRhiCommandBuffer *cb,
843 QRhiShaderResourceBindings *srb,
844 int dynamicOffsetCount,
845 const QRhiCommandBuffer::DynamicOffset *dynamicOffsets) override;
846
847 void setVertexInput(QRhiCommandBuffer *cb,
848 int startBinding, int bindingCount, const QRhiCommandBuffer::VertexInput *bindings,
849 QRhiBuffer *indexBuf, quint32 indexOffset,
850 QRhiCommandBuffer::IndexFormat indexFormat) override;
851
852 void setViewport(QRhiCommandBuffer *cb, const QRhiViewport &viewport) override;
853 void setScissor(QRhiCommandBuffer *cb, const QRhiScissor &scissor) override;
854 void setBlendConstants(QRhiCommandBuffer *cb, const QColor &c) override;
855 void setStencilRef(QRhiCommandBuffer *cb, quint32 refValue) override;
856 void setShadingRate(QRhiCommandBuffer *cb, const QSize &coarsePixelSize) override;
857
858 void draw(QRhiCommandBuffer *cb, quint32 vertexCount,
859 quint32 instanceCount, quint32 firstVertex, quint32 firstInstance) override;
860
861 void drawIndexed(QRhiCommandBuffer *cb, quint32 indexCount,
862 quint32 instanceCount, quint32 firstIndex,
863 qint32 vertexOffset, quint32 firstInstance) override;
864
865 void drawIndirect(QRhiCommandBuffer *cb, QRhiBuffer *indirectBuffer,
866 quint32 indirectBufferOffset, quint32 drawCount, quint32 stride) override;
867
868 void drawIndexedIndirect(QRhiCommandBuffer *cb, QRhiBuffer *indirectBuffer,
869 quint32 indirectBufferOffset, quint32 drawCount, quint32 stride) override;
870
871 void debugMarkBegin(QRhiCommandBuffer *cb, const QByteArray &name) override;
872 void debugMarkEnd(QRhiCommandBuffer *cb) override;
873 void debugMarkMsg(QRhiCommandBuffer *cb, const QByteArray &msg) override;
874
875 void beginComputePass(QRhiCommandBuffer *cb,
876 QRhiResourceUpdateBatch *resourceUpdates,
877 QRhiCommandBuffer::BeginPassFlags flags) override;
878 void endComputePass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override;
879 void setComputePipeline(QRhiCommandBuffer *cb, QRhiComputePipeline *ps) override;
880 void dispatch(QRhiCommandBuffer *cb, int x, int y, int z) override;
881
882 const QRhiNativeHandles *nativeHandles(QRhiCommandBuffer *cb) override;
883 void beginExternal(QRhiCommandBuffer *cb) override;
884 void endExternal(QRhiCommandBuffer *cb) override;
885 double lastCompletedGpuTime(QRhiCommandBuffer *cb) override;
886
887 QList<int> supportedSampleCounts() const override;
888 QList<QSize> supportedShadingRates(int sampleCount) const override;
889 int ubufAlignment() const override;
890 bool isYUpInFramebuffer() const override;
891 bool isYUpInNDC() const override;
892 bool isClipDepthZeroToOne() const override;
893 QMatrix4x4 clipSpaceCorrMatrix() const override;
894 bool isTextureFormatSupported(QRhiTexture::Format format, QRhiTexture::Flags flags) const override;
895 bool isFeatureSupported(QRhi::Feature feature) const override;
896 int resourceLimit(QRhi::ResourceLimit limit) const override;
897 const QRhiNativeHandles *nativeHandles() override;
898 QRhiDriverInfo driverInfo() const override;
899 QRhiStats statistics() override;
901 void setQueueSubmitParams(QRhiNativeHandles *params) override;
903 bool isDeviceLost() const override;
904
905 QByteArray pipelineCacheData() override;
906 void setPipelineCacheData(const QByteArray &data) override;
907
908 bool ensureContext(QSurface *surface = nullptr) const;
914 int layer, int level, const QRhiTextureSubresourceUploadDescription &subresDesc);
915 void enqueueResourceUpdates(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates);
917 QGles2Buffer *bufD,
921 QGles2Texture *texD,
924 void executeCommandBuffer(QRhiCommandBuffer *cb);
927 void *ps, uint psGeneration, int glslLocation,
928 int *texUnit, bool *activeTexUnitAltered);
930 QRhiGraphicsPipeline *maybeGraphicsPs, QRhiComputePipeline *maybeComputePs,
931 QRhiShaderResourceBindings *srb,
932 const uint *dynOfsPairs, int dynOfsCount);
934 bool *wantsColorClear = nullptr, bool *wantsDsClear = nullptr);
936 QByteArray shaderSource(const QRhiShaderStage &shaderStage, QShaderVersion *shaderVersion);
937 bool compileShader(GLuint program, const QRhiShaderStage &shaderStage, QShaderVersion *shaderVersion);
938 bool linkProgram(GLuint program);
940 void registerUniformIfActive(const QShaderDescription::BlockVariable &var,
941 const QByteArray &namePrefix, int binding, int baseOffset,
942 GLuint program,
943 ActiveUniformLocationTracker *activeUniformLocations,
944 QGles2UniformDescriptionVector *dst);
945 void gatherUniforms(GLuint program, const QShaderDescription::UniformBlock &ub,
946 ActiveUniformLocationTracker *activeUniformLocations, QGles2UniformDescriptionVector *dst);
947 void gatherSamplers(GLuint program, const QShaderDescription::InOutVariable &v,
948 QGles2SamplerDescriptionVector *dst);
949 void gatherGeneratedSamplers(GLuint program,
950 const QShader::SeparateToCombinedImageSamplerMapping &mapping,
951 QGles2SamplerDescriptionVector *dst);
952 void sanityCheckVertexFragmentInterface(const QShaderDescription &vsDesc, const QShaderDescription &fsDesc);
954
960 ProgramCacheResult tryLoadFromDiskOrPipelineCache(const QRhiShaderStage *stages,
961 int stageCount,
962 GLuint program,
963 const QVector<QShaderDescription::InOutVariable> &inputVars,
964 QByteArray *cacheKey);
965 void trySaveToDiskCache(GLuint program, const QByteArray &cacheKey);
966 void trySaveToPipelineCache(GLuint program, const QByteArray &cacheKey, bool force = false);
967
969 QOpenGLContext *ctx = nullptr;
970 bool importedContext = false;
975 mutable bool needsMakeCurrentDueToSwap = false;
976 QOpenGLExtensions *f = nullptr;
979 const void *) = nullptr;
982 const GLvoid *) = nullptr;
984 GLsizei) = nullptr;
986 const GLvoid *) = nullptr;
988 GLsizei, const GLvoid *) = nullptr;
990 GLint) = nullptr;
992 GLint, GLsizei) = nullptr;
995 void (QOPENGLF_APIENTRYP glObjectLabel)(GLenum, GLuint, GLsizei, const GLchar *) = nullptr;
1001 uint vao = 0;
1002 struct Caps {
1004 : ctxMajor(2),
1005 ctxMinor(0),
1006 maxTextureSize(2048),
1007 maxDrawBuffers(4),
1008 maxSamples(16),
1015 maxUniformVectors(4096),
1016 maxVertexInputs(8),
1018 msaaRenderBuffer(false),
1019 multisampledTexture(false),
1020 npotTextureFull(true),
1021 gles(false),
1023 bgraExternalFormat(false),
1024 bgraInternalFormat(false),
1025 r8Format(false),
1026 r16Format(false),
1027 r32uiFormat(false),
1028 floatFormats(false),
1029 rgb10Formats(false),
1030 depthTexture(false),
1031 packedDepthStencil(false),
1033 srgbWriteControl(false),
1034 coreProfile(false),
1035 uniformBuffers(false),
1036 elementIndexUint(false),
1037 depth24(false),
1038 rgba8Format(false),
1039 instancing(false),
1040 baseVertex(false),
1041 compute(false),
1042 textureCompareMode(false),
1043 depthClamp(false),
1044 properMapBuffer(false),
1046 texelFetch(false),
1047 intAttributes(true),
1049 programBinary(false),
1050 texture3D(false),
1051 tessellation(false),
1052 geometryShader(false),
1053 texture1D(false),
1054 hasDrawBuffersFunc(false),
1055 halfAttributes(false),
1056 multiView(false),
1057 timestamps(false),
1058 objectLabel(false),
1061 unpackRowLength(false),
1063 { }
1078 // Multisample fb and blit are supported (GLES 3.0 or OpenGL 3.x). Not
1079 // the same as multisample textures!
1083 uint gles : 1;
1087 uint r8Format : 1;
1088 uint r16Format : 1;
1089 uint r32uiFormat : 1;
1096 uint coreProfile : 1;
1099 uint depth24 : 1;
1100 uint rgba8Format : 1;
1101 uint instancing : 1;
1102 uint baseVertex : 1;
1103 uint compute : 1;
1105 uint depthClamp : 1;
1108 uint texelFetch : 1;
1112 uint texture3D : 1;
1115 uint texture1D : 1;
1118 uint multiView : 1;
1119 uint timestamps : 1;
1120 uint objectLabel : 1;
1128 } caps;
1134 mutable bool contextLost = false;
1135 uint frameNo = 0;
1136
1146 union {
1147 struct {
1149 } buffer;
1150 struct {
1152 } pipeline;
1153 struct {
1155 } texture;
1156 struct {
1159 } renderbuffer;
1160 struct {
1163 } textureRenderTarget;
1164 };
1165 };
1167
1169 OffscreenFrame(QRhiImplementation *rhi) : cbWrapper(rhi) { }
1170 bool active = false;
1173 } ofr;
1174
1176
1182
1201};
1202
1204
1205QT_END_NAMESPACE
1206
1207#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:803
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:814
QRhiBackendCommandList()=default
T * cend() const
Definition qrhi_p.h:784
T * cbegin() const
Definition qrhi_p.h:783
bool isEmpty() const
Definition qrhi_p.h:769
void assign(QByteArray data)
Definition qrhi_p.h:403
QRhiBufferData()=default
void assign(const char *s, quint32 size)
Definition qrhi_p.h:384
quint32 size() const
Definition qrhi_p.h:376
QRhiBufferData(const QRhiBufferData &other)
Definition qrhi_p.h:355
quint32 largeAlloc() const
Definition qrhi_p.h:380
QRhiBufferData & operator=(const QRhiBufferData &other)
Definition qrhi_p.h:361
const char * constData() const
Definition qrhi_p.h:372
QHash< QRhiShaderStage, uint > m_shaderCache
const GLvoid const GLvoid GLenum
QRhiStats statistics() override
bool contextLost
void(QOPENGLF_APIENTRYP glGetQueryObjectui64v)(GLuint
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)
QRhi::FrameOpResult beginFrame(QRhiSwapChain *swapChain, QRhi::BeginFrameFlags flags) override
const GLvoid GLenum
void enqueueBarriersForPass(QGles2CommandBuffer *cbD)
QList< DeferredReleaseEntry > releaseQueue
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
quint64 GLuint
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)
QRhiDriverInfo driverInfo() const override
QSurfaceFormat requestedFormat
QHash< QByteArray, PipelineCacheData > m_pipelineCache
bool isProgramBinaryDiskCacheEnabled() const
void(QOPENGLF_APIENTRYP glFramebufferTextureMultisampleMultiviewOVR)(GLenum
bool needsMakeCurrentDueToSwap
QRhiShadingRateMap * createShadingRateMap() override
const void GLint
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
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
void(QOPENGLF_APIENTRYP glMultiDrawArraysIndirect)(GLenum
QList< int > supportedSampleCounts() const override
void gatherSamplers(GLuint program, const QShaderDescription::InOutVariable &v, QGles2SamplerDescriptionVector *dst)
QSet< GLint > supportedCompressedFormats
QRhiSwapChain * createSwapChain() override
void dispatch(QRhiCommandBuffer *cb, int x, int y, int z) override
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
QSurface * fallbackSurface
QRhiGles2(QRhiGles2InitParams *params, QRhiGles2NativeHandles *importDevice=nullptr)
QRhi::Flags rhiFlags
void trySaveToDiskCache(GLuint program, const QByteArray &cacheKey)
QList< QSize > supportedShadingRates(int sampleCount) const override
bool compileShader(GLuint program, const QRhiShaderStage &shaderStage, QShaderVersion *shaderVersion)
void(QOPENGLF_APIENTRYP glTexSubImage1D)(GLenum
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
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
bool makeThreadLocalNativeContextCurrent() override
int ubufAlignment() const override
void beginExternal(QRhiCommandBuffer *cb) override
void endExternal(QRhiCommandBuffer *cb) override
bool isTextureFormatSupported(QRhiTexture::Format format, QRhiTexture::Flags flags) const override
QByteArray shaderSource(const QRhiShaderStage &shaderStage, QShaderVersion *shaderVersion)
QRhiBuffer * createBuffer(QRhiBuffer::Type type, QRhiBuffer::UsageFlags usage, quint32 size) override
void(QOPENGLF_APIENTRYP glCompressedTexImage1D)(GLenum
bool importedContext
void setScissor(QRhiCommandBuffer *cb, const QRhiScissor &scissor) override
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
ProgramCacheResult tryLoadFromDiskOrPipelineCache(const QRhiShaderStage *stages, int stageCount, GLuint program, const QVector< QShaderDescription::InOutVariable > &inputVars, QByteArray *cacheKey)
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
@ ProgramCacheError
QGles2RenderTargetData * enqueueBindFramebuffer(QRhiRenderTarget *rt, QGles2CommandBuffer *cbD, bool *wantsColorClear=nullptr, bool *wantsDsClear=nullptr)
void debugMarkEnd(QRhiCommandBuffer *cb) override
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)
void executeDeferredReleases()
QByteArray pipelineCacheData() override
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)
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:259
double lastCompletedGpuTime(QRhiCommandBuffer *cb) override
Definition qrhinull.cpp:400
QRhi::FrameOpResult endOffscreenFrame(QRhi::EndFrameFlags flags) override
Definition qrhinull.cpp:429
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:364
void dispatch(QRhiCommandBuffer *cb, int x, int y, int z) override
Definition qrhinull.cpp:376
QRhi::FrameOpResult beginFrame(QRhiSwapChain *swapChain, QRhi::BeginFrameFlags flags) override
Definition qrhinull.cpp:406
void resourceUpdate(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override
Definition qrhinull.cpp:506
void drawIndexed(QRhiCommandBuffer *cb, quint32 indexCount, quint32 instanceCount, quint32 firstIndex, qint32 vertexOffset, quint32 firstInstance) override
Definition qrhinull.cpp:322
void beginComputePass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates, QRhiCommandBuffer::BeginPassFlags flags) override
Definition qrhinull.cpp:602
void beginPass(QRhiCommandBuffer *cb, QRhiRenderTarget *rt, const QColor &colorClearValue, const QRhiDepthStencilClearValue &depthStencilClearValue, QRhiResourceUpdateBatch *resourceUpdates, QRhiCommandBuffer::BeginPassFlags flags) override
Definition qrhinull.cpp:575
void setQueueSubmitParams(QRhiNativeHandles *params) override
Definition qrhinull.cpp:181
bool isClipDepthZeroToOne() const override
Definition qrhinull.cpp:97
void endComputePass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override
Definition qrhinull.cpp:611
QNullCommandBuffer offscreenCommandBuffer
Definition qrhinull_p.h:302
void endPass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override
Definition qrhinull.cpp:596
QRhi::FrameOpResult endFrame(QRhiSwapChain *swapChain, QRhi::EndFrameFlags flags) override
Definition qrhinull.cpp:413
QRhi::FrameOpResult beginOffscreenFrame(QRhiCommandBuffer **cb, QRhi::BeginFrameFlags flags) override
Definition qrhinull.cpp:422
bool isYUpInNDC() const override
Definition qrhinull.cpp:92
QRhiDriverInfo driverInfo() const override
Definition qrhinull.cpp:163
void setScissor(QRhiCommandBuffer *cb, const QRhiScissor &scissor) override
Definition qrhinull.cpp:288
void simulateTextureUpload(const QRhiResourceUpdateBatchPrivate::TextureOp &u)
Definition qrhinull.cpp:440
QRhiComputePipeline * createComputePipeline() override
Definition qrhinull.cpp:243
void setPipelineCacheData(const QByteArray &data) override
Definition qrhinull.cpp:201
void setVertexInput(QRhiCommandBuffer *cb, int startBinding, int bindingCount, const QRhiCommandBuffer::VertexInput *bindings, QRhiBuffer *indexBuf, quint32 indexOffset, QRhiCommandBuffer::IndexFormat indexFormat) override
Definition qrhinull.cpp:269
void debugMarkBegin(QRhiCommandBuffer *cb, const QByteArray &name) override
Definition qrhinull.cpp:353
void draw(QRhiCommandBuffer *cb, quint32 vertexCount, quint32 instanceCount, quint32 firstVertex, quint32 firstInstance) override
Definition qrhinull.cpp:312
QByteArray pipelineCacheData() override
Definition qrhinull.cpp:196
void destroy() override
Definition qrhinull.cpp:57
const QRhiNativeHandles * nativeHandles() override
Definition qrhinull.cpp:158
void setGraphicsPipeline(QRhiCommandBuffer *cb, QRhiGraphicsPipeline *ps) override
Definition qrhinull.cpp:253
void releaseCachedResources() override
Definition qrhinull.cpp:186
void simulateTextureCopy(const QRhiResourceUpdateBatchPrivate::TextureOp &u)
Definition qrhinull.cpp:482
QRhiTexture * createTexture(QRhiTexture::Format format, const QSize &pixelSize, int depth, int arraySize, int sampleCount, QRhiTexture::Flags flags) override
Definition qrhinull.cpp:213
QList< QSize > supportedShadingRates(int sampleCount) const override
Definition qrhinull.cpp:66
void simulateTextureGenMips(const QRhiResourceUpdateBatchPrivate::TextureOp &u)
Definition qrhinull.cpp:497
void setShadingRate(QRhiCommandBuffer *cb, const QSize &coarsePixelSize) override
Definition qrhinull.cpp:306
QRhiRenderBuffer * createRenderBuffer(QRhiRenderBuffer::Type type, const QSize &pixelSize, int sampleCount, QRhiRenderBuffer::Flags flags, QRhiTexture::Format backingFormatHint) override
Definition qrhinull.cpp:206
bool makeThreadLocalNativeContextCurrent() override
Definition qrhinull.cpp:175
void drawIndirect(QRhiCommandBuffer *cb, QRhiBuffer *indirectBuffer, quint32 indirectBufferOffset, quint32 drawCount, quint32 stride) override
Definition qrhinull.cpp:333
const QRhiNativeHandles * nativeHandles(QRhiCommandBuffer *cb) override
Definition qrhinull.cpp:384
QRhiNullNativeHandles nativeHandlesStruct
Definition qrhinull_p.h:300
bool isYUpInFramebuffer() const override
Definition qrhinull.cpp:87
QRhi::FrameOpResult finish() override
Definition qrhinull.cpp:435
void setComputePipeline(QRhiCommandBuffer *cb, QRhiComputePipeline *ps) override
Definition qrhinull.cpp:370
QRhiBuffer * createBuffer(QRhiBuffer::Type type, QRhiBuffer::UsageFlags usage, quint32 size) override
Definition qrhinull.cpp:77
QRhiStats statistics() override
Definition qrhinull.cpp:170
QRhiShadingRateMap * createShadingRateMap() override
Definition qrhinull.cpp:233
void beginExternal(QRhiCommandBuffer *cb) override
Definition qrhinull.cpp:390
QRhiSwapChain * createSwapChain() override
Definition qrhinull.cpp:72
void setViewport(QRhiCommandBuffer *cb, const QRhiViewport &viewport) override
Definition qrhinull.cpp:282
QRhiTextureRenderTarget * createTextureRenderTarget(const QRhiTextureRenderTargetDescription &desc, QRhiTextureRenderTarget::Flags flags) override
Definition qrhinull.cpp:227
QRhiGraphicsPipeline * createGraphicsPipeline() override
Definition qrhinull.cpp:238
bool create(QRhi::Flags flags) override
Definition qrhinull.cpp:51
void setStencilRef(QRhiCommandBuffer *cb, quint32 refValue) override
Definition qrhinull.cpp:300
void debugMarkEnd(QRhiCommandBuffer *cb) override
Definition qrhinull.cpp:359
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:220
void drawIndexedIndirect(QRhiCommandBuffer *cb, QRhiBuffer *indirectBuffer, quint32 indirectBufferOffset, quint32 drawCount, quint32 stride) override
Definition qrhinull.cpp:343
QRhiSwapChain * currentSwapChain
Definition qrhinull_p.h:301
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:248
void setBlendConstants(QRhiCommandBuffer *cb, const QColor &c) override
Definition qrhinull.cpp:294
void endExternal(QRhiCommandBuffer *cb) override
Definition qrhinull.cpp:395
bool isDeviceLost() const override
Definition qrhinull.cpp:191
static TextureStage toPassTrackerTextureStage(QRhiShaderResourceBinding::StageFlags stages)
Definition qrhi.cpp:12089
const QVarLengthFlatMap< QRhiBuffer *, Buffer, 12 > & buffers() const
Definition qrhi_p.h:741
static BufferStage toPassTrackerBufferStage(QRhiShaderResourceBinding::StageFlags stages)
Definition qrhi.cpp:12070
const QVarLengthFlatMap< QRhiTexture *, Texture, 12 > & textures() const
Definition qrhi_p.h:749
bool isEmpty() const
Definition qrhi.cpp:11979
void registerBuffer(QRhiBuffer *buf, int slot, BufferAccess *access, BufferStage *stage, const UsageState &state)
Definition qrhi.cpp:11996
void registerTexture(QRhiTexture *tex, TextureAccess *access, TextureStage *stage, const UsageState &state)
Definition qrhi.cpp:12036
QVarLengthArray< BufferOp, BUFFER_OPS_STATIC_ALLOC > bufferOps
Definition qrhi_p.h:582
QRhiImplementation * rhi
Definition qrhi_p.h:589
QVarLengthArray< TextureOp, TEXTURE_OPS_STATIC_ALLOC > textureOps
Definition qrhi_p.h:586
static const int BUFFER_OPS_STATIC_ALLOC
Definition qrhi_p.h:581
static QRhiResourceUpdateBatchPrivate * get(QRhiResourceUpdateBatch *b)
Definition qrhi_p.h:597
void merge(QRhiResourceUpdateBatchPrivate *other)
Definition qrhi.cpp:10139
QRhiResourceUpdateBatch * q
Definition qrhi_p.h:588
static const int TEXTURE_OPS_STATIC_ALLOC
Definition qrhi_p.h:585
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:8492
static QRhiPassResourceTracker::BufferStage earlierStage(QRhiPassResourceTracker::BufferStage a, QRhiPassResourceTracker::BufferStage b)
Definition qrhi.cpp:11990
QDebug operator<<(QDebug dbg, const QRhiSwapChainHdrInfo &info)
Definition qrhi.cpp:8239
static bool isImageLoadStore(QRhiPassResourceTracker::TextureAccess access)
Definition qrhi.cpp:12029
static const char * deviceTypeStr(QRhiDriverInfo::DeviceType type)
\variable QRhiDriverInfo::deviceName
Definition qrhi.cpp:9429
static QRhiPassResourceTracker::TextureStage earlierStage(QRhiPassResourceTracker::TextureStage a, QRhiPassResourceTracker::TextureStage b)
Definition qrhi.cpp:12023
QRhiTargetRectBoundMode
Definition qrhi_p.h:284
@ UnBounded
Definition qrhi_p.h:285
@ Bounded
Definition qrhi_p.h:286
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:871
bool operator!=(const QRhiRenderTargetAttachmentTracker::ResId &a, const QRhiRenderTargetAttachmentTracker::ResId &b)
Definition qrhi_p.h:811
Q_DECLARE_TYPEINFO(QRhiPassResourceTracker::Buffer, Q_RELOCATABLE_TYPE)
#define QRHI_RES(t, x)
Definition qrhi_p.h:30
bool operator==(const QRhiRenderTargetAttachmentTracker::ResId &a, const QRhiRenderTargetAttachmentTracker::ResId &b)
Definition qrhi_p.h:806
bool qrhi_toTopLeftRenderTargetRect(const QSize &outputSize, const std::array< T, N > &r, T *x, T *y, T *w, T *h)
Definition qrhi_p.h:290
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:94
bool operator!=(const QGles2CommandBuffer::GraphicsPassState::StencilFace &a, const QGles2CommandBuffer::GraphicsPassState::StencilFace &b)
Q_DECLARE_TYPEINFO(QGles2UniformDescription, Q_RELOCATABLE_TYPE)
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:61
GLuint buffer
Definition qrhigles2_p.h:45
QVarLengthArray< QImage, 4 > imageRetainPool
QRhiShaderResourceBindings * currentGraphicsSrb
QVarLengthArray< QRhiBufferData, 4 > bufferDataRetainPool
static const int MAX_DYNAMIC_OFFSET_COUNT
QRhiBackendCommandList< Command > commands
QRhiComputePipeline * currentComputePipeline
QRhiRenderTarget * currentTarget
QRhiShaderResourceBindings * currentComputeSrb
QVarLengthArray< QRhiPassResourceTracker, 8 > passResTrackers
QGles2CommandBuffer(QRhiImplementation *rhi)
const void * retainImage(const QImage &image)
const void * retainData(const QByteArray &data)
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
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
QGles2UniformState uniformState[QGles2UniformState::MAX_TRACKED_LOCATION+1]
QGles2UniformDescriptionVector uniforms
QRhiShaderResourceBindings * currentSrb
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)
QRhiShaderResourceBindings * currentSrb
QGles2UniformDescriptionVector uniforms
QGles2UniformState uniformState[QGles2UniformState::MAX_TRACKED_LOCATION+1]
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:77
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:91
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)
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
bool create() override
Creates the corresponding native graphics resources.
NativeTexture nativeTexture() override
static constexpr int MAX_TRACKED_LOCATION
char * data
Definition qrhinull_p.h:31
QNullBuffer(QRhiImplementation *rhi, Type type, UsageFlags usage, quint32 size)
Definition qrhinull.cpp:617
bool create() override
Creates the corresponding native graphics resources.
Definition qrhinull.cpp:637
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
Definition qrhinull.cpp:627
char * beginFullDynamicBufferUpdateForCurrentFrame() override
Definition qrhinull.cpp:651
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.
Definition qrhinull.cpp:999
bool create() override
QNullComputePipeline(QRhiImplementation *rhi)
Definition qrhinull.cpp:989
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
Definition qrhinull.cpp:972
bool create() override
Creates the corresponding native graphics resources.
Definition qrhinull.cpp:979
QNullGraphicsPipeline(QRhiImplementation *rhi)
Definition qrhinull.cpp:962
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
Definition qrhinull.cpp:669
bool create() override
Creates the corresponding native graphics resources.
Definition qrhinull.cpp:678
QNullRenderBuffer(QRhiImplementation *rhi, Type type, const QSize &pixelSize, int sampleCount, QRhiRenderBuffer::Flags flags, QRhiTexture::Format backingFormatHint)
Definition qrhinull.cpp:657
QRhiTexture::Format backingFormat() const override
Definition qrhinull.cpp:692
QNullRenderPassDescriptor(QRhiImplementation *rhi)
Definition qrhinull.cpp:797
QRhiRenderPassDescriptor * newCompatibleRenderPassDescriptor() const override
Definition qrhinull.cpp:820
QVector< quint32 > serializedFormat() const override
Definition qrhinull.cpp:828
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
Definition qrhinull.cpp:807
bool isCompatible(const QRhiRenderPassDescriptor *other) const override
Definition qrhinull.cpp:814
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:783
QNullSampler(QRhiImplementation *rhi, Filter magFilter, Filter minFilter, Filter mipmapMode, AddressMode u, AddressMode v, AddressMode w)
Definition qrhinull.cpp:772
bool create() override
Definition qrhinull.cpp:790
QNullShaderResourceBindings(QRhiImplementation *rhi)
Definition qrhinull.cpp:928
bool create() override
Creates the corresponding resource binding set.
Definition qrhinull.cpp:945
void updateResources(UpdateFlags flags) override
Definition qrhinull.cpp:957
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
Definition qrhinull.cpp:938
QSize pixelSize() const override
Definition qrhinull.cpp:848
float devicePixelRatio() const override
Definition qrhinull.cpp:853
QNullRenderTargetData d
Definition qrhinull_p.h:101
QNullSwapChainRenderTarget(QRhiImplementation *rhi, QRhiSwapChain *swapchain)
Definition qrhinull.cpp:833
int sampleCount() const override
Definition qrhinull.cpp:858
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
Definition qrhinull.cpp:844
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:910
int sampleCount() const override
Definition qrhinull.cpp:923
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
Definition qrhinull.cpp:876
QRhiRenderPassDescriptor * newCompatibleRenderPassDescriptor() override
Definition qrhinull.cpp:883
bool create() override
Creates the corresponding native graphics resources.
Definition qrhinull.cpp:891
QNullTextureRenderTarget(QRhiImplementation *rhi, const QRhiTextureRenderTargetDescription &desc, Flags flags)
Definition qrhinull.cpp:863
QNullRenderTargetData d
Definition qrhinull_p.h:117
float devicePixelRatio() const override
Definition qrhinull.cpp:918
bool create() override
Creates the corresponding native graphics resources.
Definition qrhinull.cpp:717
bool createFrom(NativeTexture src) override
Similar to create(), except that no new native textures are created.
Definition qrhinull.cpp:756
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:697
uint generation
Definition qrhinull_p.h:59
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
Definition qrhinull.cpp:708
bool operator!=(const Batch &other) const
Definition qrhi_p.h:637
QVector< T > resources
Definition qrhi_p.h:630
bool operator==(const Batch &other) const
Definition qrhi_p.h:632
void feed(int binding, T resource)
Definition qrhi_p.h:603
QVector< Batch > batches
Definition qrhi_p.h:646
bool operator!=(const QRhiBatchedBindings< T > &other) const
Definition qrhi_p.h:653
bool operator==(const QRhiBatchedBindings< T > &other) const
Definition qrhi_p.h:648
char smallData[SMALL_DATA_SIZE]
Definition qrhi_p.h:342
QByteArray largeData
Definition qrhi_p.h:340
static constexpr quint32 SMALL_DATA_SIZE
Definition qrhi_p.h:341
uint needsDepthStencilCombinedAttach
uint perRenderTargetBlending
int maxThreadGroupsPerDimension
uint glesMultisampleRenderToTexture
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:817
static bool isUpToDate(const QRhiTextureRenderTargetDescription &desc, const ResIdList &currentResIdList)
Definition qrhi_p.h:855
static void changeToDynamicUpdate(BufferOp *op, QRhiBuffer *buf, quint32 offset, QByteArray data)
Definition qrhi_p.h:465
static void changeToStaticUpload(BufferOp *op, QRhiBuffer *buf, quint32 offset, QByteArray data)
Definition qrhi_p.h:496
static void changeToStaticUpload(BufferOp *op, QRhiBuffer *buf, quint32 offset, quint32 size, const void *data)
Definition qrhi_p.h:480
static BufferOp dynamicUpdate(QRhiBuffer *buf, quint32 offset, QByteArray data)
Definition qrhi_p.h:458
static BufferOp staticUpload(QRhiBuffer *buf, quint32 offset, QByteArray data)
Definition qrhi_p.h:489
static BufferOp staticUpload(QRhiBuffer *buf, quint32 offset, quint32 size, const void *data)
Definition qrhi_p.h:473
static BufferOp read(QRhiBuffer *buf, quint32 offset, quint32 size, QRhiReadbackResult *result)
Definition qrhi_p.h:504
static BufferOp dynamicUpdate(QRhiBuffer *buf, quint32 offset, quint32 size, const void *data)
Definition qrhi_p.h:442
static void changeToDynamicUpdate(BufferOp *op, QRhiBuffer *buf, quint32 offset, quint32 size, const void *data)
Definition qrhi_p.h:449
QRhiTextureCopyDescription desc
Definition qrhi_p.h:532
static TextureOp copy(QRhiTexture *dst, QRhiTexture *src, const QRhiTextureCopyDescription &desc)
Definition qrhi_p.h:552
QVarLengthArray< MipLevelUploadList, 6 > subresDesc
Definition qrhi_p.h:530
static TextureOp upload(QRhiTexture *tex, const QRhiTextureUploadDescription &desc)
Definition qrhi_p.h:536
static TextureOp genMips(QRhiTexture *tex)
Definition qrhi_p.h:571
static TextureOp read(const QRhiReadbackDescription &rb, QRhiReadbackResult *result)
Definition qrhi_p.h:562
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
Definition qrhi.h:1557
LimitsType limitsType
Definition qrhi.h:1568
float maxPotentialColorComponentValue
Definition qrhi.h:1576
LuminanceBehavior luminanceBehavior
Definition qrhi.h:1579
float maxColorComponentValue
Definition qrhi.h:1575
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
Definition qrhi.h:1590
void * reserved[2]
Definition qrhi.h:1591
uint dynamicOffsetPairs[MAX_DYNAMIC_OFFSET_COUNT *2]
QRhiShaderResourceBindings * srb
QRhiGraphicsPipeline * maybeGraphicsPs
QRhiComputePipeline * maybeComputePs
QRhiSwapChain::StereoTargetBuffer stereoTarget