Qt 6.x
The Qt SDK
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
4#ifndef QRHIGLES2_P_H
5#define QRHIGLES2_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include "qrhi_p.h"
20#include <qopengl.h>
21#include <QByteArray>
22#include <QWindow>
23#include <QPointer>
24#include <QtCore/private/qduplicatetracker_p.h>
25#include <optional>
26
28
30
31struct QGles2Buffer : public QRhiBuffer
32{
35 void destroy() override;
36 bool create() override;
40
45 enum Access {
54 };
55 struct UsageState {
57 };
59 friend class QRhiGles2;
60};
61
63{
65 int sampleCount, QRhiRenderBuffer::Flags flags,
66 QRhiTexture::Format backingFormatHint);
68 void destroy() override;
69 bool create() override;
70 bool createFrom(NativeRenderBuffer src) override;
71 QRhiTexture::Format backingFormat() const override;
72
74 GLuint stencilRenderbuffer = 0; // when packed depth-stencil not supported
76 bool owns = true;
78 friend class QRhiGles2;
79};
80
82{
89};
90
92{
93 return a.glminfilter == b.glminfilter
94 && a.glmagfilter == b.glmagfilter
95 && a.glwraps == b.glwraps
96 && a.glwrapt == b.glwrapt
97 && a.glwrapr == b.glwrapr
98 && a.gltexcomparefunc == b.gltexcomparefunc;
99}
100
102{
103 return !(a == b);
104}
105
107{
109 int arraySize, int sampleCount, Flags flags);
111 void destroy() override;
112 bool create() override;
113 bool createFrom(NativeTexture src) override;
114 NativeTexture nativeTexture() override;
115
116 bool prepareCreate(QSize *adjustedSize = nullptr);
117
119 bool owns = true;
126 bool specified = false;
127 bool zeroInitialized = false;
129
130 enum Access {
139 };
140 struct UsageState {
142 };
144
146 friend class QRhiGles2;
147};
148
150{
154 void destroy() override;
155 bool create() override;
156
159 friend class QRhiGles2;
160};
161
163{
166 void destroy() override;
167 bool isCompatible(const QRhiRenderPassDescriptor *other) const override;
169 QVector<quint32> serializedFormat() const override;
170};
171
173{
175
176 bool isValid() const { return rp != nullptr; }
177
180 float dpr = 1;
181 int sampleCount = 1;
183 int dsAttCount = 0;
184 bool srgbUpdateAndBlend = false;
186 std::optional<QRhiSwapChain::StereoTargetBuffer> stereoTarget;
187};
188
190{
193 void destroy() override;
194
195 QSize pixelSize() const override;
196 float devicePixelRatio() const override;
197 int sampleCount() const override;
198
200};
201
203{
206 void destroy() override;
207
208 QSize pixelSize() const override;
209 float devicePixelRatio() const override;
210 int sampleCount() const override;
211
213 bool create() override;
214
217 friend class QRhiGles2;
218};
219
221{
224 void destroy() override;
225 bool create() override;
226 void updateResources(UpdateFlags flags) override;
227
228 bool hasDynamicOffset = false;
230 friend class QRhiGles2;
231};
232
234{
241};
242
244
246{
251};
252
254
257
259{
260 static constexpr int MAX_TRACKED_LOCATION = 1023;
262 float v[4];
263};
264
266{
269 void destroy() override;
270 bool create() override;
271
273 GLenum drawMode = GL_TRIANGLES;
280 friend class QRhiGles2;
281};
282
284{
287 void destroy() override;
288 bool create() override;
289
297 friend class QRhiGles2;
298};
299
301{
304 void destroy() override;
305
306 // keep at a reasonably low value otherwise sizeof Command explodes
307 static const int MAX_DYNAMIC_OFFSET_COUNT = 8;
308
309 struct Command {
310 enum Cmd {
339 Barrier
340 };
342
343 // QRhi*/QGles2* references should be kept at minimum (so no
344 // QRhiTexture/Buffer/etc. pointers).
345 union Args {
346 struct {
347 float x, y, w, h;
348 float d0, d1;
350 struct {
351 int x, y, w, h;
353 struct {
354 float r, g, b, a;
356 struct {
360 struct {
366 struct {
371 struct {
378 struct {
386 struct {
389 struct {
396 struct {
398 float c[4];
399 float d;
402 struct {
404 bool srgb;
406 bool stereo;
409 struct {
413 int size;
414 const void *data; // must come from retainData()
416 struct {
420 int offset;
421 int size;
423 struct {
428 int srcX;
429 int srcY;
430 int srcZ;
435 int dstX;
436 int dstY;
437 int dstZ;
438 int w;
439 int h;
441 struct {
444 int w;
445 int h;
448 int level;
451 struct {
455 int level;
456 int dx;
457 int dy;
458 int dz;
459 int w;
460 int h;
465 const void *data; // must come from retainImage()
467 struct {
471 int level;
473 int w;
474 int h;
475 int depth;
476 int size;
477 const void *data; // must come from retainData()
479 struct {
483 int level;
484 int dx;
485 int dy;
486 int dz;
487 int w;
488 int h;
490 int size;
491 const void *data; // must come from retainData()
493 struct {
495 int w;
496 int h;
499 int dstLevel;
502 struct {
505 int srcLevel;
507 int w;
508 int h;
511 int dstLevel;
512 int dstLayer;
514 struct {
518 struct {
521 struct {
526 struct {
529 struct {
533 };
534
535 enum PassType {
539 };
540
544
554
556 bool valid = false;
562 struct ColorMask { bool r, g, b, a; } colorMask;
563 struct Blend {
577 struct StencilFace {
582 } stencil[2]; // front, back
589 void reset() { valid = false; }
590 struct {
591 // not part of QRhiGraphicsPipeline but used by setGraphicsPipeline()
595
597 enum Access {
598 Read = 0x01,
599 Write = 0x02
600 };
602 void reset() {
604 }
606
608 void *ps;
612
616
617 // relies heavily on implicit sharing (no copies of the actual data will be made)
618 const void *retainData(const QByteArray &data) {
620 return dataRetainPool.last().constData();
621 }
624 return reinterpret_cast<const uchar *>(bufferDataRetainPool.last().constData());
625 }
626 const void *retainImage(const QImage &image) {
628 return imageRetainPool.last().constBits();
629 }
631 commands.reset();
635
638 }
639 void resetState() {
642 currentTarget = nullptr;
645 }
647 currentGraphicsPipeline = nullptr;
648 currentComputePipeline = nullptr;
650 currentGraphicsSrb = nullptr;
651 currentComputeSrb = nullptr;
655 memset(textureUnitState, 0, sizeof(textureUnitState));
656 }
657};
658
661{
662 return a.func == b.func
663 && a.failOp == b.failOp
664 && a.zfailOp == b.zfailOp
665 && a.zpassOp == b.zpassOp;
666}
667
670{
671 return !(a == b);
672}
673
676{
677 return a.r == b.r && a.g == b.g && a.b == b.b && a.a == b.a;
678}
679
682{
683 return !(a == b);
684}
685
688{
689 return a.srcColor == b.srcColor
690 && a.dstColor == b.dstColor
691 && a.srcAlpha == b.srcAlpha
692 && a.dstAlpha == b.dstAlpha
693 && a.opColor == b.opColor
694 && a.opAlpha == b.opAlpha;
695}
696
699{
700 return !(a == b);
701}
702
704{
707 void destroy() override;
708
712
713 QSize surfacePixelSize() override;
714 bool isFormatSupported(Format f) override;
715
717 bool createOrResize() override;
718
720
721 QSurface *surface = nullptr;
727 int frameCount = 0;
728};
729
731{
732public:
734
735 bool create(QRhi::Flags flags) override;
736 void destroy() override;
737
742 QRhiBuffer::UsageFlags usage,
743 quint32 size) override;
745 const QSize &pixelSize,
746 int sampleCount,
747 QRhiRenderBuffer::Flags flags,
748 QRhiTexture::Format backingFormatHint) override;
750 const QSize &pixelSize,
751 int depth,
752 int arraySize,
753 int sampleCount,
754 QRhiTexture::Flags flags) override;
756 QRhiSampler::Filter minFilter,
757 QRhiSampler::Filter mipmapMode,
760 QRhiSampler::AddressMode w) override;
761
763 QRhiTextureRenderTarget::Flags flags) override;
764
765 QRhiSwapChain *createSwapChain() override;
766 QRhi::FrameOpResult beginFrame(QRhiSwapChain *swapChain, QRhi::BeginFrameFlags flags) override;
767 QRhi::FrameOpResult endFrame(QRhiSwapChain *swapChain, QRhi::EndFrameFlags flags) override;
768 QRhi::FrameOpResult beginOffscreenFrame(QRhiCommandBuffer **cb, QRhi::BeginFrameFlags flags) override;
769 QRhi::FrameOpResult endOffscreenFrame(QRhi::EndFrameFlags flags) override;
770 QRhi::FrameOpResult finish() override;
771
772 void resourceUpdate(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override;
773
776 const QColor &colorClearValue,
777 const QRhiDepthStencilClearValue &depthStencilClearValue,
778 QRhiResourceUpdateBatch *resourceUpdates,
779 QRhiCommandBuffer::BeginPassFlags flags) override;
780 void endPass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override;
781
783 QRhiGraphicsPipeline *ps) override;
784
787 int dynamicOffsetCount,
788 const QRhiCommandBuffer::DynamicOffset *dynamicOffsets) override;
789
791 int startBinding, int bindingCount, const QRhiCommandBuffer::VertexInput *bindings,
792 QRhiBuffer *indexBuf, quint32 indexOffset,
793 QRhiCommandBuffer::IndexFormat indexFormat) override;
794
795 void setViewport(QRhiCommandBuffer *cb, const QRhiViewport &viewport) override;
796 void setScissor(QRhiCommandBuffer *cb, const QRhiScissor &scissor) override;
797 void setBlendConstants(QRhiCommandBuffer *cb, const QColor &c) override;
798 void setStencilRef(QRhiCommandBuffer *cb, quint32 refValue) override;
799
800 void draw(QRhiCommandBuffer *cb, quint32 vertexCount,
801 quint32 instanceCount, quint32 firstVertex, quint32 firstInstance) override;
802
803 void drawIndexed(QRhiCommandBuffer *cb, quint32 indexCount,
804 quint32 instanceCount, quint32 firstIndex,
805 qint32 vertexOffset, quint32 firstInstance) override;
806
807 void debugMarkBegin(QRhiCommandBuffer *cb, const QByteArray &name) override;
808 void debugMarkEnd(QRhiCommandBuffer *cb) override;
809 void debugMarkMsg(QRhiCommandBuffer *cb, const QByteArray &msg) override;
810
812 QRhiResourceUpdateBatch *resourceUpdates,
813 QRhiCommandBuffer::BeginPassFlags flags) override;
814 void endComputePass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override;
816 void dispatch(QRhiCommandBuffer *cb, int x, int y, int z) override;
817
819 void beginExternal(QRhiCommandBuffer *cb) override;
820 void endExternal(QRhiCommandBuffer *cb) override;
821 double lastCompletedGpuTime(QRhiCommandBuffer *cb) override;
822
823 QList<int> supportedSampleCounts() const override;
824 int ubufAlignment() const override;
825 bool isYUpInFramebuffer() const override;
826 bool isYUpInNDC() const override;
827 bool isClipDepthZeroToOne() const override;
828 QMatrix4x4 clipSpaceCorrMatrix() const override;
829 bool isTextureFormatSupported(QRhiTexture::Format format, QRhiTexture::Flags flags) const override;
830 bool isFeatureSupported(QRhi::Feature feature) const override;
831 int resourceLimit(QRhi::ResourceLimit limit) const override;
832 const QRhiNativeHandles *nativeHandles() override;
833 QRhiDriverInfo driverInfo() const override;
834 QRhiStats statistics() override;
836 void releaseCachedResources() override;
837 bool isDeviceLost() const override;
838
839 QByteArray pipelineCacheData() override;
840 void setPipelineCacheData(const QByteArray &data) override;
841
842 bool ensureContext(QSurface *surface = nullptr) const;
848 int layer, int level, const QRhiTextureSubresourceUploadDescription &subresDesc);
851 QGles2Buffer *bufD,
855 QGles2Texture *texD,
861 void *ps, uint psGeneration, int glslLocation,
862 int *texUnit, bool *activeTexUnitAltered);
864 QRhiGraphicsPipeline *maybeGraphicsPs, QRhiComputePipeline *maybeComputePs,
866 const uint *dynOfsPairs, int dynOfsCount);
868 bool *wantsColorClear = nullptr, bool *wantsDsClear = nullptr);
870 int effectiveSampleCount(int sampleCount) const;
871 QByteArray shaderSource(const QRhiShaderStage &shaderStage, QShaderVersion *shaderVersion);
872 bool compileShader(GLuint program, const QRhiShaderStage &shaderStage, QShaderVersion *shaderVersion);
875 const QByteArray &namePrefix, int binding, int baseOffset,
877 QDuplicateTracker<int, 256> *activeUniformLocations,
888
893 };
895 int stageCount,
898 QByteArray *cacheKey);
899 void trySaveToDiskCache(GLuint program, const QByteArray &cacheKey);
900 void trySaveToPipelineCache(GLuint program, const QByteArray &cacheKey, bool force = false);
901
902 QRhi::Flags rhiFlags;
903 QOpenGLContext *ctx = nullptr;
904 bool importedContext = false;
909 mutable bool needsMakeCurrentDueToSwap = false;
911 void (QOPENGLF_APIENTRYP glPolygonMode) (GLenum, GLenum) = nullptr;
913 const void *) = nullptr;
914 void(QOPENGLF_APIENTRYP glTexStorage1D)(GLenum, GLint, GLenum, GLsizei) = nullptr;
916 const GLvoid *) = nullptr;
918 GLsizei) = nullptr;
920 const GLvoid *) = nullptr;
921 void(QOPENGLF_APIENTRYP glCompressedTexSubImage1D)(GLenum, GLint, GLint, GLsizei, GLenum,
922 GLsizei, const GLvoid *) = nullptr;
923 void(QOPENGLF_APIENTRYP glFramebufferTexture1D)(GLenum, GLenum, GLenum, GLuint,
924 GLint) = nullptr;
925 void(QOPENGLF_APIENTRYP glFramebufferTextureMultiviewOVR)(GLenum, GLenum, GLuint, GLint,
926 GLint, GLsizei) = nullptr;
927
929 struct Caps {
931 : ctxMajor(2),
932 ctxMinor(0),
933 maxTextureSize(2048),
935 maxSamples(16),
942 maxUniformVectors(4096),
947 npotTextureFull(true),
948 gles(false),
963 depth24(false),
967 compute(false),
972 intAttributes(true),
982 { }
997 // Multisample fb and blit are supported (GLES 3.0 or OpenGL 3.x). Not
998 // the same as multisample textures!
1042 mutable bool contextLost = false;
1043
1045 enum Type {
1053 union {
1054 struct {
1057 struct {
1060 struct {
1063 struct {
1067 struct {
1070 };
1071 };
1073
1076 bool active = false;
1079
1081
1085 };
1087};
1088
1090
1092
1093#endif
\inmodule QtCore
Definition qbytearray.h:57
const char * constData() const noexcept
Returns a pointer to the const data stored in the byte array.
Definition qbytearray.h:122
The QColor class provides colors based on RGB, HSV or CMYK values.
Definition qcolor.h:31
\inmodule QtCore
Definition qhash.h:818
void clear() noexcept(std::is_nothrow_destructible< Node >::value)
Removes all items from the hash and frees up all memory used by it.
Definition qhash.h:949
\inmodule QtGui
Definition qimage.h:37
const uchar * constBits() const
Returns a pointer to the first pixel data.
Definition qimage.cpp:1713
Definition qlist.h:74
The QMatrix4x4 class represents a 4x4 transformation matrix in 3D space.
Definition qmatrix4x4.h:25
\inmodule QtGui
\inmodule QtCore
Definition qpointer.h:18
const char * constData() const
Definition qrhi_p.h:340
\inmodule QtGui
Definition qrhi.h:834
Type
Specifies storage type of buffer resource.
Definition qrhi.h:836
\inmodule QtGui
Definition qrhi.h:1614
QPair< QRhiBuffer *, quint32 > VertexInput
Synonym for QPair<QRhiBuffer *, quint32>.
Definition qrhi.h:1643
QPair< int, quint32 > DynamicOffset
Synonym for QPair<int, quint32>.
Definition qrhi.h:1639
IndexFormat
Specifies the index data type.
Definition qrhi.h:1616
\inmodule QtGui
Definition qrhi.h:1585
\inmodule QtGui
Definition qrhi.h:44
\inmodule QtGui
\variable QRhiGles2InitParams::format
QHash< QRhiShaderStage, uint > m_shaderCache
QRhiStats statistics() override
bool contextLost
void gatherUniforms(GLuint program, const QShaderDescription::UniformBlock &ub, QDuplicateTracker< int, 256 > *activeUniformLocations, QGles2UniformDescriptionVector *dst)
void registerUniformIfActive(const QShaderDescription::BlockVariable &var, const QByteArray &namePrefix, int binding, int baseOffset, GLuint program, QDuplicateTracker< int, 256 > *activeUniformLocations, QGles2UniformDescriptionVector *dst)
const GLvoid const GLvoid GLuint
void drawIndexed(QRhiCommandBuffer *cb, quint32 indexCount, quint32 instanceCount, quint32 firstIndex, qint32 vertexOffset, quint32 firstInstance) override
QOpenGLContext * maybeShareContext
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
bool isFeatureSupported(QRhi::Feature feature) const override
QRhiGraphicsPipeline * createGraphicsPipeline() override
void bindShaderResources(QGles2CommandBuffer *cbD, QRhiGraphicsPipeline *maybeGraphicsPs, QRhiComputePipeline *maybeComputePs, QRhiShaderResourceBindings *srb, const uint *dynOfsPairs, int dynOfsCount)
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
bool needsMakeCurrentDueToSwap
void trackedImageBarrier(QGles2CommandBuffer *cbD, QGles2Texture *texD, QGles2Texture::Access access)
void trackedRegisterBuffer(QRhiPassResourceTracker *passResTracker, QGles2Buffer *bufD, QRhiPassResourceTracker::BufferAccess access, QRhiPassResourceTracker::BufferStage stage)
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
int effectiveSampleCount(int sampleCount) const
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
QRhi::Flags rhiFlags
void trySaveToDiskCache(GLuint program, const QByteArray &cacheKey)
struct QRhiGles2::Caps caps
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
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)
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
const GLvoid const GLvoid GLint
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
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 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)
struct QRhiGles2::OffscreenFrame ofr
QRhi::FrameOpResult endFrame(QRhiSwapChain *swapChain, QRhi::EndFrameFlags flags) override
void setPipelineCacheData(const QByteArray &data) override
const void GLenum
QRhi::FrameOpResult endOffscreenFrame(QRhi::EndFrameFlags flags) override
void gatherGeneratedSamplers(GLuint program, const QShader::SeparateToCombinedImageSamplerMapping &mapping, QGles2SamplerDescriptionVector *dst)
const QRhiNativeHandles * nativeHandles() override
\inmodule QtGui
Definition qrhi.h:1241
\inmodule QtGui
Definition qrhi.h:1071
QSize pixelSize() const
Definition qrhi.h:1092
int sampleCount() const
Definition qrhi.h:1095
Type
Specifies the type of the renderbuffer.
Definition qrhi.h:1073
\inmodule QtGui
Definition qrhi.h:1119
\inmodule QtGui
Definition qrhi.h:1135
\inmodule QtGui
Definition qrhi.h:1694
QRhi * rhi() const
Definition qrhi.cpp:3477
\inmodule QtGui
Definition qrhi.h:1007
Filter
Specifies the minification, magnification, or mipmap filtering.
Definition qrhi.h:1009
Filter magFilter() const
Definition qrhi.h:1034
AddressMode
Specifies the addressing mode.
Definition qrhi.h:1015
Filter minFilter() const
Definition qrhi.h:1037
Filter mipmapMode() const
Definition qrhi.h:1040
\inmodule QtGui
Definition qrhi.h:138
\inmodule QtGui
Definition qrhi.h:1190
\inmodule QtGui
Definition qrhi.h:371
\inmodule QtGui
Definition qrhi.h:1150
\inmodule QtGui
Definition qrhi.h:1513
Format
Describes the swapchain format.
Definition qrhi.h:1525
StereoTargetBuffer
Selects the backbuffer to use with a stereoscopic swapchain.
Definition qrhi.h:1531
\inmodule QtGui
Definition qrhi.h:1161
\inmodule QtGui
Definition qrhi.h:883
int arraySize() const
Definition qrhi.h:969
int sampleCount() const
Definition qrhi.h:983
Format
Specifies the texture format.
Definition qrhi.h:902
QSize pixelSize() const
Definition qrhi.h:963
\inmodule QtGui
Definition qrhi.h:85
ResourceLimit
Describes the resource limit to query.
Definition qrhi.h:1846
Feature
Flag values to indicate what features are supported by the backend currently in use.
Definition qrhi.h:1793
FrameOpResult
Describes the result of operations that can have a soft failure.
Definition qrhi.h:1786
Definition qset.h:18
VariableType
Represents the type of a variable or block member.
\inmodule QtGui
Definition qshader.h:32
\inmodule QtCore
Definition qsize.h:25
The QSurfaceFormat class represents the format of a QSurface. \inmodule QtGui.
\inmodule QtGui
Definition qsurface.h:21
void append(const T &t)
Definition lalr.h:269
EGLContext ctx
Combined button and popup list for selecting options.
Definition image.cpp:4
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter int const void return DBusMessageIter DBusMessageIter return DBusMessageIter void DBusMessageIter void int return DBusMessage DBusMessageIter return DBusMessageIter return DBusMessageIter DBusMessageIter const char const char const char const char return DBusMessage return DBusMessage const char return DBusMessage dbus_bool_t return DBusMessage dbus_uint32_t return DBusMessage void
static int instanceCount
EGLOutputLayerEXT layer
Flags
#define QOPENGLF_APIENTRYP
Definition qopengl.h:265
GLboolean GLboolean GLboolean b
typedef GLint(GL_APIENTRYP PFNGLGETPROGRAMRESOURCELOCATIONINDEXEXTPROC)(GLuint program
GLbitfield stages
GLsizei const GLfloat * v
[13]
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat z
GLint GLint GLint GLint GLint x
[0]
GLint GLenum GLsizei GLsizei GLsizei depth
GLenum GLuint GLint level
GLfloat GLfloat GLfloat w
[0]
GLboolean GLboolean GLboolean GLboolean a
[7]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLsizei const GLubyte * commands
GLfloat GLfloat f
GLenum src
GLenum GLuint buffer
GLenum type
GLenum GLenum dst
typedef GLenum(GL_APIENTRYP PFNGLGETGRAPHICSRESETSTATUSKHRPROC)(void)
GLenum access
GLbitfield flags
GLenum GLuint texture
GLuint program
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLuint name
GLint GLsizei GLsizei GLenum format
GLint y
void ** params
const GLubyte * c
GLuint renderbuffer
typedef GLbitfield(APIENTRYP PFNGLQUERYMATRIXXOESPROC)(GLfixed *mantissa
GLint limit
GLuint framebuffer
GLenum GLenum GLenum GLenum mapping
GLint GLfloat GLint stencil
GLsizeiptr const void GLenum usage
Definition qopenglext.h:543
bool operator!=(const QGles2SamplerData &a, const QGles2SamplerData &b)
bool operator==(const QGles2SamplerData &a, const QGles2SamplerData &b)
Definition qrhigles2_p.h:91
#define GLuint
SSL_CTX int(* cb)(SSL *ssl, unsigned char **out, unsigned char *outlen, const unsigned char *in, unsigned int inlen, void *arg)
@ desc
@ Q_RELOCATABLE_TYPE
Definition qtypeinfo.h:145
#define Q_DECLARE_TYPEINFO(TYPE, FLAGS)
Definition qtypeinfo.h:163
unsigned int quint32
Definition qtypes.h:45
unsigned char uchar
Definition qtypes.h:27
int qint32
Definition qtypes.h:44
unsigned int uint
Definition qtypes.h:29
QSharedPointer< T > other(t)
[5]
view viewport() -> scroll(dx, dy, deviceRect)
view create()
@ AccessStorageReadWrite
Definition qrhigles2_p.h:52
QByteArray data
Definition qrhigles2_p.h:44
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:43
quint32 nonZeroSize
Definition qrhigles2_p.h:41
UsageState usageState
Definition qrhigles2_p.h:58
union QGles2CommandBuffer::Command::Args args
QHash< QRhiResource *, QPair< int, bool > > writtenResources
struct QGles2CommandBuffer::GraphicsPassState::Blend blend
struct QGles2CommandBuffer::GraphicsPassState::@357 dynamic
struct QGles2CommandBuffer::GraphicsPassState::ColorMask colorMask
QVarLengthArray< QImage, 4 > imageRetainPool
struct QGles2CommandBuffer::ComputePassState computePassState
QRhiShaderResourceBindings * currentGraphicsSrb
QVarLengthArray< QRhiBufferData, 4 > bufferDataRetainPool
static const int MAX_DYNAMIC_OFFSET_COUNT
struct QGles2CommandBuffer::GraphicsPassState graphicsPassState
QRhiBackendCommandList< Command > commands
QRhiComputePipeline * currentComputePipeline
QRhiRenderTarget * currentTarget
QRhiShaderResourceBindings * currentComputeSrb
QVarLengthArray< QRhiPassResourceTracker, 8 > passResTrackers
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.
struct QGles2CommandBuffer::TextureUnitState textureUnitState[16]
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
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.
QRhiShaderResourceBindings * currentSrb
QGles2UniformDescriptionVector uniforms
QGles2UniformState uniformState[QGles2UniformState::MAX_TRACKED_LOCATION+1]
bool create() override
Creates the corresponding native graphics resources.
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:74
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
QGles2RenderTargetData(QRhiImplementation *)
std::optional< QRhiSwapChain::StereoTargetBuffer > stereoTarget
QGles2RenderPassDescriptor * rp
QRhiRenderTargetAttachmentTracker::ResIdList currentResIdList
GLenum gltexcomparefunc
Definition qrhigles2_p.h:88
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
bool create() override
QGles2SamplerData d
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
void updateResources(UpdateFlags flags) override
float devicePixelRatio() const override
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 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
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...
QRhiCommandBuffer * currentFrameCommandBuffer() override
QGles2SwapChainRenderTarget rtLeft
QSize surfacePixelSize() override
QRhiRenderTarget * currentFrameRenderTarget() override
int sampleCount() const override
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.
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
QShaderDescription::VariableType type
static constexpr int MAX_TRACKED_LOCATION
\inmodule QtGui
Definition qrhi.h:850
\inmodule QtGui
Definition qrhi.h:1722
uint needsDepthStencilCombinedAttach
uint srgbCapableDefaultFramebuffer
int maxThreadGroupsPerDimension
uint fixedIndexPrimitiveRestart
uint screenSpaceDerivatives
uint nonBaseLevelFramebufferTexture
int maxThreadsPerThreadGroup
struct QRhiGles2::DeferredReleaseEntry::@384::@390 textureRenderTarget
struct QRhiGles2::DeferredReleaseEntry::@384::@387 pipeline
OffscreenFrame(QRhiImplementation *rhi)
QGles2CommandBuffer cbWrapper
\variable QRhiReadbackResult::completed
Definition qrhi.h:788
\inmodule QtGui
Definition qrhi.h:1686
\inmodule QtGui
Definition qrhi.h:1745
\inmodule QtGui
Definition qrhi.h:953
\variable QShaderDescription::InOutVariable::name
\variable QShaderDescription::BlockVariable::name
Definition moc.h:24
struct QGles2CommandBuffer::Command::Args::@261 stencilRef
struct QGles2CommandBuffer::Command::Args::@290 compressedSubImage
struct QGles2CommandBuffer::Command::Args::@288 compressedImage
struct QGles2CommandBuffer::Command::Args::@305 barriersForPass
struct QGles2CommandBuffer::Command::Args::@268 bindShaderResources
struct QGles2CommandBuffer::Command::Args::@296 blitFromTexture
struct QGles2CommandBuffer::Command::Args::@300 bindComputePipeline
struct QGles2CommandBuffer::Command::Args::@260 blendConstants
struct QGles2CommandBuffer::Command::Args::@302 dispatch
struct QGles2CommandBuffer::Command::Args::@270 clear
struct QGles2CommandBuffer::Command::Args::@281 readPixels
struct QGles2CommandBuffer::Command::Args::@259 scissor
struct QGles2CommandBuffer::Command::Args::@298 genMip
struct QGles2CommandBuffer::Command::Args::@263 bindIndexBuffer
struct QGles2CommandBuffer::Command::Args::@285 subImage
uint dynamicOffsetPairs[MAX_DYNAMIC_OFFSET_COUNT *2]
QRhiShaderResourceBindings * srb
struct QGles2CommandBuffer::Command::Args::@273 bindFramebuffer
struct QGles2CommandBuffer::Command::Args::@276 getBufferSubData
QRhiGraphicsPipeline * maybeGraphicsPs
struct QGles2CommandBuffer::Command::Args::@264 draw
struct QGles2CommandBuffer::Command::Args::@275 bufferSubData
struct QGles2CommandBuffer::Command::Args::@279 copyTex
struct QGles2CommandBuffer::Command::Args::@306 barrier
struct QGles2CommandBuffer::Command::Args::@258 viewport
struct QGles2CommandBuffer::Command::Args::@265 drawIndexed
QRhiComputePipeline * maybeComputePs
QRhiSwapChain::StereoTargetBuffer stereoTarget
struct QGles2CommandBuffer::Command::Args::@266 bindGraphicsPipeline
struct QGles2CommandBuffer::Command::Args::@292 blitFromRenderbuffer
struct QGles2CommandBuffer::Command::Args::@262 bindVertexBuffer