Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qssgrhicontext.h
Go to the documentation of this file.
1// Copyright (C) 2019 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef QSSGRHICONTEXT_H
5#define QSSGRHICONTEXT_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is part of the QtQuick3D API, with limited compatibility guarantees.
12// Usage of this API may make your code source and binary incompatible with
13// future versions of Qt.
14//
15
16#include <QtCore/qstack.h>
17#include <rhi/qrhi.h>
18
19#include <QtQuick3DRuntimeRender/qtquick3druntimerenderexports.h>
20
22
25
27{
28public:
29 enum class Flag : quint32
30 {
31 DepthTestEnabled = 0x1,
33 BlendEnabled = 0x4,
34 UsesStencilRef = 0x8,
35 UsesScissor = 0x10
36 };
38
46 int depthBias = 0;
47 int samples = 1;
49 int viewCount = 1;
51 float lineWidth = 1.0f;
55
56private:
59 struct InputAssemblerState
60 {
61 enum InputSemantic {
62 PositionSemantic, // attr_pos
63 NormalSemantic, // attr_norm
64 TexCoord0Semantic, // attr_uv0
65 TexCoord1Semantic, // attr_uv1
66 TangentSemantic, // attr_textan
67 BinormalSemantic, // attr_binormal
68 ColorSemantic, // attr_color
69 MaxTargetSemantic = ColorSemantic,
70 JointSemantic, // attr_joints
71 WeightSemantic, // attr_weights
72 TexCoordLightmapSemantic // attr_lightmapuv
73 };
74
75 QRhiVertexInputLayout inputLayout;
76 QVarLengthArray<InputSemantic, 8> inputs;
78 std::array<quint8, MaxTargetSemantic + 1> targetOffsets = { UINT8_MAX, UINT8_MAX, UINT8_MAX, UINT8_MAX,
79 UINT8_MAX, UINT8_MAX, UINT8_MAX };
80 quint8 targetCount = 0;
81 } ia;
82
83 // for internal use
84 const QSSGRhiShaderPipeline *shaderPipeline = nullptr;
85};
86
96
97class Q_QUICK3DRUNTIMERENDER_EXPORT QSSGRhiContext
98{
99 Q_DISABLE_COPY(QSSGRhiContext)
100public:
101 explicit QSSGRhiContext(QRhi *rhi);
103
104 QRhi *rhi() const;
105 bool isValid() const;
106
107 QRhiRenderPassDescriptor *mainRenderPassDescriptor() const;
108 QRhiCommandBuffer *commandBuffer() const;
109 QRhiRenderTarget *renderTarget() const;
110 int mainPassSampleCount() const;
111 int mainPassViewCount() const;
112
113 QRhiSampler *sampler(const QSSGRhiSamplerDescription &samplerDescription);
114 void checkAndAdjustForNPoT(QRhiTexture *texture, QSSGRhiSamplerDescription *samplerDescription);
115 QRhiTexture *dummyTexture(QRhiTexture::Flags flags, QRhiResourceUpdateBatch *rub,
116 const QSize &size = QSize(64, 64), const QColor &fillColor = Qt::black,
117 int arraySize = 0);
118
119 QRhiCommandBuffer::BeginPassFlags commonPassFlags() const;
120
121private:
122 Q_DECLARE_PRIVATE(QSSGRhiContext)
123 std::unique_ptr<QSSGRhiContextPrivate> d_ptr;
124};
125
127
128#endif
The QColor class provides colors based on RGB, HSV or CMYK values.
Definition qcolor.h:31
\inmodule QtGui
Definition qrhi.h:1651
\inmodule QtGui
Definition qrhi.h:1270
Topology
Specifies the primitive topology.
Definition qrhi.h:1280
\inmodule QtGui
Definition qrhi.h:1142
\inmodule QtGui
Definition qrhi.h:1158
\inmodule QtGui
Definition qrhi.h:1731
\inmodule QtGui
Definition qrhi.h:1030
Filter
Specifies the minification, magnification, or mipmap filtering.
Definition qrhi.h:1032
AddressMode
Specifies the addressing mode.
Definition qrhi.h:1038
\inmodule QtGui
Definition qrhi.h:138
\inmodule QtGui
Definition qrhi.h:895
\inmodule QtGui
Definition qrhi.h:321
\inmodule QtGui
Definition qrhi.h:85
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
Definition qrhi.h:1804
\inmodule QtQuick3D
QRhiGraphicsPipeline::CullMode cullMode
Flag
\variable QSSGRhiGraphicsPipelineState::samples
QRhiGraphicsPipeline::TargetBlend targetBlend
QRhiGraphicsPipeline::StencilOpState stencilOpFrontState
QRhiGraphicsPipeline::PolygonMode polygonMode
QRhiGraphicsPipeline::CompareOp depthFunc
\inmodule QtCore
Definition qsize.h:25
Combined button and popup list for selecting options.
@ black
Definition qnamespace.h:30
#define Q_DECLARE_FLAGS(Flags, Enum)
Definition qflags.h:174
Flags
@ None
Definition qhash.cpp:531
GLsizei samples
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLuint sampler
GLbitfield flags
GLenum GLuint texture
unsigned int quint32
Definition qtypes.h:50
unsigned char quint8
Definition qtypes.h:46
\variable QSSGRhiGraphicsPipelineState::depthFunc
QRhiSampler::AddressMode hTiling
QRhiSampler::Filter minFilter
QRhiSampler::Filter magFilter
QRhiSampler::AddressMode vTiling
QRhiSampler::Filter mipmap
QRhiSampler::AddressMode zTiling