Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qrhigles2_p.h
Go to the documentation of this file.
1// Copyright (C) 2023 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#ifndef QRHIGLES2_P_H
6#define QRHIGLES2_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include "qrhi_p.h"
20#include <rhi/qshaderdescription.h>
21#include <qopengl.h>
22#include <QByteArray>
23#include <QWindow>
24#include <QPointer>
25#include <QtCore/private/qduplicatetracker_p.h>
26#include <optional>
27
28QT_BEGIN_NAMESPACE
29
30class QOpenGLExtensions;
31class QRhiGles2;
32
65
67{
68 QGles2RenderBuffer(QRhiImplementation *rhi, Type type, const QSize &pixelSize,
69 int sampleCount, QRhiRenderBuffer::Flags flags,
70 QRhiTexture::Format backingFormatHint);
72 void destroy() override;
73 bool create() override;
74 bool createFrom(NativeRenderBuffer src) override;
75 QRhiTexture::Format backingFormat() const override;
76
78 GLuint stencilRenderbuffer = 0; // when packed depth-stencil not supported
80 bool owns = true;
81 uint generation = 0;
82 friend class QRhiGles2;
83};
84
94
95inline bool operator==(const QGles2SamplerData &a, const QGles2SamplerData &b)
96{
97 return a.glminfilter == b.glminfilter
98 && a.glmagfilter == b.glmagfilter
99 && a.glwraps == b.glwraps
100 && a.glwrapt == b.glwrapt
101 && a.glwrapr == b.glwrapr
102 && a.gltexcomparefunc == b.gltexcomparefunc;
103}
104
105inline bool operator!=(const QGles2SamplerData &a, const QGles2SamplerData &b)
106{
107 return !(a == b);
108}
109
111{
112 QGles2Texture(QRhiImplementation *rhi, Format format, const QSize &pixelSize, int depth,
113 int arraySize, int sampleCount, Flags flags);
114 ~QGles2Texture();
115 void destroy() override;
116 bool create() override;
117 bool createFrom(NativeTexture src) override;
118 NativeTexture nativeTexture() override;
119
120 bool prepareCreate(QSize *adjustedSize = nullptr);
121
123 bool owns = true;
130 bool specified = false;
131 bool zeroInitialized = false;
134
145 struct UsageState {
147 };
149
150 uint generation = 0;
151 friend class QRhiGles2;
152};
153
155{
156 QGles2Sampler(QRhiImplementation *rhi, Filter magFilter, Filter minFilter, Filter mipmapMode,
157 AddressMode u, AddressMode v, AddressMode w);
158 ~QGles2Sampler();
159 void destroy() override;
160 bool create() override;
161
163 uint generation = 0;
164 friend class QRhiGles2;
165};
166
168{
169 QGles2RenderPassDescriptor(QRhiImplementation *rhi);
171 void destroy() override;
172 bool isCompatible(const QRhiRenderPassDescriptor *other) const override;
174 QVector<quint32> serializedFormat() const override;
175};
176
193
195{
196 QGles2SwapChainRenderTarget(QRhiImplementation *rhi, QRhiSwapChain *swapchain);
198 void destroy() override;
199
200 QSize pixelSize() const override;
201 float devicePixelRatio() const override;
202 int sampleCount() const override;
203
205};
206
208{
209 QGles2TextureRenderTarget(QRhiImplementation *rhi, const QRhiTextureRenderTargetDescription &desc, Flags flags);
211 void destroy() override;
212
213 QSize pixelSize() const override;
214 float devicePixelRatio() const override;
215 int sampleCount() const override;
216
218 bool create() override;
219
223 friend class QRhiGles2;
224};
225
227{
228 QGles2ShaderResourceBindings(QRhiImplementation *rhi);
230 void destroy() override;
231 bool create() override;
232 void updateResources(UpdateFlags flags) override;
233
234 bool hasDynamicOffset = false;
235 uint generation = 0;
236 friend class QRhiGles2;
237};
238
240{
247 // Distance in bytes between the array elements, or between the matrix
248 // columns for matrix types. 0 means the std140 default (16). Uniform
249 // blocks are std140, but push constant blocks are std430, where arrays of
250 // scalars and vec2 are tightly packed.
252 int stateIndex; // -1 when not tracked (arrays, matrices, int types)
253};
254
256
264
266
267using QGles2UniformDescriptionVector = QVarLengthArray<QGles2UniformDescription, 8>;
268using QGles2SamplerDescriptionVector = QVarLengthArray<QGles2SamplerDescription, 4>;
269
271{
273 float v[4];
274};
275
277
278using QGles2UniformStateVector = QVarLengthArray<QGles2UniformState, 8>;
279
300
320
322{
323 QGles2CommandBuffer(QRhiImplementation *rhi);
325 void destroy() override;
326
327 struct Command {
369
370 // QRhi*/QGles2* references should be kept at minimum (so no
371 // QRhiTexture/Buffer/etc. pointers).
372 union Args {
373 struct {
375 } beginFrame;
376 struct {
377 GLuint timestampQuery;
378 } endFrame;
379 struct {
380 float x, y, w, h;
381 float d0, d1;
382 } viewport;
383 struct {
384 int x, y, w, h;
385 } scissor;
386 struct {
387 float r, g, b, a;
388 } blendConstants;
389 struct {
392 } stencilRef;
393 struct {
394 QRhiGraphicsPipeline *ps;
398 } bindVertexBuffer;
399 struct {
400 GLuint buffer;
401 quint32 offset;
403 } bindIndexBuffer;
404 struct {
405 QRhiGraphicsPipeline *ps;
410 } draw;
411 struct {
412 QRhiGraphicsPipeline *ps;
415 quint32 instanceCount;
416 quint32 baseInstance;
418 } drawIndexed;
419 struct {
420 QRhiGraphicsPipeline *ps;
421 GLuint buffer;
422 quint32 offset;
425 } drawIndirect;
426 struct {
427 QRhiGraphicsPipeline *ps;
428 GLuint buffer;
429 quint32 offset;
430 quint32 drawCount;
431 quint32 stride;
432 } drawIndexedIndirect;
433 struct {
434 QRhiGraphicsPipeline *ps;
435 GLuint buffer;
436 quint32 offset;
440 quint32 stride;
441 } drawIndirectCount;
442 struct {
443 QRhiGraphicsPipeline *ps;
444 GLuint buffer;
445 quint32 offset;
446 GLuint countBuffer;
447 quint32 countOffset;
448 quint32 maxDrawCount;
449 quint32 stride;
450 } drawIndexedIndirectCount;
451 struct {
452 QRhiGraphicsPipeline *ps;
453 } bindGraphicsPipeline;
454 struct {
460 } bindShaderResources;
461 struct {
462 QRhiGraphicsPipeline *maybeGraphicsPs;
463 QRhiComputePipeline *maybeComputePs;
464 quint32 dataOffset; // into pushConstantPool
466 } setPushConstants;
467 struct {
469 float c[4];
470 float d;
472 } clear;
473 struct {
475 bool srgb;
477 bool stereo;
479 } bindFramebuffer;
480 struct {
482 GLuint buffer;
484 int size;
485 const void *data; // must come from retainData()
486 } bufferSubData;
487 struct {
489 GLenum target;
490 GLuint buffer;
491 int offset;
492 int size;
493 } getBufferSubData;
494 struct {
499 int size;
500 } copyBuf;
501 struct {
502 GLenum target;
503 GLuint buffer;
504 int offset;
505 int size;
507 } clearBufferSubData;
508 struct {
513 int srcX;
514 int srcY;
515 int srcZ;
520 int dstX;
521 int dstY;
522 int dstZ;
523 int w;
524 int h;
525 } copyTex;
526 struct {
527 QRhiReadbackResult *result;
529 int x;
530 int y;
531 int w;
532 int h;
535 int level;
537 } readPixels;
538 struct {
539 GLenum target;
540 GLuint texture;
542 int level;
543 int dx;
544 int dy;
545 int dz;
546 int w;
547 int h;
552 const void *data; // must come from retainImage()
553 } subImage;
554 struct {
555 GLenum target;
556 GLuint texture;
557 GLenum faceTarget;
558 int level;
560 int w;
561 int h;
562 int depth;
563 int size;
564 const void *data; // must come from retainData()
565 } compressedImage;
566 struct {
567 GLenum target;
568 GLuint texture;
569 GLenum faceTarget;
570 int level;
571 int dx;
572 int dy;
573 int dz;
574 int w;
575 int h;
576 GLenum glintformat;
577 int size;
578 const void *data; // must come from retainData()
579 } compressedSubImage;
580 struct {
583 int w;
584 int h;
585 GLenum target;
586 GLuint dstTexture;
587 int dstLevel;
591 } blitFromRenderbuffer;
592 struct {
593 GLenum srcTarget;
594 GLuint srcTexture;
595 int srcLevel;
597 int w;
598 int h;
599 GLenum dstTarget;
600 GLuint dstTexture;
601 int dstLevel;
602 int dstLayer;
603 bool isDepthStencil;
604 bool hasStencil;
605 } blitFromTexture;
606 struct {
607 GLenum target;
608 GLuint texture;
609 } genMip;
610 struct {
612 } bindComputePipeline;
613 struct {
617 } dispatch;
618 struct {
619 GLuint buffer;
620 quint32 offset;
621 } dispatchIndirect;
622 struct {
624 } barriersForPass;
625 struct {
627 } barrier;
628 struct {
629 GLuint fbo;
632 } invalidateFramebuffer;
633 } args;
634 };
635
641
645
648 double lastGpuTime = 0;
657
659 bool valid = false;
664 bool blendEnabled[16];
665 struct ColorMask { bool r, g, b, a; } colorMask[16];
693 void reset() { valid = false; }
694 struct {
695 // not part of QRhiGraphicsPipeline but used by setGraphicsPipeline()
697 } dynamic;
698 } graphicsPassState;
699
701 enum Access {
702 Read = 0x01,
703 Write = 0x02
704 };
706 void reset() {
707 writtenResources.clear();
708 }
709 } computePassState;
710
712 void *ps;
715 } textureUnitState[16];
716
719 QVarLengthArray<uint, 32> dynamicOffsetPool; // (binding, offset) pairs
722
723 // relies heavily on implicit sharing (no copies of the actual data will be made)
724 const void *retainData(const QByteArray &data) {
725 dataRetainPool.append(data);
726 return dataRetainPool.last().constData();
727 }
729 bufferDataRetainPool.append(data);
730 return reinterpret_cast<const uchar *>(bufferDataRetainPool.last().constData());
731 }
732 const void *retainImage(const QImage &image) {
733 imageRetainPool.append(image);
734 return imageRetainPool.last().constBits();
735 }
737 commands.reset();
738 pushConstantPool.clear();
739 dynamicOffsetPool.clear();
740 dataRetainPool.clear();
741 bufferDataRetainPool.clear();
742 imageRetainPool.clear();
743
744 passResTrackers.clear();
746 }
747 void resetState() {
750 // do not zero lastGpuTime
751 currentTarget = nullptr;
754 }
756 currentGraphicsPipeline = nullptr;
757 currentComputePipeline = nullptr;
759 currentGraphicsSrb = nullptr;
760 currentComputeSrb = nullptr;
762 pushConstantData.clear();
763 graphicsPassState.reset();
764 computePassState.reset();
765 memset(textureUnitState, 0, sizeof(textureUnitState));
766 }
767};
768
771{
772 return a.func == b.func
773 && a.failOp == b.failOp
774 && a.zfailOp == b.zfailOp
775 && a.zpassOp == b.zpassOp;
776}
777
780{
781 return !(a == b);
782}
783
786{
787 return a.r == b.r && a.g == b.g && a.b == b.b && a.a == b.a;
788}
789
792{
793 return !(a == b);
794}
795
798{
799 return a.srcColor == b.srcColor
800 && a.dstColor == b.dstColor
801 && a.srcAlpha == b.srcAlpha
802 && a.dstAlpha == b.dstAlpha
803 && a.opColor == b.opColor
804 && a.opAlpha == b.opAlpha;
805}
806
809{
810 return !(a == b);
811}
812
814{
815 static const int TIMESTAMP_PAIRS = 2;
816
819
820 void prepare(QRhiGles2 *rhiD);
821 void destroy(QRhiGles2 *rhiD);
822 bool tryQueryTimestamps(int pairIndex, QRhiGles2 *rhiD, double *elapsedSec);
823};
824
852
854{
855public:
856 QRhiGles2(QRhiGles2InitParams *params, QRhiGles2NativeHandles *importDevice = nullptr);
857
858 bool create(QRhi::Flags flags) override;
859 void destroy() override;
860
864 QRhiBuffer *createBuffer(QRhiBuffer::Type type,
865 QRhiBuffer::UsageFlags usage,
866 quint32 size) override;
867 QRhiRenderBuffer *createRenderBuffer(QRhiRenderBuffer::Type type,
868 const QSize &pixelSize,
869 int sampleCount,
870 QRhiRenderBuffer::Flags flags,
871 QRhiTexture::Format backingFormatHint) override;
872 QRhiTexture *createTexture(QRhiTexture::Format format,
873 const QSize &pixelSize,
874 int depth,
875 int arraySize,
876 int sampleCount,
877 QRhiTexture::Flags flags) override;
878 QRhiSampler *createSampler(QRhiSampler::Filter magFilter,
879 QRhiSampler::Filter minFilter,
880 QRhiSampler::Filter mipmapMode,
881 QRhiSampler:: AddressMode u,
882 QRhiSampler::AddressMode v,
883 QRhiSampler::AddressMode w) override;
884
885 QRhiTextureRenderTarget *createTextureRenderTarget(const QRhiTextureRenderTargetDescription &desc,
886 QRhiTextureRenderTarget::Flags flags) override;
887
888 QRhiShadingRateMap *createShadingRateMap() override;
889
890 QRhiSwapChain *createSwapChain() override;
891 QRhi::FrameOpResult beginFrame(QRhiSwapChain *swapChain, QRhi::BeginFrameFlags flags) override;
892 QRhi::FrameOpResult endFrame(QRhiSwapChain *swapChain, QRhi::EndFrameFlags flags) override;
893 QRhi::FrameOpResult beginOffscreenFrame(QRhiCommandBuffer **cb, QRhi::BeginFrameFlags flags) override;
894 QRhi::FrameOpResult endOffscreenFrame(QRhi::EndFrameFlags flags) override;
895 QRhi::FrameOpResult finish() override;
896
897 void resourceUpdate(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override;
898
899 void beginPass(QRhiCommandBuffer *cb,
900 QRhiRenderTarget *rt,
901 const QColor &colorClearValue,
902 const QRhiDepthStencilClearValue &depthStencilClearValue,
903 QRhiResourceUpdateBatch *resourceUpdates,
904 QRhiCommandBuffer::BeginPassFlags flags) override;
905 void endPass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override;
906
907 void setGraphicsPipeline(QRhiCommandBuffer *cb,
908 QRhiGraphicsPipeline *ps) override;
909
910 void setShaderResources(QRhiCommandBuffer *cb,
911 QRhiShaderResourceBindings *srb,
912 int dynamicOffsetCount,
913 const QRhiCommandBuffer::DynamicOffset *dynamicOffsets) override;
914
915 void setVertexInput(QRhiCommandBuffer *cb,
916 int startBinding, int bindingCount, const QRhiCommandBuffer::VertexInput *bindings,
917 QRhiBuffer *indexBuf, quint32 indexOffset,
918 QRhiCommandBuffer::IndexFormat indexFormat) override;
919
920 void setViewport(QRhiCommandBuffer *cb, const QRhiViewport &viewport) override;
921 void setScissor(QRhiCommandBuffer *cb, const QRhiScissor &scissor) override;
922 void setBlendConstants(QRhiCommandBuffer *cb, const QColor &c) override;
923 void setStencilRef(QRhiCommandBuffer *cb, quint32 refValue) override;
924 void setPushConstants(QRhiCommandBuffer *cb, quint32 offset, quint32 size, const void *data) override;
925 static constexpr quint32 MAX_PUSH_CONSTANTS_SIZE = 128;
926 void setShadingRate(QRhiCommandBuffer *cb, const QSize &coarsePixelSize) override;
927
928 void draw(QRhiCommandBuffer *cb, quint32 vertexCount,
929 quint32 instanceCount, quint32 firstVertex, quint32 firstInstance) override;
930
931 void drawIndexed(QRhiCommandBuffer *cb, quint32 indexCount,
932 quint32 instanceCount, quint32 firstIndex,
933 qint32 vertexOffset, quint32 firstInstance) override;
934
935 void drawIndirect(QRhiCommandBuffer *cb, QRhiBuffer *indirectBuffer,
936 quint32 indirectBufferOffset, quint32 drawCount, quint32 stride) override;
937
938 void drawIndexedIndirect(QRhiCommandBuffer *cb, QRhiBuffer *indirectBuffer,
939 quint32 indirectBufferOffset, quint32 drawCount, quint32 stride) override;
940
941 void drawIndirectCount(QRhiCommandBuffer *cb,
942 QRhiBuffer *indirectBuffer, quint32 indirectBufferOffset,
943 QRhiBuffer *countBuffer, quint32 countBufferOffset,
944 quint32 maxDrawCount, quint32 stride) override;
945 void drawIndexedIndirectCount(QRhiCommandBuffer *cb,
946 QRhiBuffer *indirectBuffer, quint32 indirectBufferOffset,
947 QRhiBuffer *countBuffer, quint32 countBufferOffset,
948 quint32 maxDrawCount, quint32 stride) override;
949
950 void dispatchIndirect(QRhiCommandBuffer *cb, QRhiBuffer *indirectBuffer,
951 quint32 indirectBufferOffset) override;
952
953 void debugMarkBegin(QRhiCommandBuffer *cb, const QByteArray &name) override;
954 void debugMarkEnd(QRhiCommandBuffer *cb) override;
955 void debugMarkMsg(QRhiCommandBuffer *cb, const QByteArray &msg) override;
956
957 void beginComputePass(QRhiCommandBuffer *cb,
958 QRhiResourceUpdateBatch *resourceUpdates,
959 QRhiCommandBuffer::BeginPassFlags flags) override;
960 void endComputePass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override;
961 void setComputePipeline(QRhiCommandBuffer *cb, QRhiComputePipeline *ps) override;
962 void dispatch(QRhiCommandBuffer *cb, int x, int y, int z) override;
963
964 const QRhiNativeHandles *nativeHandles(QRhiCommandBuffer *cb) override;
965 void beginExternal(QRhiCommandBuffer *cb) override;
966 void endExternal(QRhiCommandBuffer *cb) override;
967 double lastCompletedGpuTime(QRhiCommandBuffer *cb) override;
968
969 QList<int> supportedSampleCounts() const override;
970 QList<QSize> supportedShadingRates(int sampleCount) const override;
971 int ubufAlignment() const override;
972 bool isYUpInFramebuffer() const override;
973 bool isYUpInNDC() const override;
974 bool isClipDepthZeroToOne() const override;
975 QMatrix4x4 clipSpaceCorrMatrix() const override;
976 bool isTextureFormatSupported(QRhiTexture::Format format, QRhiTexture::Flags flags) const override;
977 bool isFeatureSupported(QRhi::Feature feature) const override;
978 int resourceLimit(QRhi::ResourceLimit limit) const override;
979 const QRhiNativeHandles *nativeHandles() override;
980 QRhiDriverInfo driverInfo() const override;
981 QRhiStats statistics() override;
983 void setQueueSubmitParams(QRhiNativeHandles *params) override;
985 bool isDeviceLost() const override;
986
987 QByteArray pipelineCacheData() override;
988 void setPipelineCacheData(const QByteArray &data) override;
989
990 bool ensureContext(QSurface *surface = nullptr) const;
996 int layer, int level, const QRhiTextureSubresourceUploadDescription &subresDesc);
997 void enqueueResourceUpdates(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates);
999 QGles2Buffer *bufD,
1003 QGles2Texture *texD,
1007 void executeCommandBuffer(QRhiCommandBuffer *cb);
1010 void *ps, uint psGeneration, int glslLocation,
1011 int *texUnit, bool *activeTexUnitAltered);
1013 QRhiGraphicsPipeline *maybeGraphicsPs, QRhiComputePipeline *maybeComputePs,
1014 QRhiShaderResourceBindings *srb,
1015 const uint *dynOfsPairs, int dynOfsCount);
1016 void setUniformValue(const QGles2UniformDescription &uniform, const void *src,
1017 QGles2UniformState *uniformState);
1018 static void setupUniformStateTracking(QGles2UniformDescriptionVector *uniforms,
1019 QGles2UniformDescriptionVector *pushConstantUniforms,
1020 QGles2UniformStateVector *uniformState);
1021 void setUniformsFromBlock(const QGles2UniformDescriptionVector &uniforms, int binding,
1022 const char *blockData, qint64 blockSize, quint32 blockOffset,
1023 QGles2UniformState *uniformState);
1025 bool *wantsColorClear = nullptr, bool *wantsDsClear = nullptr);
1028 std::optional<QShaderVersion> commonGlslEsVersion(const QRhiShaderStage *stages, int stageCount) const;
1029 QByteArray shaderSource(const QRhiShaderStage &shaderStage, QShaderVersion *shaderVersion,
1030 std::optional<QShaderVersion> commonVersion = std::nullopt);
1031 bool compileShader(GLuint program, const QRhiShaderStage &shaderStage, QShaderVersion *shaderVersion,
1032 std::optional<QShaderVersion> commonVersion = std::nullopt);
1033 bool linkProgram(GLuint program);
1035 void registerUniformIfActive(const QShaderDescription::BlockVariable &var,
1036 const QByteArray &namePrefix, int binding, int baseOffset,
1037 GLuint program,
1038 ActiveUniformLocationTracker *activeUniformLocations,
1039 QGles2UniformDescriptionVector *dst);
1040 void gatherBlockMemberUniforms(GLuint program, const QByteArray &prefix, int binding,
1041 const QList<QShaderDescription::BlockVariable> &members,
1042 ActiveUniformLocationTracker *activeUniformLocations,
1043 QGles2UniformDescriptionVector *dst);
1044 void gatherUniforms(GLuint program, const QShaderDescription::UniformBlock &ub,
1045 ActiveUniformLocationTracker *activeUniformLocations, QGles2UniformDescriptionVector *dst);
1046 void gatherPushConstantUniforms(GLuint program, const QShaderDescription::PushConstantBlock &pcb,
1047 ActiveUniformLocationTracker *activeUniformLocations,
1048 QGles2UniformDescriptionVector *dst);
1049 void gatherSamplers(GLuint program, const QShaderDescription::InOutVariable &v,
1050 QGles2SamplerDescriptionVector *dst);
1051 void gatherGeneratedSamplers(GLuint program,
1052 const QShader::SeparateToCombinedImageSamplerMapping &mapping,
1053 QGles2SamplerDescriptionVector *dst);
1054 void sanityCheckVertexFragmentInterface(const QShaderDescription &vsDesc, const QShaderDescription &fsDesc);
1056
1062 ProgramCacheResult tryLoadFromDiskOrPipelineCache(const QRhiShaderStage *stages,
1063 int stageCount,
1064 GLuint program,
1065 const QVector<QShaderDescription::InOutVariable> &inputVars,
1066 QByteArray *cacheKey,
1067 std::optional<QShaderVersion> commonVersion = std::nullopt);
1068 void trySaveToDiskCache(GLuint program, const QByteArray &cacheKey);
1069 void trySaveToPipelineCache(GLuint program, const QByteArray &cacheKey, bool force = false);
1070
1073 bool importedContext = false;
1078 mutable bool needsMakeCurrentDueToSwap = false;
1079 QOpenGLExtensions *f = nullptr;
1082 const void *) = nullptr;
1085 const GLvoid *) = nullptr;
1087 GLsizei) = nullptr;
1089 const GLvoid *) = nullptr;
1091 GLsizei, const GLvoid *) = nullptr;
1093 GLint) = nullptr;
1095 GLint, GLsizei) = nullptr;
1098 GLenum, GLenum, const void *) = nullptr;
1100 void (QOPENGLF_APIENTRYP glObjectLabel)(GLenum, GLuint, GLsizei, const GLchar *) = nullptr;
1108 // Resolved when caps.baseInstance is true, left null otherwise.
1112 uint vao = 0;
1113 struct Caps {
1115 : ctxMajor(2),
1116 ctxMinor(0),
1117 maxTextureSize(2048),
1118 maxDrawBuffers(4),
1119 maxSamples(16),
1126 maxUniformVectors(4096),
1127 maxVertexInputs(8),
1131 msaaRenderBuffer(false),
1132 multisampledTexture(false),
1133 npotTextureFull(true),
1134 gles(false),
1136 bgraExternalFormat(false),
1137 bgraInternalFormat(false),
1138 r8Format(false),
1139 r16Format(false),
1140 r32uiFormat(false),
1141 floatFormats(false),
1142 rgb10Formats(false),
1143 depthTexture(false),
1144 packedDepthStencil(false),
1146 srgbTextureFormat(false),
1147 srgbGenerateMipmap(false),
1149 srgbWriteControl(false),
1150 coreProfile(false),
1151 vertexArrayObject(false),
1152 uniformBuffers(false),
1153 elementIndexUint(false),
1154 depth24(false),
1155 rgba8Format(false),
1156 instancing(false),
1157 baseVertex(false),
1158 baseInstance(false),
1159 compute(false),
1160 textureCompareMode(false),
1161 depthClamp(false),
1162 properMapBuffer(false),
1164 texelFetch(false),
1165 intAttributes(true),
1167 programBinary(false),
1168 texture3D(false),
1169 tessellation(false),
1170 geometryShader(false),
1171 texture1D(false),
1172 hasDrawBuffersFunc(false),
1173 halfAttributes(false),
1174 multiView(false),
1175 timestamps(false),
1176 objectLabel(false),
1179 unpackRowLength(false),
1181 dispatchIndirect(false),
1182 drawIndirectCount(false),
1183 copyBuffer(false),
1184 clearBuffer(false)
1185 { }
1202 // Multisample fb and blit are supported (GLES 3.0 or OpenGL 3.x). Not
1203 // the same as multisample textures!
1207 uint gles : 1;
1211 uint r8Format : 1;
1212 uint r16Format : 1;
1213 uint r32uiFormat : 1;
1223 uint coreProfile : 1;
1227 uint depth24 : 1;
1228 uint rgba8Format : 1;
1229 uint instancing : 1;
1230 uint baseVertex : 1;
1232 uint compute : 1;
1234 uint depthClamp : 1;
1237 uint texelFetch : 1;
1241 uint texture3D : 1;
1244 uint texture1D : 1;
1247 uint multiView : 1;
1248 uint timestamps : 1;
1249 uint objectLabel : 1;
1261 uint copyBuffer : 1;
1262 uint clearBuffer : 1;
1263 } caps;
1269 mutable bool contextLost = false;
1270 uint frameNo = 0;
1271
1281 union {
1282 struct {
1284 } buffer;
1285 struct {
1287 } pipeline;
1288 struct {
1290 } texture;
1291 struct {
1294 } renderbuffer;
1295 struct {
1298 } textureRenderTarget;
1299 };
1300 };
1302
1304 OffscreenFrame(QRhiImplementation *rhi) : cbWrapper(rhi) { }
1305 bool active = false;
1308 } ofr;
1309
1310 // Keyed by version too: it depends on the other stages of the program.
1312
1318
1338};
1339
1341
1343{
1344 return quint32(d.data.size());
1345}
1346
1347QT_END_NAMESPACE
1348
1349#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:842
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:853
QRhiBackendCommandList()=default
T * cbegin() const
Definition qrhi_p.h:1001
bool isEmpty() const
Definition qrhi_p.h:987
void execute(QRhiCommandBuffer *cb, quint32 firstCommand, quint32 commandCount)
Definition qrhi.cpp:9339
QRhiBufferBackedIndirectCommandBuffer(QRhiImplementation *rhi, Type type, quint32 maxCommandCount)
\variable QRhiIndirectCommandBufferBuildInfo::topology
Definition qrhi.cpp:9249
void enqueueUpload(QRhiResourceUpdateBatch *u)
Definition qrhi.cpp:9303
QRhiIndirectCommandBufferBuildInfo buildInfo
Definition qrhi_p.h:385
void build(const QRhiIndirectCommandBufferBuildInfo &info)
Definition qrhi.cpp:9326
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
Definition qrhi.cpp:9261
bool create() override
Creates the corresponding native objects.
Definition qrhi.cpp:9284
void assign(QByteArray data)
Definition qrhi_p.h:508
QRhiBufferData()=default
void assign(const char *s, quint32 size)
Definition qrhi_p.h:489
quint32 size() const
Definition qrhi_p.h:481
QRhiBufferData(const QRhiBufferData &other)
Definition qrhi_p.h:460
quint32 largeAlloc() const
Definition qrhi_p.h:485
QRhiBufferData & operator=(const QRhiBufferData &other)
Definition qrhi_p.h:466
const char * constData() const
Definition qrhi_p.h:477
const GLvoid const GLvoid GLenum
QRhiStats statistics() override
bool contextLost
const QRhiNativeHandles * nativeHandles(QRhiCommandBuffer *cb) override
void drawIndexed(QRhiCommandBuffer *cb, quint32 indexCount, quint32 instanceCount, quint32 firstIndex, qint32 vertexOffset, quint32 firstInstance) override
QOpenGLContext * maybeShareContext
void gatherUniforms(GLuint program, const QShaderDescription::UniformBlock &ub, ActiveUniformLocationTracker *activeUniformLocations, QGles2UniformDescriptionVector *dst)
void trackedBufferBarrier(QGles2CommandBuffer *cbD, QGles2Buffer *bufD, QGles2Buffer::Access access)
void gatherBlockMemberUniforms(GLuint program, const QByteArray &prefix, int binding, const QList< QShaderDescription::BlockVariable > &members, ActiveUniformLocationTracker *activeUniformLocations, QGles2UniformDescriptionVector *dst)
QRhi::FrameOpResult beginFrame(QRhiSwapChain *swapChain, QRhi::BeginFrameFlags flags) override
const GLvoid GLenum
std::optional< QShaderVersion > commonGlslEsVersion(const QRhiShaderStage *stages, int stageCount) const
void enqueueBarriersForPass(QGles2CommandBuffer *cbD)
QList< DeferredReleaseEntry > releaseQueue
void drawIndirectCount(QRhiCommandBuffer *cb, QRhiBuffer *indirectBuffer, quint32 indirectBufferOffset, QRhiBuffer *countBuffer, quint32 countBufferOffset, quint32 maxDrawCount, quint32 stride) override
int resourceLimit(QRhi::ResourceLimit limit) const override
void setVertexInput(QRhiCommandBuffer *cb, int startBinding, int bindingCount, const QRhiCommandBuffer::VertexInput *bindings, QRhiBuffer *indexBuf, quint32 indexOffset, QRhiCommandBuffer::IndexFormat indexFormat) override
void(QOPENGLF_APIENTRYP glRenderbufferStorageMultisampleEXT)(GLenum
bool isFeatureSupported(QRhi::Feature feature) const override
static void setupUniformStateTracking(QGles2UniformDescriptionVector *uniforms, QGles2UniformDescriptionVector *pushConstantUniforms, QGles2UniformStateVector *uniformState)
QRhiGraphicsPipeline * createGraphicsPipeline() override
void bindShaderResources(QGles2CommandBuffer *cbD, QRhiGraphicsPipeline *maybeGraphicsPs, QRhiComputePipeline *maybeComputePs, QRhiShaderResourceBindings *srb, const uint *dynOfsPairs, int dynOfsCount)
bool create(QRhi::Flags flags) override
void trackedRegisterTexture(QRhiPassResourceTracker *passResTracker, QGles2Texture *texD, QRhiPassResourceTracker::TextureAccess access, QRhiPassResourceTracker::TextureStage stage)
void executeBindGraphicsPipeline(QGles2CommandBuffer *cbD, QGles2GraphicsPipeline *psD)
void dispatchIndirect(QRhiCommandBuffer *cb, QRhiBuffer *indirectBuffer, quint32 indirectBufferOffset) override
QRhiDriverInfo driverInfo() const override
QSurfaceFormat requestedFormat
bool isProgramBinaryDiskCacheEnabled() const
void(QOPENGLF_APIENTRYP glFramebufferTextureMultisampleMultiviewOVR)(GLenum
bool needsMakeCurrentDueToSwap
QRhiShadingRateMap * createShadingRateMap() override
const void quint64 GLuint
void setUniformsFromBlock(const QGles2UniformDescriptionVector &uniforms, int binding, const char *blockData, qint64 blockSize, quint32 blockOffset, QGles2UniformState *uniformState)
void trackedImageBarrier(QGles2CommandBuffer *cbD, QGles2Texture *texD, QGles2Texture::Access access)
QOpenGLExtensions * f
void trackedRegisterBuffer(QRhiPassResourceTracker *passResTracker, QGles2Buffer *bufD, QRhiPassResourceTracker::BufferAccess access, QRhiPassResourceTracker::BufferStage stage)
void setShadingRate(QRhiCommandBuffer *cb, const QSize &coarsePixelSize) override
void gatherPushConstantUniforms(GLuint program, const QShaderDescription::PushConstantBlock &pcb, ActiveUniformLocationTracker *activeUniformLocations, QGles2UniformDescriptionVector *dst)
QRhiComputePipeline * createComputePipeline() override
QRhiDriverInfo driverInfoStruct
QSurface * evaluateFallbackSurface() const
void resourceUpdate(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override
void sanityCheckVertexFragmentInterface(const QShaderDescription &vsDesc, const QShaderDescription &fsDesc)
QRhiGles2NativeHandles nativeHandlesStruct
QMatrix4x4 clipSpaceCorrMatrix() const override
QRhi::FrameOpResult finish() override
void setComputePipeline(QRhiCommandBuffer *cb, QRhiComputePipeline *ps) override
const void * void(QOPENGLF_APIENTRYP glGetQueryObjectui64v)(GLuint
void(QOPENGLF_APIENTRYP glMultiDrawArraysIndirect)(GLenum
QList< int > supportedSampleCounts() const override
void gatherSamplers(GLuint program, const QShaderDescription::InOutVariable &v, QGles2SamplerDescriptionVector *dst)
QSet< GLint > supportedCompressedFormats
void(QOPENGLF_APIENTRYP glMultiDrawElementsIndirectCount)(GLenum
static constexpr quint32 MAX_PUSH_CONSTANTS_SIZE
QRhiSwapChain * createSwapChain() override
void dispatch(QRhiCommandBuffer *cb, int x, int y, int z) override
QRhiBinaryCache< QByteArray, PipelineCacheData > m_pipelineCache
void destroy() override
QRhiRenderBuffer * createRenderBuffer(QRhiRenderBuffer::Type type, const QSize &pixelSize, int sampleCount, QRhiRenderBuffer::Flags flags, QRhiTexture::Format backingFormatHint) override
void executeCommandBuffer(QRhiCommandBuffer *cb)
void setGraphicsPipeline(QRhiCommandBuffer *cb, QRhiGraphicsPipeline *ps) override
QList< QShaderVersion > glslVersionsToTry() const
QSurface * fallbackSurface
QRhiGles2(QRhiGles2InitParams *params, QRhiGles2NativeHandles *importDevice=nullptr)
QRhi::Flags rhiFlags
void trySaveToDiskCache(GLuint program, const QByteArray &cacheKey)
GLbitfield barriersForNextDispatch(QGles2CommandBuffer *cbD)
QList< QSize > supportedShadingRates(int sampleCount) const override
void drawIndexedIndirectCount(QRhiCommandBuffer *cb, QRhiBuffer *indirectBuffer, quint32 indirectBufferOffset, QRhiBuffer *countBuffer, quint32 countBufferOffset, quint32 maxDrawCount, quint32 stride) override
void(QOPENGLF_APIENTRYP glTexSubImage1D)(GLenum
const void GLuint
QRhiTexture * createTexture(QRhiTexture::Format format, const QSize &pixelSize, int depth, int arraySize, int sampleCount, QRhiTexture::Flags flags) override
void bindCombinedSampler(QGles2CommandBuffer *cbD, QGles2Texture *texD, QGles2Sampler *samplerD, void *ps, uint psGeneration, int glslLocation, int *texUnit, bool *activeTexUnitAltered)
void setViewport(QRhiCommandBuffer *cb, const QRhiViewport &viewport) override
QRhiTextureRenderTarget * createTextureRenderTarget(const QRhiTextureRenderTargetDescription &desc, QRhiTextureRenderTarget::Flags flags) override
QByteArray shaderSource(const QRhiShaderStage &shaderStage, QShaderVersion *shaderVersion, std::optional< QShaderVersion > commonVersion=std::nullopt)
void(QOPENGLF_APIENTRYP glMultiDrawElementsIndirect)(GLenum
QOpenGLContext * ctx
QRhiSampler * createSampler(QRhiSampler::Filter magFilter, QRhiSampler::Filter minFilter, QRhiSampler::Filter mipmapMode, QRhiSampler::AddressMode u, QRhiSampler::AddressMode v, QRhiSampler::AddressMode w) override
void beginPass(QRhiCommandBuffer *cb, QRhiRenderTarget *rt, const QColor &colorClearValue, const QRhiDepthStencilClearValue &depthStencilClearValue, QRhiResourceUpdateBatch *resourceUpdates, QRhiCommandBuffer::BeginPassFlags flags) override
QGles2SwapChain * currentSwapChain
bool isDeviceLost() const override
QRhiShaderResourceBindings * createShaderResourceBindings() override
void drawIndexedIndirect(QRhiCommandBuffer *cb, QRhiBuffer *indirectBuffer, quint32 indirectBufferOffset, quint32 drawCount, quint32 stride) override
void drawIndirect(QRhiCommandBuffer *cb, QRhiBuffer *indirectBuffer, quint32 indirectBufferOffset, quint32 drawCount, quint32 stride) override
bool isYUpInNDC() const override
void debugMarkBegin(QRhiCommandBuffer *cb, const QByteArray &name) override
void enqueueResourceUpdates(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates)
void setQueueSubmitParams(QRhiNativeHandles *params) override
bool makeThreadLocalNativeContextCurrent() override
int ubufAlignment() const override
void beginExternal(QRhiCommandBuffer *cb) override
const GLvoid GLint
void endExternal(QRhiCommandBuffer *cb) override
bool isTextureFormatSupported(QRhiTexture::Format format, QRhiTexture::Flags flags) const override
ProgramCacheResult tryLoadFromDiskOrPipelineCache(const QRhiShaderStage *stages, int stageCount, GLuint program, const QVector< QShaderDescription::InOutVariable > &inputVars, QByteArray *cacheKey, std::optional< QShaderVersion > commonVersion=std::nullopt)
QRhiBuffer * createBuffer(QRhiBuffer::Type type, QRhiBuffer::UsageFlags usage, quint32 size) override
void(QOPENGLF_APIENTRYP glCompressedTexImage1D)(GLenum
bool importedContext
void(QOPENGLF_APIENTRYP glDrawElementsInstancedBaseVertexBaseInstance)(GLenum
void setScissor(QRhiCommandBuffer *cb, const QRhiScissor &scissor) override
void setUniformValue(const QGles2UniformDescription &uniform, const void *src, QGles2UniformState *uniformState)
void setStencilRef(QRhiCommandBuffer *cb, quint32 refValue) override
bool ensureContext(QSurface *surface=nullptr) const
void draw(QRhiCommandBuffer *cb, quint32 vertexCount, quint32 instanceCount, quint32 firstVertex, quint32 firstInstance) override
void endComputePass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override
void(QOPENGLF_APIENTRYP glQueryCounter)(GLuint
QHash< std::pair< QRhiShaderStage, QShaderVersion >, uint > m_shaderCache
void(QOPENGLF_APIENTRYP glDrawArraysInstancedBaseInstance)(GLenum
void beginComputePass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates, QRhiCommandBuffer::BeginPassFlags flags) override
void endPass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override
bool isYUpInFramebuffer() const override
bool linkProgram(GLuint program)
void debugMarkMsg(QRhiCommandBuffer *cb, const QByteArray &msg) override
QGles2RenderTargetData * enqueueBindFramebuffer(QRhiRenderTarget *rt, QGles2CommandBuffer *cbD, bool *wantsColorClear=nullptr, bool *wantsDsClear=nullptr)
void debugMarkEnd(QRhiCommandBuffer *cb) override
void setBlendConstants(QRhiCommandBuffer *cb, const QColor &c) override
void registerUniformIfActive(const QShaderDescription::BlockVariable &var, const QByteArray &namePrefix, int binding, int baseOffset, GLuint program, ActiveUniformLocationTracker *activeUniformLocations, QGles2UniformDescriptionVector *dst)
void setShaderResources(QRhiCommandBuffer *cb, QRhiShaderResourceBindings *srb, int dynamicOffsetCount, const QRhiCommandBuffer::DynamicOffset *dynamicOffsets) override
void releaseCachedResources() override
bool isClipDepthZeroToOne() const override
void trySaveToPipelineCache(GLuint program, const QByteArray &cacheKey, bool force=false)
bool compileShader(GLuint program, const QRhiShaderStage &shaderStage, QShaderVersion *shaderVersion, std::optional< QShaderVersion > commonVersion=std::nullopt)
void executeDeferredReleases()
QByteArray pipelineCacheData() override
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)
void setPushConstants(QRhiCommandBuffer *cb, quint32 offset, quint32 size, const void *data) override
QRhi::FrameOpResult endFrame(QRhiSwapChain *swapChain, QRhi::EndFrameFlags flags) override
void setPipelineCacheData(const QByteArray &data) override
QRhi::FrameOpResult endOffscreenFrame(QRhi::EndFrameFlags flags) override
void gatherGeneratedSamplers(GLuint program, const QShader::SeparateToCombinedImageSamplerMapping &mapping, QGles2SamplerDescriptionVector *dst)
const QRhiNativeHandles * nativeHandles() override
void setShaderResources(QRhiCommandBuffer *cb, QRhiShaderResourceBindings *srb, int dynamicOffsetCount, const QRhiCommandBuffer::DynamicOffset *dynamicOffsets) override
Definition qrhinull.cpp:264
double lastCompletedGpuTime(QRhiCommandBuffer *cb) override
Definition qrhinull.cpp:449
QRhi::FrameOpResult endOffscreenFrame(QRhi::EndFrameFlags flags) override
Definition qrhinull.cpp:478
void setPushConstants(QRhiCommandBuffer *cb, quint32 offset, quint32 size, const void *data) override
Definition qrhinull.cpp:311
void dispatchIndirect(QRhiCommandBuffer *cb, QRhiBuffer *indirectBuffer, quint32 indirectBufferOffset) override
Definition qrhinull.cpp:425
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:405
void dispatch(QRhiCommandBuffer *cb, int x, int y, int z) override
Definition qrhinull.cpp:417
QRhi::FrameOpResult beginFrame(QRhiSwapChain *swapChain, QRhi::BeginFrameFlags flags) override
Definition qrhinull.cpp:455
void resourceUpdate(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override
Definition qrhinull.cpp:563
void drawIndexed(QRhiCommandBuffer *cb, quint32 indexCount, quint32 instanceCount, quint32 firstIndex, qint32 vertexOffset, quint32 firstInstance) override
Definition qrhinull.cpp:335
void beginComputePass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates, QRhiCommandBuffer::BeginPassFlags flags) override
Definition qrhinull.cpp:666
void beginPass(QRhiCommandBuffer *cb, QRhiRenderTarget *rt, const QColor &colorClearValue, const QRhiDepthStencilClearValue &depthStencilClearValue, QRhiResourceUpdateBatch *resourceUpdates, QRhiCommandBuffer::BeginPassFlags flags) override
Definition qrhinull.cpp:639
void setQueueSubmitParams(QRhiNativeHandles *params) override
Definition qrhinull.cpp:186
bool isClipDepthZeroToOne() const override
Definition qrhinull.cpp:97
void endComputePass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override
Definition qrhinull.cpp:675
QNullCommandBuffer offscreenCommandBuffer
Definition qrhinull_p.h:313
void endPass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override
Definition qrhinull.cpp:660
QRhi::FrameOpResult endFrame(QRhiSwapChain *swapChain, QRhi::EndFrameFlags flags) override
Definition qrhinull.cpp:462
QRhi::FrameOpResult beginOffscreenFrame(QRhiCommandBuffer **cb, QRhi::BeginFrameFlags flags) override
Definition qrhinull.cpp:471
bool isYUpInNDC() const override
Definition qrhinull.cpp:92
QRhiDriverInfo driverInfo() const override
Definition qrhinull.cpp:168
void setScissor(QRhiCommandBuffer *cb, const QRhiScissor &scissor) override
Definition qrhinull.cpp:293
void simulateTextureUpload(const QRhiResourceUpdateBatchPrivate::TextureOp &u)
Definition qrhinull.cpp:489
QRhiComputePipeline * createComputePipeline() override
Definition qrhinull.cpp:248
void setPipelineCacheData(const QByteArray &data) override
Definition qrhinull.cpp:206
void setVertexInput(QRhiCommandBuffer *cb, int startBinding, int bindingCount, const QRhiCommandBuffer::VertexInput *bindings, QRhiBuffer *indexBuf, quint32 indexOffset, QRhiCommandBuffer::IndexFormat indexFormat) override
Definition qrhinull.cpp:274
void debugMarkBegin(QRhiCommandBuffer *cb, const QByteArray &name) override
Definition qrhinull.cpp:394
void draw(QRhiCommandBuffer *cb, quint32 vertexCount, quint32 instanceCount, quint32 firstVertex, quint32 firstInstance) override
Definition qrhinull.cpp:325
QByteArray pipelineCacheData() override
Definition qrhinull.cpp:201
void drawIndirectCount(QRhiCommandBuffer *cb, QRhiBuffer *indirectBuffer, quint32 indirectBufferOffset, QRhiBuffer *countBuffer, quint32 countBufferOffset, quint32 maxDrawCount, quint32 stride) override
Definition qrhinull.cpp:366
void drawIndexedIndirectCount(QRhiCommandBuffer *cb, QRhiBuffer *indirectBuffer, quint32 indirectBufferOffset, QRhiBuffer *countBuffer, quint32 countBufferOffset, quint32 maxDrawCount, quint32 stride) override
Definition qrhinull.cpp:380
void destroy() override
Definition qrhinull.cpp:57
const QRhiNativeHandles * nativeHandles() override
Definition qrhinull.cpp:163
void setGraphicsPipeline(QRhiCommandBuffer *cb, QRhiGraphicsPipeline *ps) override
Definition qrhinull.cpp:258
void releaseCachedResources() override
Definition qrhinull.cpp:191
void simulateTextureCopy(const QRhiResourceUpdateBatchPrivate::TextureOp &u)
Definition qrhinull.cpp:539
QRhiTexture * createTexture(QRhiTexture::Format format, const QSize &pixelSize, int depth, int arraySize, int sampleCount, QRhiTexture::Flags flags) override
Definition qrhinull.cpp:218
QList< QSize > supportedShadingRates(int sampleCount) const override
Definition qrhinull.cpp:66
void simulateTextureGenMips(const QRhiResourceUpdateBatchPrivate::TextureOp &u)
Definition qrhinull.cpp:554
void setShadingRate(QRhiCommandBuffer *cb, const QSize &coarsePixelSize) override
Definition qrhinull.cpp:319
QRhiRenderBuffer * createRenderBuffer(QRhiRenderBuffer::Type type, const QSize &pixelSize, int sampleCount, QRhiRenderBuffer::Flags flags, QRhiTexture::Format backingFormatHint) override
Definition qrhinull.cpp:211
bool makeThreadLocalNativeContextCurrent() override
Definition qrhinull.cpp:180
void drawIndirect(QRhiCommandBuffer *cb, QRhiBuffer *indirectBuffer, quint32 indirectBufferOffset, quint32 drawCount, quint32 stride) override
Definition qrhinull.cpp:346
const QRhiNativeHandles * nativeHandles(QRhiCommandBuffer *cb) override
Definition qrhinull.cpp:433
QRhiNullNativeHandles nativeHandlesStruct
Definition qrhinull_p.h:311
bool isYUpInFramebuffer() const override
Definition qrhinull.cpp:87
QRhi::FrameOpResult finish() override
Definition qrhinull.cpp:484
void setComputePipeline(QRhiCommandBuffer *cb, QRhiComputePipeline *ps) override
Definition qrhinull.cpp:411
QRhiBuffer * createBuffer(QRhiBuffer::Type type, QRhiBuffer::UsageFlags usage, quint32 size) override
Definition qrhinull.cpp:77
QRhiStats statistics() override
Definition qrhinull.cpp:175
QRhiShadingRateMap * createShadingRateMap() override
Definition qrhinull.cpp:238
void beginExternal(QRhiCommandBuffer *cb) override
Definition qrhinull.cpp:439
QRhiSwapChain * createSwapChain() override
Definition qrhinull.cpp:72
void setViewport(QRhiCommandBuffer *cb, const QRhiViewport &viewport) override
Definition qrhinull.cpp:287
QRhiTextureRenderTarget * createTextureRenderTarget(const QRhiTextureRenderTargetDescription &desc, QRhiTextureRenderTarget::Flags flags) override
Definition qrhinull.cpp:232
QRhiGraphicsPipeline * createGraphicsPipeline() override
Definition qrhinull.cpp:243
bool create(QRhi::Flags flags) override
Definition qrhinull.cpp:51
void setStencilRef(QRhiCommandBuffer *cb, quint32 refValue) override
Definition qrhinull.cpp:305
void debugMarkEnd(QRhiCommandBuffer *cb) override
Definition qrhinull.cpp:400
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:225
void drawIndexedIndirect(QRhiCommandBuffer *cb, QRhiBuffer *indirectBuffer, quint32 indirectBufferOffset, quint32 drawCount, quint32 stride) override
Definition qrhinull.cpp:356
QRhiSwapChain * currentSwapChain
Definition qrhinull_p.h:312
int ubufAlignment() const override
Definition qrhinull.cpp:82
bool isTextureFormatSupported(QRhiTexture::Format format, QRhiTexture::Flags flags) const override
Definition qrhinull.cpp:107
int resourceLimit(QRhi::ResourceLimit limit) const override
Definition qrhinull.cpp:120
QRhiShaderResourceBindings * createShaderResourceBindings() override
Definition qrhinull.cpp:253
void setBlendConstants(QRhiCommandBuffer *cb, const QColor &c) override
Definition qrhinull.cpp:299
void endExternal(QRhiCommandBuffer *cb) override
Definition qrhinull.cpp:444
bool isDeviceLost() const override
Definition qrhinull.cpp:196
iterator end()
Definition qrhi_p.h:839
value_type * iterator
Definition qrhi_p.h:835
const value_type * const_iterator
Definition qrhi_p.h:836
bool isEmpty() const
Definition qrhi_p.h:845
iterator find(Key key)
Definition qrhi_p.h:864
const_iterator end() const
Definition qrhi_p.h:841
void append(Key key, const T &value)
Definition qrhi_p.h:873
const_iterator find(Key key) const
Definition qrhi_p.h:854
qsizetype size() const
Definition qrhi_p.h:846
std::pair< Key, T > value_type
Definition qrhi_p.h:834
const_iterator begin() const
Definition qrhi_p.h:840
bool contains(Key key) const
Definition qrhi_p.h:870
const_iterator cend() const
Definition qrhi_p.h:843
iterator begin()
Definition qrhi_p.h:838
const_iterator cbegin() const
Definition qrhi_p.h:842
static TextureStage toPassTrackerTextureStage(QRhiShaderResourceBinding::StageFlags stages)
Definition qrhi.cpp:13766
static BufferStage toPassTrackerBufferStage(QRhiShaderResourceBinding::StageFlags stages)
Definition qrhi.cpp:13747
bool isEmpty() const
Definition qrhi.cpp:13656
const QRhiPassResourceMap< QRhiTexture *, Texture, 12 > & textures() const
Definition qrhi_p.h:967
void registerBuffer(QRhiBuffer *buf, int slot, BufferAccess *access, BufferStage *stage, const UsageState &state)
Definition qrhi.cpp:13673
void registerTexture(QRhiTexture *tex, TextureAccess *access, TextureStage *stage, const UsageState &state)
Definition qrhi.cpp:13713
const QRhiPassResourceMap< QRhiBuffer *, Buffer, 12 > & buffers() const
Definition qrhi_p.h:959
QRhiPipelineCacheDataReader(const char *data, quint32 size)
Definition qrhi_p.h:1100
bool readByteArray(QByteArray *dst)
Definition qrhi_p.h:1115
bool readUInt32(quint32 *dst)
Definition qrhi_p.h:1105
QVarLengthArray< BufferOp, BUFFER_OPS_STATIC_ALLOC > bufferOps
Definition qrhi_p.h:730
QRhiImplementation * rhi
Definition qrhi_p.h:737
QVarLengthArray< TextureOp, TEXTURE_OPS_STATIC_ALLOC > textureOps
Definition qrhi_p.h:734
static const int BUFFER_OPS_STATIC_ALLOC
Definition qrhi_p.h:729
static QRhiResourceUpdateBatchPrivate * get(QRhiResourceUpdateBatch *b)
Definition qrhi_p.h:745
void merge(QRhiResourceUpdateBatchPrivate *other)
Definition qrhi.cpp:11430
QRhiResourceUpdateBatch * q
Definition qrhi_p.h:736
static const int TEXTURE_OPS_STATIC_ALLOC
Definition qrhi_p.h:733
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:9500
static QRhiPassResourceTracker::BufferStage earlierStage(QRhiPassResourceTracker::BufferStage a, QRhiPassResourceTracker::BufferStage b)
Definition qrhi.cpp:13667
QDebug operator<<(QDebug dbg, const QRhiSwapChainHdrInfo &info)
Definition qrhi.cpp:8552
static bool isImageLoadStore(QRhiPassResourceTracker::TextureAccess access)
Definition qrhi.cpp:13706
static const char * deviceTypeStr(QRhiDriverInfo::DeviceType type)
\variable QRhiDriverInfo::deviceName
Definition qrhi.cpp:10483
static QRhiPassResourceTracker::TextureStage earlierStage(QRhiPassResourceTracker::TextureStage a, QRhiPassResourceTracker::TextureStage b)
Definition qrhi.cpp:13700
QRhiTargetRectBoundMode
Definition qrhi_p.h:389
@ UnBounded
Definition qrhi_p.h:390
@ Bounded
Definition qrhi_p.h:391
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:1089
bool operator!=(const QRhiRenderTargetAttachmentTracker::ResId &a, const QRhiRenderTargetAttachmentTracker::ResId &b)
Definition qrhi_p.h:1029
Q_DECLARE_TYPEINFO(QRhiPassResourceTracker::Buffer, Q_RELOCATABLE_TYPE)
#define QRHI_RES(t, x)
Definition qrhi_p.h:32
bool operator==(const QRhiRenderTargetAttachmentTracker::ResId &a, const QRhiRenderTargetAttachmentTracker::ResId &b)
Definition qrhi_p.h:1024
quint32 qrhiBinaryCacheEntryByteSize(const QByteArray &data)
Definition qrhi_p.h:309
bool qrhi_toTopLeftRenderTargetRect(const QSize &outputSize, const std::array< T, N > &r, T *x, T *y, T *w, T *h)
Definition qrhi_p.h:395
bool operator!=(const QGles2CommandBuffer::GraphicsPassState::Blend &a, const QGles2CommandBuffer::GraphicsPassState::Blend &b)
bool operator!=(const QGles2SamplerData &a, const QGles2SamplerData &b)
bool operator==(const QGles2CommandBuffer::GraphicsPassState::StencilFace &a, const QGles2CommandBuffer::GraphicsPassState::StencilFace &b)
bool operator==(const QGles2CommandBuffer::GraphicsPassState::Blend &a, const QGles2CommandBuffer::GraphicsPassState::Blend &b)
Q_DECLARE_TYPEINFO(QRhiGles2::DeferredReleaseEntry, Q_RELOCATABLE_TYPE)
bool operator!=(const QGles2CommandBuffer::GraphicsPassState::ColorMask &a, const QGles2CommandBuffer::GraphicsPassState::ColorMask &b)
bool operator==(const QGles2CommandBuffer::GraphicsPassState::ColorMask &a, const QGles2CommandBuffer::GraphicsPassState::ColorMask &b)
Q_DECLARE_TYPEINFO(QGles2SamplerDescription, Q_RELOCATABLE_TYPE)
bool operator==(const QGles2SamplerData &a, const QGles2SamplerData &b)
Definition qrhigles2_p.h:95
bool operator!=(const QGles2CommandBuffer::GraphicsPassState::StencilFace &a, const QGles2CommandBuffer::GraphicsPassState::StencilFace &b)
Q_DECLARE_TYPEINFO(QGles2UniformState, Q_PRIMITIVE_TYPE)
Q_DECLARE_TYPEINFO(QGles2UniformDescription, Q_RELOCATABLE_TYPE)
quint32 qrhiBinaryCacheEntryByteSize(const QRhiGles2::PipelineCacheData &d)
constexpr size_t qHash(const QSize &s, size_t seed=0) noexcept
Definition qsize.h:192
QGles2Buffer(QRhiImplementation *rhi, Type type, UsageFlags usage, quint32 size)
@ AccessStorageReadWrite
Definition qrhigles2_p.h:55
QByteArray data
Definition qrhigles2_p.h:47
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
char * beginFullDynamicBufferUpdateForCurrentFrame() override
void endFullDynamicBufferUpdateForCurrentFrame() override
To be called when the entire contents of the buffer data has been updated in the memory block returne...
QRhiBuffer::NativeBuffer nativeBuffer() override
bool create() override
Creates the corresponding native graphics resources.
GLenum targetForDataOps
Definition qrhigles2_p.h:46
quint32 nonZeroSize
Definition qrhigles2_p.h:44
void fullDynamicBufferUpdateForCurrentFrame(const void *data, quint32 size) override
UsageState usageState
Definition qrhigles2_p.h:62
GLuint buffer
Definition qrhigles2_p.h:45
QVarLengthArray< QImage, 4 > imageRetainPool
QRhiShaderResourceBindings * currentGraphicsSrb
QVarLengthArray< QRhiBufferData, 4 > bufferDataRetainPool
QRhiBackendCommandList< Command > commands
QRhiComputePipeline * currentComputePipeline
QRhiRenderTarget * currentTarget
QRhiShaderResourceBindings * currentComputeSrb
QVarLengthArray< QRhiPassResourceTracker, 8 > passResTrackers
QVarLengthArray< char, 128 > pushConstantData
QGles2CommandBuffer(QRhiImplementation *rhi)
const void * retainImage(const QImage &image)
const void * retainData(const QByteArray &data)
QVarLengthArray< char, 1024 > pushConstantPool
QVarLengthArray< uint, 32 > dynamicOffsetPool
const uchar * retainBufferData(const QRhiBufferData &data)
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
QRhiGraphicsPipeline * currentGraphicsPipeline
QVarLengthArray< QByteArray, 4 > dataRetainPool
QGles2UniformDescriptionVector pushConstantUniforms
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
QGles2UniformDescriptionVector uniforms
QRhiShaderResourceBindings * currentSrb
QGles2UniformStateVector uniformState
QGles2ComputePipeline(QRhiImplementation *rhi)
QGles2SamplerDescriptionVector samplers
bool create() override
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
QGles2SamplerDescriptionVector samplers
bool create() override
Creates the corresponding native graphics resources.
QGles2GraphicsPipeline(QRhiImplementation *rhi)
QGles2UniformDescriptionVector pushConstantUniforms
QGles2UniformStateVector uniformState
QRhiShaderResourceBindings * currentSrb
QGles2UniformDescriptionVector uniforms
bool create() override
Creates the corresponding native graphics resources.
QGles2RenderBuffer(QRhiImplementation *rhi, Type type, const QSize &pixelSize, int sampleCount, QRhiRenderBuffer::Flags flags, QRhiTexture::Format backingFormatHint)
bool createFrom(NativeRenderBuffer src) override
Similar to create() except that no new native renderbuffer objects are created.
QRhiTexture::Format backingFormat() const override
GLuint stencilRenderbuffer
Definition qrhigles2_p.h:78
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
QVector< quint32 > serializedFormat() const override
QRhiRenderPassDescriptor * newCompatibleRenderPassDescriptor() const override
bool isCompatible(const QRhiRenderPassDescriptor *other) const override
QGles2RenderPassDescriptor(QRhiImplementation *rhi)
QGles2RenderTargetData(QRhiImplementation *)
std::optional< QRhiSwapChain::StereoTargetBuffer > stereoTarget
QGles2RenderPassDescriptor * rp
QRhiRenderTargetAttachmentTracker::ResIdList currentResIdList
GLenum gltexcomparefunc
Definition qrhigles2_p.h:92
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
bool create() override
QGles2SamplerData d
QGles2Sampler(QRhiImplementation *rhi, Filter magFilter, Filter minFilter, Filter mipmapMode, AddressMode u, AddressMode v, AddressMode w)
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
void updateResources(UpdateFlags flags) override
bool create() override
Creates the corresponding resource binding set.
QGles2ShaderResourceBindings(QRhiImplementation *rhi)
float devicePixelRatio() const override
QGles2SwapChainRenderTarget(QRhiImplementation *rhi, QRhiSwapChain *swapchain)
QSize pixelSize() const override
int sampleCount() const override
QGles2RenderTargetData d
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
void prepare(QRhiGles2 *rhiD)
bool active[TIMESTAMP_PAIRS]
bool tryQueryTimestamps(int pairIndex, QRhiGles2 *rhiD, double *elapsedSec)
static const int TIMESTAMP_PAIRS
GLuint query[TIMESTAMP_PAIRS *2]
void destroy(QRhiGles2 *rhiD)
void initSwapChainRenderTarget(QGles2SwapChainRenderTarget *rt)
QGles2SwapChainRenderTarget rtRight
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
QGles2CommandBuffer cb
QGles2SwapChainRenderTarget rt
QSurface * surface
QRhiRenderPassDescriptor * newCompatibleRenderPassDescriptor() override
int currentTimestampPairIndex
bool isFormatSupported(Format f) override
bool createOrResize() override
Creates the swapchain if not already done and resizes the swapchain buffers to match the current size...
QGles2SwapChainTimestamps timestamps
QGles2SwapChain(QRhiImplementation *rhi)
QRhiCommandBuffer * currentFrameCommandBuffer() override
QRhiRenderTarget * currentFrameRenderTarget(StereoTargetBuffer targetBuffer) override
QGles2SwapChainRenderTarget rtLeft
QSize surfacePixelSize() override
QRhiRenderTarget * currentFrameRenderTarget() override
int sampleCount() const override
QGles2TextureRenderTarget(QRhiImplementation *rhi, const QRhiTextureRenderTargetDescription &desc, Flags flags)
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
float devicePixelRatio() const override
QSize pixelSize() const override
QRhiRenderPassDescriptor * newCompatibleRenderPassDescriptor() override
bool create() override
Creates the corresponding native graphics resources.
QGles2RenderTargetData d
bool createFrom(NativeTexture src) override
Similar to create(), except that no new native textures are created.
QGles2Texture(QRhiImplementation *rhi, Format format, const QSize &pixelSize, int depth, int arraySize, int sampleCount, Flags flags)
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
char * data
Definition qrhinull_p.h:31
QNullBuffer(QRhiImplementation *rhi, Type type, UsageFlags usage, quint32 size)
Definition qrhinull.cpp:681
bool create() override
Creates the corresponding native graphics resources.
Definition qrhinull.cpp:701
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
Definition qrhinull.cpp:691
char * beginFullDynamicBufferUpdateForCurrentFrame() override
Definition qrhinull.cpp:715
QNullCommandBuffer(QRhiImplementation *rhi)
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
bool create() override
QNullComputePipeline(QRhiImplementation *rhi)
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
bool create() override
Creates the corresponding native graphics resources.
QNullGraphicsPipeline(QRhiImplementation *rhi)
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
Definition qrhinull.cpp:733
bool create() override
Creates the corresponding native graphics resources.
Definition qrhinull.cpp:742
QNullRenderBuffer(QRhiImplementation *rhi, Type type, const QSize &pixelSize, int sampleCount, QRhiRenderBuffer::Flags flags, QRhiTexture::Format backingFormatHint)
Definition qrhinull.cpp:721
QRhiTexture::Format backingFormat() const override
Definition qrhinull.cpp:756
QNullRenderPassDescriptor(QRhiImplementation *rhi)
Definition qrhinull.cpp:866
QRhiRenderPassDescriptor * newCompatibleRenderPassDescriptor() const override
Definition qrhinull.cpp:889
QVector< quint32 > serializedFormat() const override
Definition qrhinull.cpp:897
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
Definition qrhinull.cpp:876
bool isCompatible(const QRhiRenderPassDescriptor *other) const override
Definition qrhinull.cpp:883
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:852
QNullSampler(QRhiImplementation *rhi, Filter magFilter, Filter minFilter, Filter mipmapMode, AddressMode u, AddressMode v, AddressMode w)
Definition qrhinull.cpp:841
bool create() override
Definition qrhinull.cpp:859
QNullShaderResourceBindings(QRhiImplementation *rhi)
Definition qrhinull.cpp:997
bool create() override
Creates the corresponding resource binding set.
void updateResources(UpdateFlags flags) override
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
QSize pixelSize() const override
Definition qrhinull.cpp:917
float devicePixelRatio() const override
Definition qrhinull.cpp:922
QNullRenderTargetData d
Definition qrhinull_p.h:101
QNullSwapChainRenderTarget(QRhiImplementation *rhi, QRhiSwapChain *swapchain)
Definition qrhinull.cpp:902
int sampleCount() const override
Definition qrhinull.cpp:927
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
Definition qrhinull.cpp:913
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:979
int sampleCount() const override
Definition qrhinull.cpp:992
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
Definition qrhinull.cpp:945
QRhiRenderPassDescriptor * newCompatibleRenderPassDescriptor() override
Definition qrhinull.cpp:952
bool create() override
Creates the corresponding native graphics resources.
Definition qrhinull.cpp:960
QNullTextureRenderTarget(QRhiImplementation *rhi, const QRhiTextureRenderTargetDescription &desc, Flags flags)
Definition qrhinull.cpp:932
QNullRenderTargetData d
Definition qrhinull_p.h:117
float devicePixelRatio() const override
Definition qrhinull.cpp:987
bool create() override
Creates the corresponding native graphics resources.
Definition qrhinull.cpp:781
bool createFrom(NativeTexture src) override
Similar to create(), except that no new native textures are created.
Definition qrhinull.cpp:825
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:761
uint generation
Definition qrhinull_p.h:59
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
Definition qrhinull.cpp:772
bool operator!=(const Batch &other) const
Definition qrhi_p.h:785
QVector< T > resources
Definition qrhi_p.h:778
bool operator==(const Batch &other) const
Definition qrhi_p.h:780
void feed(int binding, T resource)
Definition qrhi_p.h:751
QVector< Batch > batches
Definition qrhi_p.h:794
bool operator!=(const QRhiBatchedBindings< T > &other) const
Definition qrhi_p.h:801
bool operator==(const QRhiBatchedBindings< T > &other) const
Definition qrhi_p.h:796
void insertWithCapacityLimit(const Key &key, const Value &value)
Definition qrhi_p.h:330
quint32 dataByteSize
Definition qrhi_p.h:321
void clear()
Definition qrhi_p.h:324
const char * name
Definition qrhi_p.h:322
QHash< Key, Value > data
Definition qrhi_p.h:320
QRhiBinaryCache(const char *name)
Definition qrhi_p.h:318
char smallData[SMALL_DATA_SIZE]
Definition qrhi_p.h:447
QByteArray largeData
Definition qrhi_p.h:445
static constexpr quint32 SMALL_DATA_SIZE
Definition qrhi_p.h:446
void(* frameEnd)(QRhiImplementation *d, QRhiSwapChain *swapChain, QRhiCommandBuffer *cb)
Definition qrhi_p.h:361
void(* rhiAboutToBeDestroyed)(QRhiImplementation *d)
Definition qrhi_p.h:362
uint needsDepthStencilCombinedAttach
uint perRenderTargetBlending
int maxThreadGroupsPerDimension
uint glesMultisampleRenderToTexture
uint srgbTextureRenderTarget
int maxFragmentStorageBuffers
uint fixedIndexPrimitiveRestart
uint screenSpaceDerivatives
uint nonBaseLevelFramebufferTexture
uint glesMultiviewMultisampleRenderToTexture
OffscreenFrame(QRhiImplementation *rhi)
QGles2CommandBuffer cbWrapper
QVarLengthArray< data32_t, 128 > packedArray
QVarLengthArray< SeparateTexture, 8 > separateTextureBindings
QVarLengthArray< SeparateSampler, 4 > separateSamplerBindings
static void updateResIdList(const QRhiTextureRenderTargetDescription &desc, ResIdList *dst)
Definition qrhi_p.h:1035
static bool isUpToDate(const QRhiTextureRenderTargetDescription &desc, const ResIdList &currentResIdList)
Definition qrhi_p.h:1073
static void changeToDynamicUpdate(BufferOp *op, QRhiBuffer *buf, quint32 offset, QByteArray data)
Definition qrhi_p.h:575
static void changeToStaticUpload(BufferOp *op, QRhiBuffer *buf, quint32 offset, QByteArray data)
Definition qrhi_p.h:606
static BufferOp clear(QRhiBuffer *buf, quint32 offset, quint32 size, quint8 value)
Definition qrhi_p.h:638
static void changeToStaticUpload(BufferOp *op, QRhiBuffer *buf, quint32 offset, quint32 size, const void *data)
Definition qrhi_p.h:590
static BufferOp dynamicUpdate(QRhiBuffer *buf, quint32 offset, QByteArray data)
Definition qrhi_p.h:568
static BufferOp staticUpload(QRhiBuffer *buf, quint32 offset, QByteArray data)
Definition qrhi_p.h:599
static BufferOp copy(QRhiBuffer *dst, QRhiBuffer *src, quint32 dstOffset, quint32 srcOffset, quint32 size)
Definition qrhi_p.h:625
static BufferOp staticUpload(QRhiBuffer *buf, quint32 offset, quint32 size, const void *data)
Definition qrhi_p.h:583
static BufferOp read(QRhiBuffer *buf, quint32 offset, quint32 size, QRhiReadbackResult *result)
Definition qrhi_p.h:614
static BufferOp dynamicUpdate(QRhiBuffer *buf, quint32 offset, quint32 size, const void *data)
Definition qrhi_p.h:552
static void changeToDynamicUpdate(BufferOp *op, QRhiBuffer *buf, quint32 offset, quint32 size, const void *data)
Definition qrhi_p.h:559
QRhiTextureSubresourceUploadDescription desc
Definition qrhi_p.h:678
QRhiTextureCopyDescription desc
Definition qrhi_p.h:682
static TextureOp copy(QRhiTexture *dst, QRhiTexture *src, const QRhiTextureCopyDescription &desc)
Definition qrhi_p.h:700
QVarLengthArray< SubresourceUpload, 4 > subresDesc
Definition qrhi_p.h:680
static TextureOp upload(QRhiTexture *tex, const QRhiTextureUploadDescription &desc)
Definition qrhi_p.h:686
static TextureOp genMips(QRhiTexture *tex)
Definition qrhi_p.h:719
static TextureOp read(const QRhiReadbackDescription &rb, QRhiReadbackResult *result)
Definition qrhi_p.h:710
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
Definition qrhi.h:1588
LimitsType limitsType
Definition qrhi.h:1599
float maxPotentialColorComponentValue
Definition qrhi.h:1607
LuminanceBehavior luminanceBehavior
Definition qrhi.h:1610
float maxColorComponentValue
Definition qrhi.h:1606
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
Definition qrhi.h:1621
void * reserved[2]
Definition qrhi.h:1622
QRhiShaderResourceBindings * srb
QRhiGraphicsPipeline * maybeGraphicsPs
QRhiComputePipeline * maybeComputePs
QRhiSwapChain::StereoTargetBuffer stereoTarget