Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qrhigles2_p.h
Go to the documentation of this file.
1// Copyright (C) 2023 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#ifndef QRHIGLES2_P_H
6#define QRHIGLES2_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include "qrhi_p.h"
20#include <rhi/qshaderdescription.h>
21#include <qopengl.h>
22#include <QByteArray>
23#include <QWindow>
24#include <QPointer>
25#include <QtCore/private/qduplicatetracker_p.h>
26#include <optional>
27
28QT_BEGIN_NAMESPACE
29
30class QOpenGLExtensions;
31class QRhiGles2;
32
65
67{
68 QGles2RenderBuffer(QRhiImplementation *rhi, Type type, const QSize &pixelSize,
69 int sampleCount, QRhiRenderBuffer::Flags flags,
70 QRhiTexture::Format backingFormatHint);
72 void destroy() override;
73 bool create() override;
74 bool createFrom(NativeRenderBuffer src) override;
75 QRhiTexture::Format backingFormat() const override;
76
78 GLuint stencilRenderbuffer = 0; // when packed depth-stencil not supported
80 bool owns = true;
81 uint generation = 0;
82 friend class QRhiGles2;
83};
84
94
95inline bool operator==(const QGles2SamplerData &a, const QGles2SamplerData &b)
96{
97 return a.glminfilter == b.glminfilter
98 && a.glmagfilter == b.glmagfilter
99 && a.glwraps == b.glwraps
100 && a.glwrapt == b.glwrapt
101 && a.glwrapr == b.glwrapr
102 && a.gltexcomparefunc == b.gltexcomparefunc;
103}
104
105inline bool operator!=(const QGles2SamplerData &a, const QGles2SamplerData &b)
106{
107 return !(a == b);
108}
109
111{
112 QGles2Texture(QRhiImplementation *rhi, Format format, const QSize &pixelSize, int depth,
113 int arraySize, int sampleCount, Flags flags);
114 ~QGles2Texture();
115 void destroy() override;
116 bool create() override;
117 bool createFrom(NativeTexture src) override;
118 NativeTexture nativeTexture() override;
119
120 bool prepareCreate(QSize *adjustedSize = nullptr);
121
123 bool owns = true;
130 bool specified = false;
131 // when !specified (compressed format without texture storage support), the mip levels
132 // are allocated lazily, one bitmask of mip levels per cubemap face
136
137 bool isLevelAllocated(int face, int level) const
138 {
139 return specified || (allocatedLevels[face] & (1u << uint(level)));
140 }
141
152 struct UsageState {
154 };
156
157 uint generation = 0;
158 friend class QRhiGles2;
159};
160
162{
163 QGles2Sampler(QRhiImplementation *rhi, Filter magFilter, Filter minFilter, Filter mipmapMode,
164 AddressMode u, AddressMode v, AddressMode w);
165 ~QGles2Sampler();
166 void destroy() override;
167 bool create() override;
168
170 uint generation = 0;
171 friend class QRhiGles2;
172};
173
175{
176 QGles2RenderPassDescriptor(QRhiImplementation *rhi);
178 void destroy() override;
179 bool isCompatible(const QRhiRenderPassDescriptor *other) const override;
181 QVector<quint32> serializedFormat() const override;
182};
183
200
202{
203 QGles2SwapChainRenderTarget(QRhiImplementation *rhi, QRhiSwapChain *swapchain);
205 void destroy() override;
206
207 QSize pixelSize() const override;
208 float devicePixelRatio() const override;
209 int sampleCount() const override;
210
212};
213
215{
216 QGles2TextureRenderTarget(QRhiImplementation *rhi, const QRhiTextureRenderTargetDescription &desc, Flags flags);
218 void destroy() override;
219
220 QSize pixelSize() const override;
221 float devicePixelRatio() const override;
222 int sampleCount() const override;
223
225 bool create() override;
226
230 friend class QRhiGles2;
231};
232
234{
235 QGles2ShaderResourceBindings(QRhiImplementation *rhi);
237 void destroy() override;
238 bool create() override;
239 void updateResources(UpdateFlags flags) override;
240
241 bool hasDynamicOffset = false;
242 uint generation = 0;
243 friend class QRhiGles2;
244};
245
247{
254 // Distance in bytes between the array elements, or between the matrix
255 // columns for matrix types. 0 means the std140 default (16). Uniform
256 // blocks are std140, but push constant blocks are std430, where arrays of
257 // scalars and vec2 are tightly packed.
259 int stateIndex; // -1 when not tracked (arrays, matrices, int types)
260};
261
263
271
273
274using QGles2UniformDescriptionVector = QVarLengthArray<QGles2UniformDescription, 8>;
275using QGles2SamplerDescriptionVector = QVarLengthArray<QGles2SamplerDescription, 4>;
276
278{
280 float v[4];
281};
282
284
285using QGles2UniformStateVector = QVarLengthArray<QGles2UniformState, 8>;
286
307
327
329{
330 QGles2CommandBuffer(QRhiImplementation *rhi);
332 void destroy() override;
333
334 struct Command {
376
377 // QRhi*/QGles2* references should be kept at minimum (so no
378 // QRhiTexture/Buffer/etc. pointers).
379 union Args {
380 struct {
381 GLuint timestampQuery;
382 } beginFrame;
383 struct {
384 GLuint timestampQuery;
385 } endFrame;
386 struct {
387 float x, y, w, h;
388 float d0, d1;
389 } viewport;
390 struct {
391 int x, y, w, h;
392 } scissor;
393 struct {
394 float r, g, b, a;
395 } blendConstants;
396 struct {
397 quint32 ref;
398 QRhiGraphicsPipeline *ps;
399 } stencilRef;
400 struct {
401 QRhiGraphicsPipeline *ps;
402 GLuint buffer;
403 quint32 offset;
404 int binding;
405 } bindVertexBuffer;
406 struct {
407 GLuint buffer;
408 quint32 offset;
409 GLenum type;
410 } bindIndexBuffer;
411 struct {
412 QRhiGraphicsPipeline *ps;
413 quint32 vertexCount;
414 quint32 firstVertex;
415 quint32 instanceCount;
416 quint32 baseInstance;
417 } draw;
418 struct {
419 QRhiGraphicsPipeline *ps;
420 quint32 indexCount;
421 quint32 firstIndex;
422 quint32 instanceCount;
423 quint32 baseInstance;
424 qint32 baseVertex;
425 } drawIndexed;
426 struct {
427 QRhiGraphicsPipeline *ps;
428 GLuint buffer;
429 quint32 offset;
430 quint32 drawCount;
431 quint32 stride;
432 } drawIndirect;
433 struct {
434 QRhiGraphicsPipeline *ps;
435 GLuint buffer;
436 quint32 offset;
437 quint32 drawCount;
438 quint32 stride;
439 } drawIndexedIndirect;
440 struct {
441 QRhiGraphicsPipeline *ps;
442 GLuint buffer;
443 quint32 offset;
444 GLuint countBuffer;
445 quint32 countOffset;
446 quint32 maxDrawCount;
447 quint32 stride;
448 } drawIndirectCount;
449 struct {
450 QRhiGraphicsPipeline *ps;
451 GLuint buffer;
452 quint32 offset;
453 GLuint countBuffer;
454 quint32 countOffset;
455 quint32 maxDrawCount;
456 quint32 stride;
457 } drawIndexedIndirectCount;
458 struct {
459 QRhiGraphicsPipeline *ps;
460 } bindGraphicsPipeline;
461 struct {
462 QRhiGraphicsPipeline *maybeGraphicsPs;
463 QRhiComputePipeline *maybeComputePs;
464 QRhiShaderResourceBindings *srb;
465 int dynamicOffsetCount;
466 quint32 dynamicOffsetPoolOffset;
467 } bindShaderResources;
468 struct {
469 QRhiGraphicsPipeline *maybeGraphicsPs;
470 QRhiComputePipeline *maybeComputePs;
471 quint32 dataOffset; // into pushConstantPool
472 quint32 size;
473 } setPushConstants;
474 struct {
475 GLbitfield mask;
476 float c[4];
477 float d;
478 quint32 s;
479 } clear;
480 struct {
481 GLuint fbo;
482 bool srgb;
483 int colorAttCount;
484 bool stereo;
485 QRhiSwapChain::StereoTargetBuffer stereoTarget;
486 } bindFramebuffer;
487 struct {
488 GLenum target;
489 GLuint buffer;
490 int offset;
491 int size;
492 const void *data; // must come from retainData()
493 } bufferSubData;
494 struct {
495 QRhiReadbackResult *result;
496 GLenum target;
497 GLuint buffer;
498 int offset;
499 int size;
500 } getBufferSubData;
501 struct {
502 GLuint srcBuffer;
503 GLuint dstBuffer;
504 int srcOffset;
505 int dstOffset;
506 int size;
507 } copyBuf;
508 struct {
509 GLenum target;
510 GLuint buffer;
511 int offset;
512 int size;
513 quint8 value;
514 } clearBufferSubData;
515 struct {
516 GLenum srcTarget;
517 GLenum srcFaceTarget;
518 GLuint srcTexture;
519 int srcLevel;
520 int srcX;
521 int srcY;
522 int srcZ;
523 GLenum dstTarget;
524 GLuint dstTexture;
525 GLenum dstFaceTarget;
526 int dstLevel;
527 int dstX;
528 int dstY;
529 int dstZ;
530 int w;
531 int h;
532 } copyTex;
533 struct {
534 QRhiReadbackResult *result;
535 GLuint texture;
536 int x;
537 int y;
538 int w;
539 int h;
540 QRhiTexture::Format format;
541 GLenum readTarget;
542 int level;
543 int slice3D;
544 } readPixels;
545 struct {
546 GLenum target;
547 GLuint texture;
548 GLenum faceTarget;
549 int level;
550 int dx;
551 int dy;
552 int dz;
553 int w;
554 int h;
555 GLenum glformat;
556 GLenum gltype;
557 int rowStartAlign;
558 int rowLength;
559 const void *data; // must come from retainImage()
560 } subImage;
561 struct {
562 GLenum target;
563 GLuint texture;
564 GLenum faceTarget;
565 int level;
566 GLenum glintformat;
567 int w;
568 int h;
569 int depth;
570 int size;
571 const void *data; // must come from retainData()
572 } compressedImage;
573 struct {
574 GLenum target;
575 GLuint texture;
576 GLenum faceTarget;
577 int level;
578 int dx;
579 int dy;
580 int dz;
581 int w;
582 int h;
583 GLenum glintformat;
584 int size;
585 const void *data; // must come from retainData()
586 } compressedSubImage;
587 struct {
588 GLuint renderbuffer;
589 GLuint stencilRenderbuffer;
590 int w;
591 int h;
592 GLenum target;
593 GLuint dstTexture;
594 int dstLevel;
595 int dstLayer;
596 bool isDepthStencil;
597 bool hasStencil;
598 } blitFromRenderbuffer;
599 struct {
600 GLenum srcTarget;
601 GLuint srcTexture;
602 int srcLevel;
603 int srcLayer;
604 int w;
605 int h;
606 GLenum dstTarget;
607 GLuint dstTexture;
608 int dstLevel;
609 int dstLayer;
610 bool isDepthStencil;
611 bool hasStencil;
612 } blitFromTexture;
613 struct {
614 GLenum target;
615 GLuint texture;
616 } genMip;
617 struct {
618 QRhiComputePipeline *ps;
619 } bindComputePipeline;
620 struct {
621 GLuint x;
622 GLuint y;
623 GLuint z;
624 } dispatch;
625 struct {
626 GLuint buffer;
627 quint32 offset;
628 } dispatchIndirect;
629 struct {
630 int trackerIndex;
631 } barriersForPass;
632 struct {
633 GLbitfield barriers;
634 } barrier;
635 struct {
636 GLuint fbo;
637 int attCount;
638 GLenum att[3];
639 } invalidateFramebuffer;
640 } args;
641 };
642
648
652
655 double lastGpuTime = 0;
664
666 bool valid = false;
671 bool blendEnabled[16];
672 struct ColorMask { bool r, g, b, a; } colorMask[16];
688 GLint stencilRef; // value currently applied in GL; may differ from dynamic.stencilRef
701 void reset() { valid = false; }
702 struct {
703 // not part of QRhiGraphicsPipeline but used by setGraphicsPipeline()
704 GLint stencilRef = 0;
705 } dynamic;
706 } graphicsPassState;
707
709 enum Access {
710 Read = 0x01,
711 Write = 0x02
712 };
714 void reset() {
715 writtenResources.clear();
716 }
717 } computePassState;
718
720 void *ps;
723 } textureUnitState[16];
724
727 QVarLengthArray<uint, 32> dynamicOffsetPool; // (binding, offset) pairs
730
731 // relies heavily on implicit sharing (no copies of the actual data will be made)
732 const void *retainData(const QByteArray &data) {
733 dataRetainPool.append(data);
734 return dataRetainPool.last().constData();
735 }
737 bufferDataRetainPool.append(data);
738 return reinterpret_cast<const uchar *>(bufferDataRetainPool.last().constData());
739 }
740 const void *retainImage(const QImage &image) {
741 imageRetainPool.append(image);
742 return imageRetainPool.last().constBits();
743 }
745 commands.reset();
746 pushConstantPool.clear();
747 dynamicOffsetPool.clear();
748 dataRetainPool.clear();
749 bufferDataRetainPool.clear();
750 imageRetainPool.clear();
751
752 passResTrackers.clear();
754 }
755 void resetState() {
758 // do not zero lastGpuTime
759 currentTarget = nullptr;
762 }
764 currentGraphicsPipeline = nullptr;
765 currentComputePipeline = nullptr;
767 currentGraphicsSrb = nullptr;
768 currentComputeSrb = nullptr;
770 pushConstantData.clear();
771 graphicsPassState.reset();
772 computePassState.reset();
773 memset(textureUnitState, 0, sizeof(textureUnitState));
774 }
775};
776
779{
780 return a.func == b.func
781 && a.failOp == b.failOp
782 && a.zfailOp == b.zfailOp
783 && a.zpassOp == b.zpassOp;
784}
785
788{
789 return !(a == b);
790}
791
794{
795 return a.r == b.r && a.g == b.g && a.b == b.b && a.a == b.a;
796}
797
800{
801 return !(a == b);
802}
803
806{
807 return a.srcColor == b.srcColor
808 && a.dstColor == b.dstColor
809 && a.srcAlpha == b.srcAlpha
810 && a.dstAlpha == b.dstAlpha
811 && a.opColor == b.opColor
812 && a.opAlpha == b.opAlpha;
813}
814
817{
818 return !(a == b);
819}
820
822{
823 static const int TIMESTAMP_PAIRS = 2;
824
827
828 void prepare(QRhiGles2 *rhiD);
829 void destroy(QRhiGles2 *rhiD);
830 bool tryQueryTimestamps(int pairIndex, QRhiGles2 *rhiD, double *elapsedSec);
831};
832
860
862{
863public:
864 QRhiGles2(QRhiGles2InitParams *params, QRhiGles2NativeHandles *importDevice = nullptr);
865
866 bool create(QRhi::Flags flags) override;
867 void destroy() override;
868
872 QRhiBuffer *createBuffer(QRhiBuffer::Type type,
873 QRhiBuffer::UsageFlags usage,
874 quint32 size) override;
875 QRhiRenderBuffer *createRenderBuffer(QRhiRenderBuffer::Type type,
876 const QSize &pixelSize,
877 int sampleCount,
878 QRhiRenderBuffer::Flags flags,
879 QRhiTexture::Format backingFormatHint) override;
880 QRhiTexture *createTexture(QRhiTexture::Format format,
881 const QSize &pixelSize,
882 int depth,
883 int arraySize,
884 int sampleCount,
885 QRhiTexture::Flags flags) override;
886 QRhiSampler *createSampler(QRhiSampler::Filter magFilter,
887 QRhiSampler::Filter minFilter,
888 QRhiSampler::Filter mipmapMode,
889 QRhiSampler:: AddressMode u,
890 QRhiSampler::AddressMode v,
891 QRhiSampler::AddressMode w) override;
892
893 QRhiTextureRenderTarget *createTextureRenderTarget(const QRhiTextureRenderTargetDescription &desc,
894 QRhiTextureRenderTarget::Flags flags) override;
895
896 QRhiShadingRateMap *createShadingRateMap() override;
897
898 QRhiSwapChain *createSwapChain() override;
899 QRhi::FrameOpResult beginFrame(QRhiSwapChain *swapChain, QRhi::BeginFrameFlags flags) override;
900 QRhi::FrameOpResult endFrame(QRhiSwapChain *swapChain, QRhi::EndFrameFlags flags) override;
901 QRhi::FrameOpResult beginOffscreenFrame(QRhiCommandBuffer **cb, QRhi::BeginFrameFlags flags) override;
902 QRhi::FrameOpResult endOffscreenFrame(QRhi::EndFrameFlags flags) override;
903 QRhi::FrameOpResult finish() override;
904
905 void resourceUpdate(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override;
906
907 void beginPass(QRhiCommandBuffer *cb,
908 QRhiRenderTarget *rt,
909 const QColor &colorClearValue,
910 const QRhiDepthStencilClearValue &depthStencilClearValue,
911 QRhiResourceUpdateBatch *resourceUpdates,
912 QRhiCommandBuffer::BeginPassFlags flags) override;
913 void endPass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override;
914
915 void setGraphicsPipeline(QRhiCommandBuffer *cb,
916 QRhiGraphicsPipeline *ps) override;
917
918 void setShaderResources(QRhiCommandBuffer *cb,
919 QRhiShaderResourceBindings *srb,
920 int dynamicOffsetCount,
921 const QRhiCommandBuffer::DynamicOffset *dynamicOffsets) override;
922
923 void setVertexInput(QRhiCommandBuffer *cb,
924 int startBinding, int bindingCount, const QRhiCommandBuffer::VertexInput *bindings,
925 QRhiBuffer *indexBuf, quint32 indexOffset,
926 QRhiCommandBuffer::IndexFormat indexFormat) override;
927
928 void setViewport(QRhiCommandBuffer *cb, const QRhiViewport &viewport) override;
929 void setScissor(QRhiCommandBuffer *cb, const QRhiScissor &scissor) override;
930 void setBlendConstants(QRhiCommandBuffer *cb, const QColor &c) override;
931 void setStencilRef(QRhiCommandBuffer *cb, quint32 refValue) override;
932 void setPushConstants(QRhiCommandBuffer *cb, quint32 offset, quint32 size, const void *data) override;
933 static constexpr quint32 MAX_PUSH_CONSTANTS_SIZE = 128;
934 void setShadingRate(QRhiCommandBuffer *cb, const QSize &coarsePixelSize) override;
935
936 void draw(QRhiCommandBuffer *cb, quint32 vertexCount,
937 quint32 instanceCount, quint32 firstVertex, quint32 firstInstance) override;
938
939 void drawIndexed(QRhiCommandBuffer *cb, quint32 indexCount,
940 quint32 instanceCount, quint32 firstIndex,
941 qint32 vertexOffset, quint32 firstInstance) override;
942
943 void drawIndirect(QRhiCommandBuffer *cb, QRhiBuffer *indirectBuffer,
944 quint32 indirectBufferOffset, quint32 drawCount, quint32 stride) override;
945
946 void drawIndexedIndirect(QRhiCommandBuffer *cb, QRhiBuffer *indirectBuffer,
947 quint32 indirectBufferOffset, quint32 drawCount, quint32 stride) override;
948
949 void drawIndirectCount(QRhiCommandBuffer *cb,
950 QRhiBuffer *indirectBuffer, quint32 indirectBufferOffset,
951 QRhiBuffer *countBuffer, quint32 countBufferOffset,
952 quint32 maxDrawCount, quint32 stride) override;
953 void drawIndexedIndirectCount(QRhiCommandBuffer *cb,
954 QRhiBuffer *indirectBuffer, quint32 indirectBufferOffset,
955 QRhiBuffer *countBuffer, quint32 countBufferOffset,
956 quint32 maxDrawCount, quint32 stride) override;
957
958 void dispatchIndirect(QRhiCommandBuffer *cb, QRhiBuffer *indirectBuffer,
959 quint32 indirectBufferOffset) override;
960
961 void debugMarkBegin(QRhiCommandBuffer *cb, const QByteArray &name) override;
962 void debugMarkEnd(QRhiCommandBuffer *cb) override;
963 void debugMarkMsg(QRhiCommandBuffer *cb, const QByteArray &msg) override;
964
965 void beginComputePass(QRhiCommandBuffer *cb,
966 QRhiResourceUpdateBatch *resourceUpdates,
967 QRhiCommandBuffer::BeginPassFlags flags) override;
968 void endComputePass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override;
969 void setComputePipeline(QRhiCommandBuffer *cb, QRhiComputePipeline *ps) override;
970 void dispatch(QRhiCommandBuffer *cb, int x, int y, int z) override;
971
972 const QRhiNativeHandles *nativeHandles(QRhiCommandBuffer *cb) override;
973 void beginExternal(QRhiCommandBuffer *cb) override;
974 void endExternal(QRhiCommandBuffer *cb) override;
975 double lastCompletedGpuTime(QRhiCommandBuffer *cb) override;
976
977 QList<int> supportedSampleCounts() const override;
978 QList<QSize> supportedShadingRates(int sampleCount) const override;
979 int ubufAlignment() const override;
980 bool isYUpInFramebuffer() const override;
981 bool isYUpInNDC() const override;
982 bool isClipDepthZeroToOne() const override;
983 QMatrix4x4 clipSpaceCorrMatrix() const override;
984 bool isTextureFormatSupported(QRhiTexture::Format format, QRhiTexture::Flags flags) const override;
985 bool isFeatureSupported(QRhi::Feature feature) const override;
986 int resourceLimit(QRhi::ResourceLimit limit) const override;
987 const QRhiNativeHandles *nativeHandles() override;
988 QRhiDriverInfo driverInfo() const override;
989 QRhiStats statistics() override;
991 void setQueueSubmitParams(QRhiNativeHandles *params) override;
993 bool isDeviceLost() const override;
994
995 QByteArray pipelineCacheData() override;
996 void setPipelineCacheData(const QByteArray &data) override;
997
998 bool ensureContext(QSurface *surface = nullptr) const;
1001 GLuint genBuffer();
1006 int layer, int level, const QRhiTextureSubresourceUploadDescription &subresDesc);
1007 void enqueueResourceUpdates(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates);
1009 QGles2Buffer *bufD,
1013 QGles2Texture *texD,
1017 void executeCommandBuffer(QRhiCommandBuffer *cb);
1020 void *ps, uint psGeneration, int glslLocation,
1021 int *texUnit, bool *activeTexUnitAltered);
1023 QRhiGraphicsPipeline *maybeGraphicsPs, QRhiComputePipeline *maybeComputePs,
1024 QRhiShaderResourceBindings *srb,
1025 const uint *dynOfsPairs, int dynOfsCount);
1026 void setUniformValue(const QGles2UniformDescription &uniform, const void *src,
1027 QGles2UniformState *uniformState);
1028 static void setupUniformStateTracking(QGles2UniformDescriptionVector *uniforms,
1029 QGles2UniformDescriptionVector *pushConstantUniforms,
1030 QGles2UniformStateVector *uniformState);
1031 void setUniformsFromBlock(const QGles2UniformDescriptionVector &uniforms, int binding,
1032 const char *blockData, qint64 blockSize, quint32 blockOffset,
1033 QGles2UniformState *uniformState);
1035 bool *wantsColorClear = nullptr, bool *wantsDsClear = nullptr);
1038 std::optional<QShaderVersion> commonGlslEsVersion(const QRhiShaderStage *stages, int stageCount) const;
1039 QByteArray shaderSource(const QRhiShaderStage &shaderStage, QShaderVersion *shaderVersion,
1040 std::optional<QShaderVersion> commonVersion = std::nullopt);
1041 bool compileShader(GLuint program, const QRhiShaderStage &shaderStage, QShaderVersion *shaderVersion,
1042 std::optional<QShaderVersion> commonVersion = std::nullopt);
1043 bool linkProgram(GLuint program);
1045 void registerUniformIfActive(const QShaderDescription::BlockVariable &var,
1046 const QByteArray &namePrefix, int binding, int baseOffset,
1047 GLuint program,
1048 ActiveUniformLocationTracker *activeUniformLocations,
1049 QGles2UniformDescriptionVector *dst);
1050 void gatherBlockMemberUniforms(GLuint program, const QByteArray &prefix, int binding,
1051 const QList<QShaderDescription::BlockVariable> &members,
1052 ActiveUniformLocationTracker *activeUniformLocations,
1053 QGles2UniformDescriptionVector *dst);
1054 void gatherUniforms(GLuint program, const QShaderDescription::UniformBlock &ub,
1055 ActiveUniformLocationTracker *activeUniformLocations, QGles2UniformDescriptionVector *dst);
1056 void gatherPushConstantUniforms(GLuint program, const QShaderDescription::PushConstantBlock &pcb,
1057 ActiveUniformLocationTracker *activeUniformLocations,
1058 QGles2UniformDescriptionVector *dst);
1059 void gatherSamplers(GLuint program, const QShaderDescription::InOutVariable &v,
1060 QGles2SamplerDescriptionVector *dst);
1061 void gatherGeneratedSamplers(GLuint program,
1062 const QShader::SeparateToCombinedImageSamplerMapping &mapping,
1063 QGles2SamplerDescriptionVector *dst);
1064 void sanityCheckVertexFragmentInterface(const QShaderDescription &vsDesc, const QShaderDescription &fsDesc);
1066
1072 ProgramCacheResult tryLoadFromDiskOrPipelineCache(const QRhiShaderStage *stages,
1073 int stageCount,
1074 GLuint program,
1075 const QVector<QShaderDescription::InOutVariable> &inputVars,
1076 QByteArray *cacheKey,
1077 std::optional<QShaderVersion> commonVersion = std::nullopt);
1078 void trySaveToDiskCache(GLuint program, const QByteArray &cacheKey);
1079 void trySaveToPipelineCache(GLuint program, const QByteArray &cacheKey, bool force = false);
1080
1083 bool importedContext = false;
1088 mutable bool needsMakeCurrentDueToSwap = false;
1089 QOpenGLExtensions *f = nullptr;
1092 const void *) = nullptr;
1095 const GLvoid *) = nullptr;
1097 GLsizei) = nullptr;
1099 const GLvoid *) = nullptr;
1101 GLsizei, const GLvoid *) = nullptr;
1103 GLint) = nullptr;
1105 GLint, GLsizei) = nullptr;
1108 GLenum, GLenum, const void *) = nullptr;
1110 void (QOPENGLF_APIENTRYP glObjectLabel)(GLenum, GLuint, GLsizei, const GLchar *) = nullptr;
1118 // Resolved when caps.baseInstance is true, left null otherwise.
1122 uint vao = 0;
1123 struct Caps {
1125 : ctxMajor(2),
1126 ctxMinor(0),
1127 maxTextureSize(2048),
1128 maxDrawBuffers(4),
1129 maxSamples(16),
1136 maxUniformVectors(4096),
1137 maxVertexInputs(8),
1141 msaaRenderBuffer(false),
1142 multisampledTexture(false),
1143 npotTextureFull(true),
1144 gles(false),
1146 bgraExternalFormat(false),
1147 bgraInternalFormat(false),
1148 r8Format(false),
1149 r16Format(false),
1150 r32uiFormat(false),
1151 floatFormats(false),
1152 rgb10Formats(false),
1153 depthTexture(false),
1154 packedDepthStencil(false),
1156 srgbTextureFormat(false),
1157 srgbGenerateMipmap(false),
1159 srgbWriteControl(false),
1160 coreProfile(false),
1161 vertexArrayObject(false),
1162 uniformBuffers(false),
1163 elementIndexUint(false),
1164 depth24(false),
1165 rgba8Format(false),
1166 instancing(false),
1167 baseVertex(false),
1168 baseInstance(false),
1169 compute(false),
1170 textureCompareMode(false),
1171 depthClamp(false),
1172 properMapBuffer(false),
1174 texelFetch(false),
1175 intAttributes(true),
1177 programBinary(false),
1178 texture3D(false),
1179 textureStorage(false),
1180 tessellation(false),
1181 geometryShader(false),
1182 texture1D(false),
1183 hasDrawBuffersFunc(false),
1184 halfAttributes(false),
1185 multiView(false),
1186 timestamps(false),
1187 objectLabel(false),
1190 unpackRowLength(false),
1192 dispatchIndirect(false),
1193 drawIndirectCount(false),
1194 copyBuffer(false),
1195 clearBuffer(false)
1196 { }
1213 // Multisample fb and blit are supported (GLES 3.0 or OpenGL 3.x). Not
1214 // the same as multisample textures!
1218 uint gles : 1;
1222 uint r8Format : 1;
1223 uint r16Format : 1;
1224 uint r32uiFormat : 1;
1234 uint coreProfile : 1;
1238 uint depth24 : 1;
1239 uint rgba8Format : 1;
1240 uint instancing : 1;
1241 uint baseVertex : 1;
1243 uint compute : 1;
1245 uint depthClamp : 1;
1248 uint texelFetch : 1;
1252 uint texture3D : 1;
1256 uint texture1D : 1;
1259 uint multiView : 1;
1260 uint timestamps : 1;
1261 uint objectLabel : 1;
1273 uint copyBuffer : 1;
1274 uint clearBuffer : 1;
1275 } caps;
1281 mutable bool contextLost = false;
1282 uint frameNo = 0;
1285
1295 union {
1296 struct {
1297 GLuint buffer;
1298 } buffer;
1299 struct {
1300 GLuint program;
1301 } pipeline;
1302 struct {
1303 GLuint texture;
1304 } texture;
1305 struct {
1306 GLuint renderbuffer;
1307 GLuint renderbuffer2;
1308 } renderbuffer;
1309 struct {
1310 GLuint framebuffer;
1311 GLuint nonMsaaThrowawayDepthTexture;
1312 } textureRenderTarget;
1313 };
1314 };
1316
1318 OffscreenFrame(QRhiImplementation *rhi) : cbWrapper(rhi) { }
1319 bool active = false;
1322 } ofr;
1323
1324 // Keyed by version too: it depends on the other stages of the program.
1326
1332
1352};
1353
1355
1357{
1358 return quint32(d.data.size());
1359}
1360
1361QT_END_NAMESPACE
1362
1363#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:1010
bool isEmpty() const
Definition qrhi_p.h:996
void execute(QRhiCommandBuffer *cb, quint32 firstCommand, quint32 commandCount)
Definition qrhi.cpp:9334
QRhiBufferBackedIndirectCommandBuffer(QRhiImplementation *rhi, Type type, quint32 maxCommandCount)
\variable QRhiIndirectCommandBufferBuildInfo::topology
Definition qrhi.cpp:9244
void enqueueUpload(QRhiResourceUpdateBatch *u)
Definition qrhi.cpp:9298
QRhiIndirectCommandBufferBuildInfo buildInfo
Definition qrhi_p.h:385
void build(const QRhiIndirectCommandBufferBuildInfo &info)
Definition qrhi.cpp:9321
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
Definition qrhi.cpp:9256
bool create() override
Creates the corresponding native objects.
Definition qrhi.cpp:9279
void swap(QRhiBufferData &other) noexcept
Definition qrhi_p.h:482
void assign(QByteArray data)
Definition qrhi_p.h:517
QRhiBufferData()=default
void assign(const char *s, quint32 size)
Definition qrhi_p.h:498
quint32 size() const
Definition qrhi_p.h:490
QRhiBufferData(const QRhiBufferData &other)
Definition qrhi_p.h:460
quint32 largeAlloc() const
Definition qrhi_p.h:494
QRhiBufferData(QRhiBufferData &&other) noexcept
Definition qrhi_p.h:466
QRhiBufferData & operator=(const QRhiBufferData &other)
Definition qrhi_p.h:471
const char * constData() const
Definition qrhi_p.h:486
const GLvoid const GLvoid GLenum
QRhiStats statistics() override
void releaseBufferNameCache()
bool contextLost
const QRhiNativeHandles * nativeHandles(QRhiCommandBuffer *cb) override
void drawIndexed(QRhiCommandBuffer *cb, quint32 indexCount, quint32 instanceCount, quint32 firstIndex, qint32 vertexOffset, quint32 firstInstance) override
QOpenGLContext * maybeShareContext
void gatherUniforms(GLuint program, const QShaderDescription::UniformBlock &ub, ActiveUniformLocationTracker *activeUniformLocations, QGles2UniformDescriptionVector *dst)
void trackedBufferBarrier(QGles2CommandBuffer *cbD, QGles2Buffer *bufD, QGles2Buffer::Access access)
void gatherBlockMemberUniforms(GLuint program, const QByteArray &prefix, int binding, const QList< QShaderDescription::BlockVariable > &members, ActiveUniformLocationTracker *activeUniformLocations, QGles2UniformDescriptionVector *dst)
QRhi::FrameOpResult beginFrame(QRhiSwapChain *swapChain, QRhi::BeginFrameFlags flags) override
const GLvoid GLenum
std::optional< QShaderVersion > commonGlslEsVersion(const QRhiShaderStage *stages, int stageCount) const
void enqueueBarriersForPass(QGles2CommandBuffer *cbD)
QList< DeferredReleaseEntry > releaseQueue
void drawIndirectCount(QRhiCommandBuffer *cb, QRhiBuffer *indirectBuffer, quint32 indirectBufferOffset, QRhiBuffer *countBuffer, quint32 countBufferOffset, quint32 maxDrawCount, quint32 stride) override
int resourceLimit(QRhi::ResourceLimit limit) const override
void setVertexInput(QRhiCommandBuffer *cb, int startBinding, int bindingCount, const QRhiCommandBuffer::VertexInput *bindings, QRhiBuffer *indexBuf, quint32 indexOffset, QRhiCommandBuffer::IndexFormat indexFormat) override
void(QOPENGLF_APIENTRYP glRenderbufferStorageMultisampleEXT)(GLenum
bool isFeatureSupported(QRhi::Feature feature) const override
static void setupUniformStateTracking(QGles2UniformDescriptionVector *uniforms, QGles2UniformDescriptionVector *pushConstantUniforms, QGles2UniformStateVector *uniformState)
QRhiGraphicsPipeline * createGraphicsPipeline() override
void bindShaderResources(QGles2CommandBuffer *cbD, QRhiGraphicsPipeline *maybeGraphicsPs, QRhiComputePipeline *maybeComputePs, QRhiShaderResourceBindings *srb, const uint *dynOfsPairs, int dynOfsCount)
bool create(QRhi::Flags flags) override
void trackedRegisterTexture(QRhiPassResourceTracker *passResTracker, QGles2Texture *texD, QRhiPassResourceTracker::TextureAccess access, QRhiPassResourceTracker::TextureStage stage)
void executeBindGraphicsPipeline(QGles2CommandBuffer *cbD, QGles2GraphicsPipeline *psD)
void dispatchIndirect(QRhiCommandBuffer *cb, QRhiBuffer *indirectBuffer, quint32 indirectBufferOffset) override
int bufferNameCacheCount
QRhiDriverInfo driverInfo() const override
QSurfaceFormat requestedFormat
bool isProgramBinaryDiskCacheEnabled() const
void(QOPENGLF_APIENTRYP glFramebufferTextureMultisampleMultiviewOVR)(GLenum
bool needsMakeCurrentDueToSwap
QRhiShadingRateMap * createShadingRateMap() override
const void quint64 GLuint
void setUniformsFromBlock(const QGles2UniformDescriptionVector &uniforms, int binding, const char *blockData, qint64 blockSize, quint32 blockOffset, QGles2UniformState *uniformState)
void trackedImageBarrier(QGles2CommandBuffer *cbD, QGles2Texture *texD, QGles2Texture::Access access)
QOpenGLExtensions * f
void trackedRegisterBuffer(QRhiPassResourceTracker *passResTracker, QGles2Buffer *bufD, QRhiPassResourceTracker::BufferAccess access, QRhiPassResourceTracker::BufferStage stage)
void setShadingRate(QRhiCommandBuffer *cb, const QSize &coarsePixelSize) override
void gatherPushConstantUniforms(GLuint program, const QShaderDescription::PushConstantBlock &pcb, ActiveUniformLocationTracker *activeUniformLocations, QGles2UniformDescriptionVector *dst)
QRhiComputePipeline * createComputePipeline() override
QRhiDriverInfo driverInfoStruct
QSurface * evaluateFallbackSurface() const
void resourceUpdate(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override
void sanityCheckVertexFragmentInterface(const QShaderDescription &vsDesc, const QShaderDescription &fsDesc)
QRhiGles2NativeHandles nativeHandlesStruct
QMatrix4x4 clipSpaceCorrMatrix() const override
QRhi::FrameOpResult finish() override
void setComputePipeline(QRhiCommandBuffer *cb, QRhiComputePipeline *ps) override
const void * void(QOPENGLF_APIENTRYP glGetQueryObjectui64v)(GLuint
void(QOPENGLF_APIENTRYP glMultiDrawArraysIndirect)(GLenum
QList< int > supportedSampleCounts() const override
void gatherSamplers(GLuint program, const QShaderDescription::InOutVariable &v, QGles2SamplerDescriptionVector *dst)
QSet< GLint > supportedCompressedFormats
void(QOPENGLF_APIENTRYP glMultiDrawElementsIndirectCount)(GLenum
static constexpr quint32 MAX_PUSH_CONSTANTS_SIZE
QRhiSwapChain * createSwapChain() override
GLuint genBuffer()
void dispatch(QRhiCommandBuffer *cb, int x, int y, int z) override
QRhiBinaryCache< QByteArray, PipelineCacheData > m_pipelineCache
void destroy() override
QRhiRenderBuffer * createRenderBuffer(QRhiRenderBuffer::Type type, const QSize &pixelSize, int sampleCount, QRhiRenderBuffer::Flags flags, QRhiTexture::Format backingFormatHint) override
void executeCommandBuffer(QRhiCommandBuffer *cb)
void setGraphicsPipeline(QRhiCommandBuffer *cb, QRhiGraphicsPipeline *ps) override
QList< QShaderVersion > glslVersionsToTry() const
QSurface * fallbackSurface
QRhiGles2(QRhiGles2InitParams *params, QRhiGles2NativeHandles *importDevice=nullptr)
QRhi::Flags rhiFlags
void trySaveToDiskCache(GLuint program, const QByteArray &cacheKey)
GLbitfield barriersForNextDispatch(QGles2CommandBuffer *cbD)
QList< QSize > supportedShadingRates(int sampleCount) const override
void drawIndexedIndirectCount(QRhiCommandBuffer *cb, QRhiBuffer *indirectBuffer, quint32 indirectBufferOffset, QRhiBuffer *countBuffer, quint32 countBufferOffset, quint32 maxDrawCount, quint32 stride) override
void(QOPENGLF_APIENTRYP glTexSubImage1D)(GLenum
const void GLuint
QRhiTexture * createTexture(QRhiTexture::Format format, const QSize &pixelSize, int depth, int arraySize, int sampleCount, QRhiTexture::Flags flags) override
void bindCombinedSampler(QGles2CommandBuffer *cbD, QGles2Texture *texD, QGles2Sampler *samplerD, void *ps, uint psGeneration, int glslLocation, int *texUnit, bool *activeTexUnitAltered)
void setViewport(QRhiCommandBuffer *cb, const QRhiViewport &viewport) override
QRhiTextureRenderTarget * createTextureRenderTarget(const QRhiTextureRenderTargetDescription &desc, QRhiTextureRenderTarget::Flags flags) override
QByteArray shaderSource(const QRhiShaderStage &shaderStage, QShaderVersion *shaderVersion, std::optional< QShaderVersion > commonVersion=std::nullopt)
void(QOPENGLF_APIENTRYP glMultiDrawElementsIndirect)(GLenum
QOpenGLContext * ctx
QRhiSampler * createSampler(QRhiSampler::Filter magFilter, QRhiSampler::Filter minFilter, QRhiSampler::Filter mipmapMode, QRhiSampler::AddressMode u, QRhiSampler::AddressMode v, QRhiSampler::AddressMode w) override
void beginPass(QRhiCommandBuffer *cb, QRhiRenderTarget *rt, const QColor &colorClearValue, const QRhiDepthStencilClearValue &depthStencilClearValue, QRhiResourceUpdateBatch *resourceUpdates, QRhiCommandBuffer::BeginPassFlags flags) override
QGles2SwapChain * currentSwapChain
bool isDeviceLost() const override
QRhiShaderResourceBindings * createShaderResourceBindings() override
void drawIndexedIndirect(QRhiCommandBuffer *cb, QRhiBuffer *indirectBuffer, quint32 indirectBufferOffset, quint32 drawCount, quint32 stride) override
void drawIndirect(QRhiCommandBuffer *cb, QRhiBuffer *indirectBuffer, quint32 indirectBufferOffset, quint32 drawCount, quint32 stride) override
bool isYUpInNDC() const override
void debugMarkBegin(QRhiCommandBuffer *cb, const QByteArray &name) override
void enqueueResourceUpdates(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates)
void setQueueSubmitParams(QRhiNativeHandles *params) override
std::array< GLuint, 8 > bufferNameCache
bool makeThreadLocalNativeContextCurrent() override
int ubufAlignment() const override
void beginExternal(QRhiCommandBuffer *cb) override
const GLvoid GLint
void endExternal(QRhiCommandBuffer *cb) override
bool isTextureFormatSupported(QRhiTexture::Format format, QRhiTexture::Flags flags) const override
ProgramCacheResult tryLoadFromDiskOrPipelineCache(const QRhiShaderStage *stages, int stageCount, GLuint program, const QVector< QShaderDescription::InOutVariable > &inputVars, QByteArray *cacheKey, std::optional< QShaderVersion > commonVersion=std::nullopt)
QRhiBuffer * createBuffer(QRhiBuffer::Type type, QRhiBuffer::UsageFlags usage, quint32 size) override
void(QOPENGLF_APIENTRYP glCompressedTexImage1D)(GLenum
bool importedContext
void(QOPENGLF_APIENTRYP glDrawElementsInstancedBaseVertexBaseInstance)(GLenum
void setScissor(QRhiCommandBuffer *cb, const QRhiScissor &scissor) override
void setUniformValue(const QGles2UniformDescription &uniform, const void *src, QGles2UniformState *uniformState)
void setStencilRef(QRhiCommandBuffer *cb, quint32 refValue) override
bool ensureContext(QSurface *surface=nullptr) const
void draw(QRhiCommandBuffer *cb, quint32 vertexCount, quint32 instanceCount, quint32 firstVertex, quint32 firstInstance) override
void endComputePass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override
void(QOPENGLF_APIENTRYP glQueryCounter)(GLuint
QHash< std::pair< QRhiShaderStage, QShaderVersion >, uint > m_shaderCache
void(QOPENGLF_APIENTRYP glDrawArraysInstancedBaseInstance)(GLenum
void beginComputePass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates, QRhiCommandBuffer::BeginPassFlags flags) override
void endPass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override
bool isYUpInFramebuffer() const override
bool linkProgram(GLuint program)
void debugMarkMsg(QRhiCommandBuffer *cb, const QByteArray &msg) override
QGles2RenderTargetData * enqueueBindFramebuffer(QRhiRenderTarget *rt, QGles2CommandBuffer *cbD, bool *wantsColorClear=nullptr, bool *wantsDsClear=nullptr)
void debugMarkEnd(QRhiCommandBuffer *cb) override
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:848
value_type * iterator
Definition qrhi_p.h:844
const value_type * const_iterator
Definition qrhi_p.h:845
bool isEmpty() const
Definition qrhi_p.h:854
iterator find(Key key)
Definition qrhi_p.h:873
const_iterator end() const
Definition qrhi_p.h:850
void append(Key key, const T &value)
Definition qrhi_p.h:882
const_iterator find(Key key) const
Definition qrhi_p.h:863
qsizetype size() const
Definition qrhi_p.h:855
std::pair< Key, T > value_type
Definition qrhi_p.h:843
const_iterator begin() const
Definition qrhi_p.h:849
bool contains(Key key) const
Definition qrhi_p.h:879
const_iterator cend() const
Definition qrhi_p.h:852
iterator begin()
Definition qrhi_p.h:847
const_iterator cbegin() const
Definition qrhi_p.h:851
static TextureStage toPassTrackerTextureStage(QRhiShaderResourceBinding::StageFlags stages)
Definition qrhi.cpp:13767
static BufferStage toPassTrackerBufferStage(QRhiShaderResourceBinding::StageFlags stages)
Definition qrhi.cpp:13748
bool isEmpty() const
Definition qrhi.cpp:13657
const QRhiPassResourceMap< QRhiTexture *, Texture, 12 > & textures() const
Definition qrhi_p.h:976
void registerBuffer(QRhiBuffer *buf, int slot, BufferAccess *access, BufferStage *stage, const UsageState &state)
Definition qrhi.cpp:13674
void registerTexture(QRhiTexture *tex, TextureAccess *access, TextureStage *stage, const UsageState &state)
Definition qrhi.cpp:13714
const QRhiPassResourceMap< QRhiBuffer *, Buffer, 12 > & buffers() const
Definition qrhi_p.h:968
QRhiPipelineCacheDataReader(const char *data, quint32 size)
Definition qrhi_p.h:1109
bool readByteArray(QByteArray *dst)
Definition qrhi_p.h:1124
bool readUInt32(quint32 *dst)
Definition qrhi_p.h:1114
QVarLengthArray< BufferOp, BUFFER_OPS_STATIC_ALLOC > bufferOps
Definition qrhi_p.h:739
QRhiImplementation * rhi
Definition qrhi_p.h:746
QVarLengthArray< TextureOp, TEXTURE_OPS_STATIC_ALLOC > textureOps
Definition qrhi_p.h:743
static const int BUFFER_OPS_STATIC_ALLOC
Definition qrhi_p.h:738
static QRhiResourceUpdateBatchPrivate * get(QRhiResourceUpdateBatch *b)
Definition qrhi_p.h:754
void merge(QRhiResourceUpdateBatchPrivate *other)
Definition qrhi.cpp:11425
QRhiResourceUpdateBatch * q
Definition qrhi_p.h:745
static const int TEXTURE_OPS_STATIC_ALLOC
Definition qrhi_p.h:742
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:9495
static QRhiPassResourceTracker::BufferStage earlierStage(QRhiPassResourceTracker::BufferStage a, QRhiPassResourceTracker::BufferStage b)
Definition qrhi.cpp:13668
QDebug operator<<(QDebug dbg, const QRhiSwapChainHdrInfo &info)
Definition qrhi.cpp:8547
static bool isImageLoadStore(QRhiPassResourceTracker::TextureAccess access)
Definition qrhi.cpp:13707
static const char * deviceTypeStr(QRhiDriverInfo::DeviceType type)
\variable QRhiDriverInfo::deviceName
Definition qrhi.cpp:10478
static auto & emplaceData(QRhiShaderResourceBinding::Data &d)
Definition qrhi.cpp:6212
static QRhiPassResourceTracker::TextureStage earlierStage(QRhiPassResourceTracker::TextureStage a, QRhiPassResourceTracker::TextureStage b)
Definition qrhi.cpp:13701
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:1098
bool operator!=(const QRhiRenderTargetAttachmentTracker::ResId &a, const QRhiRenderTargetAttachmentTracker::ResId &b)
Definition qrhi_p.h:1038
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:1033
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)
bool isLevelAllocated(int face, int level) const
QGles2SamplerData samplerState
GLenum glsizedintformat
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
UsageState usageState
bool prepareCreate(QSize *adjustedSize=nullptr)
GLenum glintformat
quint32 allocatedLevels[6]
bool create() override
Creates the corresponding native graphics resources.
NativeTexture nativeTexture() override
char * data
Definition qrhinull_p.h:31
QNullBuffer(QRhiImplementation *rhi, Type type, UsageFlags usage, quint32 size)
Definition qrhinull.cpp: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:794
QVector< T > resources
Definition qrhi_p.h:787
bool operator==(const Batch &other) const
Definition qrhi_p.h:789
void feed(int binding, T resource)
Definition qrhi_p.h:760
QVector< Batch > batches
Definition qrhi_p.h:803
bool operator!=(const QRhiBatchedBindings< T > &other) const
Definition qrhi_p.h:810
bool operator==(const QRhiBatchedBindings< T > &other) const
Definition qrhi_p.h:805
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:1044
static bool isUpToDate(const QRhiTextureRenderTargetDescription &desc, const ResIdList &currentResIdList)
Definition qrhi_p.h:1082
static void changeToDynamicUpdate(BufferOp *op, QRhiBuffer *buf, quint32 offset, QByteArray data)
Definition qrhi_p.h:584
static void changeToStaticUpload(BufferOp *op, QRhiBuffer *buf, quint32 offset, QByteArray data)
Definition qrhi_p.h:615
static BufferOp clear(QRhiBuffer *buf, quint32 offset, quint32 size, quint8 value)
Definition qrhi_p.h:647
static void changeToStaticUpload(BufferOp *op, QRhiBuffer *buf, quint32 offset, quint32 size, const void *data)
Definition qrhi_p.h:599
static BufferOp dynamicUpdate(QRhiBuffer *buf, quint32 offset, QByteArray data)
Definition qrhi_p.h:577
static BufferOp staticUpload(QRhiBuffer *buf, quint32 offset, QByteArray data)
Definition qrhi_p.h:608
static BufferOp copy(QRhiBuffer *dst, QRhiBuffer *src, quint32 dstOffset, quint32 srcOffset, quint32 size)
Definition qrhi_p.h:634
static BufferOp staticUpload(QRhiBuffer *buf, quint32 offset, quint32 size, const void *data)
Definition qrhi_p.h:592
static BufferOp read(QRhiBuffer *buf, quint32 offset, quint32 size, QRhiReadbackResult *result)
Definition qrhi_p.h:623
static BufferOp dynamicUpdate(QRhiBuffer *buf, quint32 offset, quint32 size, const void *data)
Definition qrhi_p.h:561
static void changeToDynamicUpdate(BufferOp *op, QRhiBuffer *buf, quint32 offset, quint32 size, const void *data)
Definition qrhi_p.h:568
QRhiTextureSubresourceUploadDescription desc
Definition qrhi_p.h:687
QRhiTextureCopyDescription desc
Definition qrhi_p.h:691
static TextureOp copy(QRhiTexture *dst, QRhiTexture *src, const QRhiTextureCopyDescription &desc)
Definition qrhi_p.h:709
QVarLengthArray< SubresourceUpload, 4 > subresDesc
Definition qrhi_p.h:689
static TextureOp upload(QRhiTexture *tex, const QRhiTextureUploadDescription &desc)
Definition qrhi_p.h:695
static TextureOp genMips(QRhiTexture *tex)
Definition qrhi_p.h:728
static TextureOp read(const QRhiReadbackDescription &rb, QRhiReadbackResult *result)
Definition qrhi_p.h:719
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
Definition qrhi.h:1616
LimitsType limitsType
Definition qrhi.h:1627
LuminanceBehavior luminanceBehavior
Definition qrhi.h:1638
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
Definition qrhi.h:1649
void * reserved[2]
Definition qrhi.h:1650