16#include <QtGui/qtguiglobal.h>
17#include <QtCore/qhash.h>
18#include <QtCore/qmap.h>
19#include <rhi/qshaderdescription.h>
28 size_t qHash(
const QShaderVersion &, size_t = 0)
noexcept;
37 Q_DECLARE_FLAGS(Flags, Flag)
39 QShaderVersion() =
default;
40 QShaderVersion(
int v, Flags f = Flags());
42 int version()
const {
return m_version; }
43 void setVersion(
int v) { m_version = v; }
45 Flags flags()
const {
return m_flags; }
46 void setFlags(Flags f) { m_flags = f; }
53Q_DECLARE_OPERATORS_FOR_FLAGS(QShaderVersion::Flags)
54Q_DECLARE_TYPEINFO(QShaderVersion, Q_RELOCATABLE_TYPE);
57Q_GUI_EXPORT size_t qHash(
const QShaderCode &, size_t = 0)
noexcept;
62 QShaderCode() =
default;
63 QShaderCode(
const QByteArray &code,
const QByteArray &entry = QByteArray());
65 QByteArray shader()
const {
return m_shader; }
66 void setShader(
const QByteArray &code) { m_shader = code; }
68 QByteArray entryPoint()
const {
return m_entryPoint; }
69 void setEntryPoint(
const QByteArray &entry) { m_entryPoint = entry; }
72 friend Q_GUI_EXPORT size_t qHash(
const QShaderCode &, size_t)
noexcept;
75 QByteArray m_entryPoint;
85 TessellationControlStage,
86 TessellationEvaluationStage,
105 BatchableVertexShader,
106 UInt16IndexedVertexAsComputeShader,
107 UInt32IndexedVertexAsComputeShader,
108 NonIndexedVertexAsComputeShader,
109 HdrCapableFragmentShader,
112 enum class SerializedFormatVersion {
119 QShader(
const QShader &other);
120 QShader &operator=(
const QShader &other);
121 QShader(QShader &&other)
noexcept : d(std::exchange(other.d,
nullptr)) {}
122 QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(QShader)
125 void swap(QShader &other)
noexcept { qt_ptr_swap(d, other.d); }
128 bool isValid()
const;
131 void setStage(Stage stage);
133 QShaderDescription description()
const;
134 void setDescription(
const QShaderDescription &desc);
136 QList<QShaderKey> availableShaders()
const;
137 QShaderCode shader(
const QShaderKey &key)
const;
138 void setShader(
const QShaderKey &key,
const QShaderCode &shader);
139 void removeShader(
const QShaderKey &key);
141 QByteArray serialized(SerializedFormatVersion version = SerializedFormatVersion::Latest)
const;
142 static QShader fromSerialized(
const QByteArray &data);
144 using NativeResourceBindingMap = QMap<
int, std::pair<
int,
int>>;
145 NativeResourceBindingMap nativeResourceBindingMap(
const QShaderKey &key)
const;
146 void setResourceBindingMap(
const QShaderKey &key,
const NativeResourceBindingMap &map);
147 void removeResourceBindingMap(
const QShaderKey &key);
149 struct SeparateToCombinedImageSamplerMapping {
150 QByteArray combinedSamplerName;
154 using SeparateToCombinedImageSamplerMappingList = QList<SeparateToCombinedImageSamplerMapping>;
155 SeparateToCombinedImageSamplerMappingList separateToCombinedImageSamplerMappingList(
const QShaderKey &key)
const;
156 void setSeparateToCombinedImageSamplerMappingList(
const QShaderKey &key,
157 const SeparateToCombinedImageSamplerMappingList &list);
158 void removeSeparateToCombinedImageSamplerMappingList(
const QShaderKey &key);
160 struct NativeShaderInfo {
162 QMap<
int,
int> extraBufferBindings;
164 NativeShaderInfo nativeShaderInfo(
const QShaderKey &key)
const;
165 void setNativeShaderInfo(
const QShaderKey &key,
const NativeShaderInfo &info);
166 void removeNativeShaderInfo(
const QShaderKey &key);
170 friend struct QShaderPrivate;
171 friend Q_GUI_EXPORT
bool operator==(
const QShader &,
const QShader &)
noexcept;
172 friend Q_GUI_EXPORT size_t qHash(
const QShader &, size_t)
noexcept;
173#ifndef QT_NO_DEBUG_STREAM
174 friend Q_GUI_EXPORT QDebug operator<<(QDebug,
const QShader &);
181 QShaderKey() =
default;
182 QShaderKey(QShader::Source s,
183 const QShaderVersion &sver,
184 QShader::Variant svar = QShader::StandardShader);
186 QShader::Source source()
const {
return m_source; }
187 void setSource(QShader::Source s) { m_source = s; }
189 QShaderVersion sourceVersion()
const {
return m_sourceVersion; }
190 void setSourceVersion(
const QShaderVersion &sver) { m_sourceVersion = sver; }
192 QShader::Variant sourceVariant()
const {
return m_sourceVariant; }
193 void setSourceVariant(QShader::Variant svar) { m_sourceVariant = svar; }
196 QShader::Source m_source = QShader::SpirvShader;
197 QShaderVersion m_sourceVersion;
198 QShader::Variant m_sourceVariant = QShader::StandardShader;
203Q_GUI_EXPORT
bool operator==(
const QShader &lhs,
const QShader &rhs)
noexcept;
204Q_GUI_EXPORT size_t qHash(
const QShader &s, size_t seed = 0)
noexcept;
206inline bool operator!=(
const QShader &lhs,
const QShader &rhs)
noexcept
208 return !(lhs == rhs);
211Q_GUI_EXPORT
bool operator==(
const QShaderVersion &lhs,
const QShaderVersion &rhs)
noexcept;
212Q_GUI_EXPORT
bool operator<(
const QShaderVersion &lhs,
const QShaderVersion &rhs)
noexcept;
213Q_GUI_EXPORT
bool operator==(
const QShaderKey &lhs,
const QShaderKey &rhs)
noexcept;
214Q_GUI_EXPORT
bool operator<(
const QShaderKey &lhs,
const QShaderKey &rhs)
noexcept;
215Q_GUI_EXPORT
bool operator==(
const QShaderCode &lhs,
const QShaderCode &rhs)
noexcept;
217inline bool operator!=(
const QShaderVersion &lhs,
const QShaderVersion &rhs)
noexcept
219 return !(lhs == rhs);
222inline bool operator!=(
const QShaderKey &lhs,
const QShaderKey &rhs)
noexcept
224 return !(lhs == rhs);
227inline bool operator!=(
const QShaderCode &lhs,
const QShaderCode &rhs)
noexcept
229 return !(lhs == rhs);
232Q_GUI_EXPORT size_t qHash(
const QShaderKey &k, size_t seed = 0)
noexcept;
234#ifndef QT_NO_DEBUG_STREAM
235Q_GUI_EXPORT
QDebug operator<<(QDebug,
const QShader &);
236Q_GUI_EXPORT
QDebug operator<<(QDebug dbg,
const QShaderKey &k);
237Q_GUI_EXPORT
QDebug operator<<(QDebug dbg,
const QShaderVersion &v);
friend bool operator==(const QByteArray::FromBase64Result &lhs, const QByteArray::FromBase64Result &rhs) noexcept
Returns true if lhs and rhs are equal, otherwise returns false.
friend bool operator!=(const QByteArray::FromBase64Result &lhs, const QByteArray::FromBase64Result &rhs) noexcept
Returns true if lhs and rhs are different, otherwise returns false.
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
Q_DECLARE_TYPEINFO(QByteArrayView, Q_PRIMITIVE_TYPE)
Q_CORE_EXPORT QDebug operator<<(QDebug debug, QDir::Filters filters)
bool operator<(const QElapsedTimer &lhs, const QElapsedTimer &rhs) noexcept
Q_DECLARE_TYPEINFO(QRhiSwapChainHdrInfo, Q_RELOCATABLE_TYPE)
Q_DECLARE_TYPEINFO(QShaderKey, Q_RELOCATABLE_TYPE)
Q_DECLARE_TYPEINFO(QShaderCode, Q_RELOCATABLE_TYPE)
Q_GUI_EXPORT bool operator==(const QShaderKey &lhs, const QShaderKey &rhs) noexcept
bool operator!=(const QShaderCode &lhs, const QShaderCode &rhs) noexcept
Q_GUI_EXPORT bool operator==(const QShaderCode &lhs, const QShaderCode &rhs) noexcept
bool operator!=(const QShaderKey &lhs, const QShaderKey &rhs) noexcept
Q_GUI_EXPORT bool operator<(const QShaderKey &lhs, const QShaderKey &rhs) noexcept
int main(int argc, char *argv[])
[ctor_close]
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
\variable QRhiReadbackResult::completed
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
LuminanceBehavior
\value SceneReferred Indicates that the color value of 1.0 is interpreted as 80 nits.
float maxPotentialColorComponentValue
LimitsType
\value LuminanceInNits Indicates that the \l limits union has its luminanceInNits struct set
LuminanceBehavior luminanceBehavior
float maxColorComponentValue
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h