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 {
350
351 // QRhi*/QGles2* references should be kept at minimum (so no
352 // QRhiTexture/Buffer/etc. pointers).
353 union Args {
354 struct {
356 } beginFrame;
357 struct {
358 GLuint timestampQuery;
359 } endFrame;
360 struct {
361 float x, y, w, h;
362 float d0, d1;
363 } viewport;
364 struct {
365 int x, y, w, h;
366 } scissor;
367 struct {
368 float r, g, b, a;
369 } blendConstants;
370 struct {
373 } stencilRef;
374 struct {
375 QRhiGraphicsPipeline *ps;
379 } bindVertexBuffer;
380 struct {
381 GLuint buffer;
382 quint32 offset;
384 } bindIndexBuffer;
385 struct {
386 QRhiGraphicsPipeline *ps;
391 } draw;
392 struct {
393 QRhiGraphicsPipeline *ps;
396 quint32 instanceCount;
397 quint32 baseInstance;
399 } drawIndexed;
400 struct {
401 QRhiGraphicsPipeline *ps;
402 } bindGraphicsPipeline;
403 struct {
408 uint dynamicOffsetPairs[MAX_DYNAMIC_OFFSET_COUNT * 2]; // binding, offset
409 } bindShaderResources;
410 struct {
412 float c[4];
413 float d;
415 } clear;
416 struct {
418 bool srgb;
420 bool stereo;
422 } bindFramebuffer;
423 struct {
425 GLuint buffer;
427 int size;
428 const void *data; // must come from retainData()
429 } bufferSubData;
430 struct {
432 GLenum target;
433 GLuint buffer;
434 int offset;
435 int size;
436 } getBufferSubData;
437 struct {
442 int srcX;
443 int srcY;
444 int srcZ;
449 int dstX;
450 int dstY;
451 int dstZ;
452 int w;
453 int h;
454 } copyTex;
455 struct {
456 QRhiReadbackResult *result;
458 int x;
459 int y;
460 int w;
461 int h;
464 int level;
466 } readPixels;
467 struct {
468 GLenum target;
469 GLuint texture;
471 int level;
472 int dx;
473 int dy;
474 int dz;
475 int w;
476 int h;
481 const void *data; // must come from retainImage()
482 } subImage;
483 struct {
484 GLenum target;
485 GLuint texture;
486 GLenum faceTarget;
487 int level;
489 int w;
490 int h;
491 int depth;
492 int size;
493 const void *data; // must come from retainData()
494 } compressedImage;
495 struct {
496 GLenum target;
497 GLuint texture;
498 GLenum faceTarget;
499 int level;
500 int dx;
501 int dy;
502 int dz;
503 int w;
504 int h;
505 GLenum glintformat;
506 int size;
507 const void *data; // must come from retainData()
508 } compressedSubImage;
509 struct {
511 int w;
512 int h;
513 GLenum target;
514 GLuint dstTexture;
515 int dstLevel;
518 } blitFromRenderbuffer;
519 struct {
520 GLenum srcTarget;
521 GLuint srcTexture;
522 int srcLevel;
524 int w;
525 int h;
526 GLenum dstTarget;
527 GLuint dstTexture;
528 int dstLevel;
529 int dstLayer;
530 bool isDepthStencil;
531 } blitFromTexture;
532 struct {
533 GLenum target;
534 GLuint texture;
535 } genMip;
536 struct {
538 } bindComputePipeline;
539 struct {
543 } dispatch;
544 struct {
546 } barriersForPass;
547 struct {
549 } barrier;
550 struct {
551 GLuint fbo;
554 } invalidateFramebuffer;
555 } args;
556 };
557
563
567
570 double lastGpuTime = 0;
578
580 bool valid = false;
585 bool blendEnabled[16];
586 struct ColorMask { bool r, g, b, a; } colorMask[16];
614 void reset() { valid = false; }
615 struct {
616 // not part of QRhiGraphicsPipeline but used by setGraphicsPipeline()
618 } dynamic;
619 } graphicsPassState;
620
622 enum Access {
623 Read = 0x01,
624 Write = 0x02
625 };
627 void reset() {
628 writtenResources.clear();
629 }
630 } computePassState;
631
633 void *ps;
636 } textureUnitState[16];
637
641
642 // relies heavily on implicit sharing (no copies of the actual data will be made)
643 const void *retainData(const QByteArray &data) {
644 dataRetainPool.append(data);
645 return dataRetainPool.last().constData();
646 }
648 bufferDataRetainPool.append(data);
649 return reinterpret_cast<const uchar *>(bufferDataRetainPool.last().constData());
650 }
651 const void *retainImage(const QImage &image) {
652 imageRetainPool.append(image);
653 return imageRetainPool.last().constBits();
654 }
656 commands.reset();
657 dataRetainPool.clear();
658 bufferDataRetainPool.clear();
659 imageRetainPool.clear();
660
661 passResTrackers.clear();
663 }
664 void resetState() {
667 // do not zero lastGpuTime
668 currentTarget = nullptr;
671 }
673 currentGraphicsPipeline = nullptr;
674 currentComputePipeline = nullptr;
676 currentGraphicsSrb = nullptr;
677 currentComputeSrb = nullptr;
679 graphicsPassState.reset();
680 computePassState.reset();
681 memset(textureUnitState, 0, sizeof(textureUnitState));
682 }
683};
684
687{
688 return a.func == b.func
689 && a.failOp == b.failOp
690 && a.zfailOp == b.zfailOp
691 && a.zpassOp == b.zpassOp;
692}
693
696{
697 return !(a == b);
698}
699
702{
703 return a.r == b.r && a.g == b.g && a.b == b.b && a.a == b.a;
704}
705
708{
709 return !(a == b);
710}
711
714{
715 return a.srcColor == b.srcColor
716 && a.dstColor == b.dstColor
717 && a.srcAlpha == b.srcAlpha
718 && a.dstAlpha == b.dstAlpha
719 && a.opColor == b.opColor
720 && a.opAlpha == b.opAlpha;
721}
722
725{
726 return !(a == b);
727}
728
730{
731 static const int TIMESTAMP_PAIRS = 2;
732
735
736 void prepare(QRhiGles2 *rhiD);
737 void destroy(QRhiGles2 *rhiD);
738 bool tryQueryTimestamps(int pairIndex, QRhiGles2 *rhiD, double *elapsedSec);
739};
740
768
770{
771public:
772 QRhiGles2(QRhiGles2InitParams *params, QRhiGles2NativeHandles *importDevice = nullptr);
773
774 bool create(QRhi::Flags flags) override;
775 void destroy() override;
776
780 QRhiBuffer *createBuffer(QRhiBuffer::Type type,
781 QRhiBuffer::UsageFlags usage,
782 quint32 size) override;
783 QRhiRenderBuffer *createRenderBuffer(QRhiRenderBuffer::Type type,
784 const QSize &pixelSize,
785 int sampleCount,
786 QRhiRenderBuffer::Flags flags,
787 QRhiTexture::Format backingFormatHint) override;
788 QRhiTexture *createTexture(QRhiTexture::Format format,
789 const QSize &pixelSize,
790 int depth,
791 int arraySize,
792 int sampleCount,
793 QRhiTexture::Flags flags) override;
794 QRhiSampler *createSampler(QRhiSampler::Filter magFilter,
795 QRhiSampler::Filter minFilter,
796 QRhiSampler::Filter mipmapMode,
797 QRhiSampler:: AddressMode u,
798 QRhiSampler::AddressMode v,
799 QRhiSampler::AddressMode w) override;
800
801 QRhiTextureRenderTarget *createTextureRenderTarget(const QRhiTextureRenderTargetDescription &desc,
802 QRhiTextureRenderTarget::Flags flags) override;
803
804 QRhiShadingRateMap *createShadingRateMap() override;
805
806 QRhiSwapChain *createSwapChain() override;
807 QRhi::FrameOpResult beginFrame(QRhiSwapChain *swapChain, QRhi::BeginFrameFlags flags) override;
808 QRhi::FrameOpResult endFrame(QRhiSwapChain *swapChain, QRhi::EndFrameFlags flags) override;
809 QRhi::FrameOpResult beginOffscreenFrame(QRhiCommandBuffer **cb, QRhi::BeginFrameFlags flags) override;
810 QRhi::FrameOpResult endOffscreenFrame(QRhi::EndFrameFlags flags) override;
811 QRhi::FrameOpResult finish() override;
812
813 void resourceUpdate(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override;
814
815 void beginPass(QRhiCommandBuffer *cb,
816 QRhiRenderTarget *rt,
817 const QColor &colorClearValue,
818 const QRhiDepthStencilClearValue &depthStencilClearValue,
819 QRhiResourceUpdateBatch *resourceUpdates,
820 QRhiCommandBuffer::BeginPassFlags flags) override;
821 void endPass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override;
822
823 void setGraphicsPipeline(QRhiCommandBuffer *cb,
824 QRhiGraphicsPipeline *ps) override;
825
826 void setShaderResources(QRhiCommandBuffer *cb,
827 QRhiShaderResourceBindings *srb,
828 int dynamicOffsetCount,
829 const QRhiCommandBuffer::DynamicOffset *dynamicOffsets) override;
830
831 void setVertexInput(QRhiCommandBuffer *cb,
832 int startBinding, int bindingCount, const QRhiCommandBuffer::VertexInput *bindings,
833 QRhiBuffer *indexBuf, quint32 indexOffset,
834 QRhiCommandBuffer::IndexFormat indexFormat) override;
835
836 void setViewport(QRhiCommandBuffer *cb, const QRhiViewport &viewport) override;
837 void setScissor(QRhiCommandBuffer *cb, const QRhiScissor &scissor) override;
838 void setBlendConstants(QRhiCommandBuffer *cb, const QColor &c) override;
839 void setStencilRef(QRhiCommandBuffer *cb, quint32 refValue) override;
840 void setShadingRate(QRhiCommandBuffer *cb, const QSize &coarsePixelSize) override;
841
842 void draw(QRhiCommandBuffer *cb, quint32 vertexCount,
843 quint32 instanceCount, quint32 firstVertex, quint32 firstInstance) override;
844
845 void drawIndexed(QRhiCommandBuffer *cb, quint32 indexCount,
846 quint32 instanceCount, quint32 firstIndex,
847 qint32 vertexOffset, quint32 firstInstance) override;
848
849 void debugMarkBegin(QRhiCommandBuffer *cb, const QByteArray &name) override;
850 void debugMarkEnd(QRhiCommandBuffer *cb) override;
851 void debugMarkMsg(QRhiCommandBuffer *cb, const QByteArray &msg) override;
852
853 void beginComputePass(QRhiCommandBuffer *cb,
854 QRhiResourceUpdateBatch *resourceUpdates,
855 QRhiCommandBuffer::BeginPassFlags flags) override;
856 void endComputePass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override;
857 void setComputePipeline(QRhiCommandBuffer *cb, QRhiComputePipeline *ps) override;
858 void dispatch(QRhiCommandBuffer *cb, int x, int y, int z) override;
859
860 const QRhiNativeHandles *nativeHandles(QRhiCommandBuffer *cb) override;
861 void beginExternal(QRhiCommandBuffer *cb) override;
862 void endExternal(QRhiCommandBuffer *cb) override;
863 double lastCompletedGpuTime(QRhiCommandBuffer *cb) override;
864
865 QList<int> supportedSampleCounts() const override;
866 QList<QSize> supportedShadingRates(int sampleCount) const override;
867 int ubufAlignment() const override;
868 bool isYUpInFramebuffer() const override;
869 bool isYUpInNDC() const override;
870 bool isClipDepthZeroToOne() const override;
871 QMatrix4x4 clipSpaceCorrMatrix() const override;
872 bool isTextureFormatSupported(QRhiTexture::Format format, QRhiTexture::Flags flags) const override;
873 bool isFeatureSupported(QRhi::Feature feature) const override;
874 int resourceLimit(QRhi::ResourceLimit limit) const override;
875 const QRhiNativeHandles *nativeHandles() override;
876 QRhiDriverInfo driverInfo() const override;
877 QRhiStats statistics() override;
879 void setQueueSubmitParams(QRhiNativeHandles *params) override;
881 bool isDeviceLost() const override;
882
883 QByteArray pipelineCacheData() override;
884 void setPipelineCacheData(const QByteArray &data) override;
885
886 bool ensureContext(QSurface *surface = nullptr) const;
892 int layer, int level, const QRhiTextureSubresourceUploadDescription &subresDesc);
893 void enqueueResourceUpdates(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates);
895 QGles2Buffer *bufD,
899 QGles2Texture *texD,
902 void executeCommandBuffer(QRhiCommandBuffer *cb);
905 void *ps, uint psGeneration, int glslLocation,
906 int *texUnit, bool *activeTexUnitAltered);
908 QRhiGraphicsPipeline *maybeGraphicsPs, QRhiComputePipeline *maybeComputePs,
909 QRhiShaderResourceBindings *srb,
910 const uint *dynOfsPairs, int dynOfsCount);
912 bool *wantsColorClear = nullptr, bool *wantsDsClear = nullptr);
914 QByteArray shaderSource(const QRhiShaderStage &shaderStage, QShaderVersion *shaderVersion);
915 bool compileShader(GLuint program, const QRhiShaderStage &shaderStage, QShaderVersion *shaderVersion);
916 bool linkProgram(GLuint program);
918 void registerUniformIfActive(const QShaderDescription::BlockVariable &var,
919 const QByteArray &namePrefix, int binding, int baseOffset,
920 GLuint program,
921 ActiveUniformLocationTracker *activeUniformLocations,
922 QGles2UniformDescriptionVector *dst);
923 void gatherUniforms(GLuint program, const QShaderDescription::UniformBlock &ub,
924 ActiveUniformLocationTracker *activeUniformLocations, QGles2UniformDescriptionVector *dst);
925 void gatherSamplers(GLuint program, const QShaderDescription::InOutVariable &v,
926 QGles2SamplerDescriptionVector *dst);
927 void gatherGeneratedSamplers(GLuint program,
928 const QShader::SeparateToCombinedImageSamplerMapping &mapping,
929 QGles2SamplerDescriptionVector *dst);
930 void sanityCheckVertexFragmentInterface(const QShaderDescription &vsDesc, const QShaderDescription &fsDesc);
932
938 ProgramCacheResult tryLoadFromDiskOrPipelineCache(const QRhiShaderStage *stages,
939 int stageCount,
940 GLuint program,
941 const QVector<QShaderDescription::InOutVariable> &inputVars,
942 QByteArray *cacheKey);
943 void trySaveToDiskCache(GLuint program, const QByteArray &cacheKey);
944 void trySaveToPipelineCache(GLuint program, const QByteArray &cacheKey, bool force = false);
945
947 QOpenGLContext *ctx = nullptr;
948 bool importedContext = false;
953 mutable bool needsMakeCurrentDueToSwap = false;
954 QOpenGLExtensions *f = nullptr;
957 const void *) = nullptr;
960 const GLvoid *) = nullptr;
962 GLsizei) = nullptr;
964 const GLvoid *) = nullptr;
966 GLsizei, const GLvoid *) = nullptr;
968 GLint) = nullptr;
970 GLint, GLsizei) = nullptr;
973 void (QOPENGLF_APIENTRYP glObjectLabel)(GLenum, GLuint, GLsizei, const GLchar *) = nullptr;
977 uint vao = 0;
978 struct Caps {
980 : ctxMajor(2),
981 ctxMinor(0),
982 maxTextureSize(2048),
984 maxSamples(16),
991 maxUniformVectors(4096),
994 msaaRenderBuffer(false),
995 multisampledTexture(false),
996 npotTextureFull(true),
997 gles(false),
999 bgraExternalFormat(false),
1000 bgraInternalFormat(false),
1001 r8Format(false),
1002 r16Format(false),
1003 r32uiFormat(false),
1004 floatFormats(false),
1005 rgb10Formats(false),
1006 depthTexture(false),
1007 packedDepthStencil(false),
1009 srgbWriteControl(false),
1010 coreProfile(false),
1011 uniformBuffers(false),
1012 elementIndexUint(false),
1013 depth24(false),
1014 rgba8Format(false),
1015 instancing(false),
1016 baseVertex(false),
1017 compute(false),
1018 textureCompareMode(false),
1019 depthClamp(false),
1020 properMapBuffer(false),
1022 texelFetch(false),
1023 intAttributes(true),
1025 programBinary(false),
1026 texture3D(false),
1027 tessellation(false),
1028 geometryShader(false),
1029 texture1D(false),
1030 hasDrawBuffersFunc(false),
1031 halfAttributes(false),
1032 multiView(false),
1033 timestamps(false),
1034 objectLabel(false),
1037 unpackRowLength(false),
1039 { }
1054 // Multisample fb and blit are supported (GLES 3.0 or OpenGL 3.x). Not
1055 // the same as multisample textures!
1059 uint gles : 1;
1063 uint r8Format : 1;
1064 uint r16Format : 1;
1065 uint r32uiFormat : 1;
1072 uint coreProfile : 1;
1075 uint depth24 : 1;
1076 uint rgba8Format : 1;
1077 uint instancing : 1;
1078 uint baseVertex : 1;
1079 uint compute : 1;
1081 uint depthClamp : 1;
1084 uint texelFetch : 1;
1088 uint texture3D : 1;
1091 uint texture1D : 1;
1094 uint multiView : 1;
1095 uint timestamps : 1;
1096 uint objectLabel : 1;
1102 } caps;
1108 mutable bool contextLost = false;
1109 uint frameNo = 0;
1110
1120 union {
1121 struct {
1123 } buffer;
1124 struct {
1126 } pipeline;
1127 struct {
1129 } texture;
1130 struct {
1133 } renderbuffer;
1134 struct {
1137 } textureRenderTarget;
1138 };
1139 };
1141
1143 OffscreenFrame(QRhiImplementation *rhi) : cbWrapper(rhi) { }
1144 bool active = false;
1147 } ofr;
1148
1150
1156
1175};
1176
1178
1179QT_END_NAMESPACE
1180
1181#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:807
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:818
QRhiBackendCommandList()=default
T * cend() const
Definition qrhi_p.h:777
T * cbegin() const
Definition qrhi_p.h:776
bool isEmpty() const
Definition qrhi_p.h:762
void assign(QByteArray data)
Definition qrhi_p.h:398
QRhiBufferData()=default
void assign(const char *s, quint32 size)
Definition qrhi_p.h:379
quint32 size() const
Definition qrhi_p.h:371
QRhiBufferData(const QRhiBufferData &other)
Definition qrhi_p.h:350
quint32 largeAlloc() const
Definition qrhi_p.h:375
QRhiBufferData & operator=(const QRhiBufferData &other)
Definition qrhi_p.h:356
const char * constData() const
Definition qrhi_p.h:367
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
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
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
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:380
QRhi::FrameOpResult endOffscreenFrame(QRhi::EndFrameFlags flags) override
Definition qrhinull.cpp:409
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:344
void dispatch(QRhiCommandBuffer *cb, int x, int y, int z) override
Definition qrhinull.cpp:356
QRhi::FrameOpResult beginFrame(QRhiSwapChain *swapChain, QRhi::BeginFrameFlags flags) override
Definition qrhinull.cpp:386
void resourceUpdate(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override
Definition qrhinull.cpp:486
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:582
void beginPass(QRhiCommandBuffer *cb, QRhiRenderTarget *rt, const QColor &colorClearValue, const QRhiDepthStencilClearValue &depthStencilClearValue, QRhiResourceUpdateBatch *resourceUpdates, QRhiCommandBuffer::BeginPassFlags flags) override
Definition qrhinull.cpp:555
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:591
QNullCommandBuffer offscreenCommandBuffer
Definition qrhinull_p.h:296
void endPass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override
Definition qrhinull.cpp:576
QRhi::FrameOpResult endFrame(QRhiSwapChain *swapChain, QRhi::EndFrameFlags flags) override
Definition qrhinull.cpp:393
QRhi::FrameOpResult beginOffscreenFrame(QRhiCommandBuffer **cb, QRhi::BeginFrameFlags flags) override
Definition qrhinull.cpp:402
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:420
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:333
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:462
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:477
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
const QRhiNativeHandles * nativeHandles(QRhiCommandBuffer *cb) override
Definition qrhinull.cpp:364
QRhiNullNativeHandles nativeHandlesStruct
Definition qrhinull_p.h:294
bool isYUpInFramebuffer() const override
Definition qrhinull.cpp:87
QRhi::FrameOpResult finish() override
Definition qrhinull.cpp:415
void setComputePipeline(QRhiCommandBuffer *cb, QRhiComputePipeline *ps) override
Definition qrhinull.cpp:350
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:370
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:339
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
QRhiSwapChain * currentSwapChain
Definition qrhinull_p.h:295
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:375
bool isDeviceLost() const override
Definition qrhinull.cpp:191
static TextureStage toPassTrackerTextureStage(QRhiShaderResourceBinding::StageFlags stages)
Definition qrhi.cpp:11895
const QVarLengthFlatMap< QRhiBuffer *, Buffer, 12 > & buffers() const
Definition qrhi_p.h:734
static BufferStage toPassTrackerBufferStage(QRhiShaderResourceBinding::StageFlags stages)
Definition qrhi.cpp:11876
const QVarLengthFlatMap< QRhiTexture *, Texture, 12 > & textures() const
Definition qrhi_p.h:742
bool isEmpty() const
Definition qrhi.cpp:11785
void registerBuffer(QRhiBuffer *buf, int slot, BufferAccess *access, BufferStage *stage, const UsageState &state)
Definition qrhi.cpp:11802
void registerTexture(QRhiTexture *tex, TextureAccess *access, TextureStage *stage, const UsageState &state)
Definition qrhi.cpp:11842
QVarLengthArray< BufferOp, BUFFER_OPS_STATIC_ALLOC > bufferOps
Definition qrhi_p.h:577
QRhiImplementation * rhi
Definition qrhi_p.h:584
QVarLengthArray< TextureOp, TEXTURE_OPS_STATIC_ALLOC > textureOps
Definition qrhi_p.h:581
static const int BUFFER_OPS_STATIC_ALLOC
Definition qrhi_p.h:576
static QRhiResourceUpdateBatchPrivate * get(QRhiResourceUpdateBatch *b)
Definition qrhi_p.h:592
void merge(QRhiResourceUpdateBatchPrivate *other)
Definition qrhi.cpp:10030
QRhiResourceUpdateBatch * q
Definition qrhi_p.h:583
static const int TEXTURE_OPS_STATIC_ALLOC
Definition qrhi_p.h:580
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:8401
static QRhiPassResourceTracker::BufferStage earlierStage(QRhiPassResourceTracker::BufferStage a, QRhiPassResourceTracker::BufferStage b)
Definition qrhi.cpp:11796
QDebug operator<<(QDebug dbg, const QRhiSwapChainHdrInfo &info)
Definition qrhi.cpp:8216
static bool isImageLoadStore(QRhiPassResourceTracker::TextureAccess access)
Definition qrhi.cpp:11835
static const char * deviceTypeStr(QRhiDriverInfo::DeviceType type)
\variable QRhiDriverInfo::deviceName
Definition qrhi.cpp:9320
static QRhiPassResourceTracker::TextureStage earlierStage(QRhiPassResourceTracker::TextureStage a, QRhiPassResourceTracker::TextureStage b)
Definition qrhi.cpp:11829
QRhiTargetRectBoundMode
Definition qrhi_p.h:279
@ UnBounded
Definition qrhi_p.h:280
@ Bounded
Definition qrhi_p.h:281
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:864
bool operator!=(const QRhiRenderTargetAttachmentTracker::ResId &a, const QRhiRenderTargetAttachmentTracker::ResId &b)
Definition qrhi_p.h:804
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:799
bool qrhi_toTopLeftRenderTargetRect(const QSize &outputSize, const std::array< T, N > &r, T *x, T *y, T *w, T *h)
Definition qrhi_p.h:285
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:597
bool create() override
Creates the corresponding native graphics resources.
Definition qrhinull.cpp:617
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
Definition qrhinull.cpp:607
char * beginFullDynamicBufferUpdateForCurrentFrame() override
Definition qrhinull.cpp:631
QNullCommandBuffer(QRhiImplementation *rhi)
Definition qrhinull.cpp:993
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:979
bool create() override
Definition qrhinull.cpp:986
QNullComputePipeline(QRhiImplementation *rhi)
Definition qrhinull.cpp:969
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
Definition qrhinull.cpp:952
bool create() override
Creates the corresponding native graphics resources.
Definition qrhinull.cpp:959
QNullGraphicsPipeline(QRhiImplementation *rhi)
Definition qrhinull.cpp:942
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
Definition qrhinull.cpp:649
bool create() override
Creates the corresponding native graphics resources.
Definition qrhinull.cpp:658
QNullRenderBuffer(QRhiImplementation *rhi, Type type, const QSize &pixelSize, int sampleCount, QRhiRenderBuffer::Flags flags, QRhiTexture::Format backingFormatHint)
Definition qrhinull.cpp:637
QRhiTexture::Format backingFormat() const override
Definition qrhinull.cpp:672
QNullRenderPassDescriptor(QRhiImplementation *rhi)
Definition qrhinull.cpp:777
QRhiRenderPassDescriptor * newCompatibleRenderPassDescriptor() const override
Definition qrhinull.cpp:800
QVector< quint32 > serializedFormat() const override
Definition qrhinull.cpp:808
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
Definition qrhinull.cpp:787
bool isCompatible(const QRhiRenderPassDescriptor *other) const override
Definition qrhinull.cpp:794
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:763
QNullSampler(QRhiImplementation *rhi, Filter magFilter, Filter minFilter, Filter mipmapMode, AddressMode u, AddressMode v, AddressMode w)
Definition qrhinull.cpp:752
bool create() override
Definition qrhinull.cpp:770
QNullShaderResourceBindings(QRhiImplementation *rhi)
Definition qrhinull.cpp:908
bool create() override
Creates the corresponding resource binding set.
Definition qrhinull.cpp:925
void updateResources(UpdateFlags flags) override
Definition qrhinull.cpp:937
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
Definition qrhinull.cpp:918
QSize pixelSize() const override
Definition qrhinull.cpp:828
float devicePixelRatio() const override
Definition qrhinull.cpp:833
QNullRenderTargetData d
Definition qrhinull_p.h:101
QNullSwapChainRenderTarget(QRhiImplementation *rhi, QRhiSwapChain *swapchain)
Definition qrhinull.cpp:813
int sampleCount() const override
Definition qrhinull.cpp:838
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
Definition qrhinull.cpp:824
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:890
int sampleCount() const override
Definition qrhinull.cpp:903
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
Definition qrhinull.cpp:856
QRhiRenderPassDescriptor * newCompatibleRenderPassDescriptor() override
Definition qrhinull.cpp:863
bool create() override
Creates the corresponding native graphics resources.
Definition qrhinull.cpp:871
QNullTextureRenderTarget(QRhiImplementation *rhi, const QRhiTextureRenderTargetDescription &desc, Flags flags)
Definition qrhinull.cpp:843
QNullRenderTargetData d
Definition qrhinull_p.h:117
float devicePixelRatio() const override
Definition qrhinull.cpp:898
bool create() override
Creates the corresponding native graphics resources.
Definition qrhinull.cpp:697
bool createFrom(NativeTexture src) override
Similar to create(), except that no new native textures are created.
Definition qrhinull.cpp:736
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:677
uint generation
Definition qrhinull_p.h:59
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
Definition qrhinull.cpp:688
bool operator!=(const Batch &other) const
Definition qrhi_p.h:632
QVector< T > resources
Definition qrhi_p.h:625
bool operator==(const Batch &other) const
Definition qrhi_p.h:627
void feed(int binding, T resource)
Definition qrhi_p.h:598
QVector< Batch > batches
Definition qrhi_p.h:641
bool operator!=(const QRhiBatchedBindings< T > &other) const
Definition qrhi_p.h:648
bool operator==(const QRhiBatchedBindings< T > &other) const
Definition qrhi_p.h:643
char smallData[SMALL_DATA_SIZE]
Definition qrhi_p.h:337
QByteArray largeData
Definition qrhi_p.h:335
static constexpr quint32 SMALL_DATA_SIZE
Definition qrhi_p.h:336
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:810
static bool isUpToDate(const QRhiTextureRenderTargetDescription &desc, const ResIdList &currentResIdList)
Definition qrhi_p.h:848
static void changeToDynamicUpdate(BufferOp *op, QRhiBuffer *buf, quint32 offset, QByteArray data)
Definition qrhi_p.h:460
static void changeToStaticUpload(BufferOp *op, QRhiBuffer *buf, quint32 offset, QByteArray data)
Definition qrhi_p.h:491
static void changeToStaticUpload(BufferOp *op, QRhiBuffer *buf, quint32 offset, quint32 size, const void *data)
Definition qrhi_p.h:475
static BufferOp dynamicUpdate(QRhiBuffer *buf, quint32 offset, QByteArray data)
Definition qrhi_p.h:453
static BufferOp staticUpload(QRhiBuffer *buf, quint32 offset, QByteArray data)
Definition qrhi_p.h:484
static BufferOp staticUpload(QRhiBuffer *buf, quint32 offset, quint32 size, const void *data)
Definition qrhi_p.h:468
static BufferOp read(QRhiBuffer *buf, quint32 offset, quint32 size, QRhiReadbackResult *result)
Definition qrhi_p.h:499
static BufferOp dynamicUpdate(QRhiBuffer *buf, quint32 offset, quint32 size, const void *data)
Definition qrhi_p.h:437
static void changeToDynamicUpdate(BufferOp *op, QRhiBuffer *buf, quint32 offset, quint32 size, const void *data)
Definition qrhi_p.h:444
QRhiTextureCopyDescription desc
Definition qrhi_p.h:527
static TextureOp copy(QRhiTexture *dst, QRhiTexture *src, const QRhiTextureCopyDescription &desc)
Definition qrhi_p.h:547
QVarLengthArray< MipLevelUploadList, 6 > subresDesc
Definition qrhi_p.h:525
static TextureOp upload(QRhiTexture *tex, const QRhiTextureUploadDescription &desc)
Definition qrhi_p.h:531
static TextureOp genMips(QRhiTexture *tex)
Definition qrhi_p.h:566
static TextureOp read(const QRhiReadbackDescription &rb, QRhiReadbackResult *result)
Definition qrhi_p.h:557
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
Definition qrhi.h:1556
LimitsType limitsType
Definition qrhi.h:1567
float maxPotentialColorComponentValue
Definition qrhi.h:1575
LuminanceBehavior luminanceBehavior
Definition qrhi.h:1578
float maxColorComponentValue
Definition qrhi.h:1574
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
Definition qrhi.h:1589
void * reserved[2]
Definition qrhi.h:1590
uint dynamicOffsetPairs[MAX_DYNAMIC_OFFSET_COUNT *2]
QRhiShaderResourceBindings * srb
QRhiGraphicsPipeline * maybeGraphicsPs
QRhiComputePipeline * maybeComputePs
QRhiSwapChain::StereoTargetBuffer stereoTarget