17#include <QtGui/qtguiglobal.h>
18#include <QtCore/qhash.h>
19#include <QtCore/qmap.h>
20#include <rhi/qshaderdescription.h>
29 size_t qHash(
const QShaderVersion &, size_t = 0)
noexcept;
38 Q_DECLARE_FLAGS(Flags, Flag)
40 QShaderVersion() =
default;
41 QShaderVersion(
int v, Flags f = Flags());
43 int version()
const {
return m_version; }
44 void setVersion(
int v) { m_version = v; }
46 Flags flags()
const {
return m_flags; }
47 void setFlags(Flags f) { m_flags = f; }
54Q_DECLARE_OPERATORS_FOR_FLAGS(QShaderVersion::Flags)
55Q_DECLARE_TYPEINFO(QShaderVersion, Q_RELOCATABLE_TYPE);
58Q_GUI_EXPORT size_t qHash(
const QShaderCode &, size_t = 0)
noexcept;
63 QShaderCode() =
default;
64 QShaderCode(
const QByteArray &code,
const QByteArray &entry = QByteArray());
66 QByteArray shader()
const {
return m_shader; }
67 void setShader(
const QByteArray &code) { m_shader = code; }
69 QByteArray entryPoint()
const {
return m_entryPoint; }
70 void setEntryPoint(
const QByteArray &entry) { m_entryPoint = entry; }
73 friend Q_GUI_EXPORT size_t qHash(
const QShaderCode &, size_t)
noexcept;
76 QByteArray m_entryPoint;
86 TessellationControlStage,
87 TessellationEvaluationStage,
106 BatchableVertexShader,
107 UInt16IndexedVertexAsComputeShader,
108 UInt32IndexedVertexAsComputeShader,
109 NonIndexedVertexAsComputeShader,
110 HdrCapableFragmentShader,
113 enum class SerializedFormatVersion {
120 QShader(
const QShader &other);
121 QShader &operator=(
const QShader &other);
122 QShader(QShader &&other)
noexcept : d(std::exchange(other.d,
nullptr)) {}
123 QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(QShader)
126 void swap(QShader &other)
noexcept { qt_ptr_swap(d, other.d); }
129 bool isValid()
const;
132 void setStage(Stage stage);
134 QShaderDescription description()
const;
135 void setDescription(
const QShaderDescription &desc);
137 QList<QShaderKey> availableShaders()
const;
138 QShaderCode shader(
const QShaderKey &key)
const;
139 void setShader(
const QShaderKey &key,
const QShaderCode &shader);
140 void removeShader(
const QShaderKey &key);
142 QByteArray serialized(SerializedFormatVersion version = SerializedFormatVersion::Latest)
const;
143 static QShader fromSerialized(
const QByteArray &data);
145 using NativeResourceBindingMap = QMap<
int, std::pair<
int,
int>>;
146 NativeResourceBindingMap nativeResourceBindingMap(
const QShaderKey &key)
const;
147 void setResourceBindingMap(
const QShaderKey &key,
const NativeResourceBindingMap &map);
148 void removeResourceBindingMap(
const QShaderKey &key);
150 struct SeparateToCombinedImageSamplerMapping {
151 QByteArray combinedSamplerName;
155 using SeparateToCombinedImageSamplerMappingList = QList<SeparateToCombinedImageSamplerMapping>;
156 SeparateToCombinedImageSamplerMappingList separateToCombinedImageSamplerMappingList(
const QShaderKey &key)
const;
157 void setSeparateToCombinedImageSamplerMappingList(
const QShaderKey &key,
158 const SeparateToCombinedImageSamplerMappingList &list);
159 void removeSeparateToCombinedImageSamplerMappingList(
const QShaderKey &key);
161 struct NativeShaderInfo {
163 QMap<
int,
int> extraBufferBindings;
165 NativeShaderInfo nativeShaderInfo(
const QShaderKey &key)
const;
166 void setNativeShaderInfo(
const QShaderKey &key,
const NativeShaderInfo &info);
167 void removeNativeShaderInfo(
const QShaderKey &key);
171 friend struct QShaderPrivate;
172 friend Q_GUI_EXPORT
bool operator==(
const QShader &,
const QShader &)
noexcept;
173 friend Q_GUI_EXPORT size_t qHash(
const QShader &, size_t)
noexcept;
174#ifndef QT_NO_DEBUG_STREAM
175 friend Q_GUI_EXPORT QDebug operator<<(QDebug,
const QShader &);
184 QShaderKey() =
default;
185 QShaderKey(QShader::Source s,
186 const QShaderVersion &sver,
187 QShader::Variant svar = QShader::StandardShader);
189 QShader::Source source()
const {
return m_source; }
190 void setSource(QShader::Source s) { m_source = s; }
192 QShaderVersion sourceVersion()
const {
return m_sourceVersion; }
193 void setSourceVersion(
const QShaderVersion &sver) { m_sourceVersion = sver; }
195 QShader::Variant sourceVariant()
const {
return m_sourceVariant; }
196 void setSourceVariant(QShader::Variant svar) { m_sourceVariant = svar; }
199 QShader::Source m_source = QShader::SpirvShader;
200 QShaderVersion m_sourceVersion;
201 QShader::Variant m_sourceVariant = QShader::StandardShader;
206Q_GUI_EXPORT
bool operator==(
const QShader &lhs,
const QShader &rhs)
noexcept;
207Q_GUI_EXPORT size_t qHash(
const QShader &s, size_t seed = 0)
noexcept;
209inline bool operator!=(
const QShader &lhs,
const QShader &rhs)
noexcept
211 return !(lhs == rhs);
214Q_GUI_EXPORT
bool operator==(
const QShaderVersion &lhs,
const QShaderVersion &rhs)
noexcept;
215Q_GUI_EXPORT
bool operator<(
const QShaderVersion &lhs,
const QShaderVersion &rhs)
noexcept;
216Q_GUI_EXPORT
bool operator==(
const QShaderKey &lhs,
const QShaderKey &rhs)
noexcept;
217Q_GUI_EXPORT
bool operator<(
const QShaderKey &lhs,
const QShaderKey &rhs)
noexcept;
218Q_GUI_EXPORT
bool operator==(
const QShaderCode &lhs,
const QShaderCode &rhs)
noexcept;
220inline bool operator!=(
const QShaderVersion &lhs,
const QShaderVersion &rhs)
noexcept
222 return !(lhs == rhs);
225inline bool operator!=(
const QShaderKey &lhs,
const QShaderKey &rhs)
noexcept
227 return !(lhs == rhs);
230inline bool operator!=(
const QShaderCode &lhs,
const QShaderCode &rhs)
noexcept
232 return !(lhs == rhs);
235Q_GUI_EXPORT size_t qHash(
const QShaderKey &k, size_t seed = 0)
noexcept;
237#ifndef QT_NO_DEBUG_STREAM
238Q_GUI_EXPORT
QDebug operator<<(QDebug,
const QShader &);
239Q_GUI_EXPORT
QDebug operator<<(QDebug dbg,
const QShaderKey &k);
240Q_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
Combined button and popup list for selecting options.
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