41 #include <QDataStream>
377 writeShaderKey(&ds, k);
380 ds <<
shader.entryPoint();
385 writeShaderKey(&ds, k);
388 for (
auto mapIt =
map.
cbegin(), mapItEnd =
map.
cend(); mapIt != mapItEnd; ++mapIt) {
390 ds << mapIt.value().first;
391 ds << mapIt.value().second;
432 d->qsbVersion = intVal;
439 qWarning(
"Attempted to deserialize QShader with unknown version %d.",
d->qsbVersion);
448 qWarning(
"Can no longer load QShaderDescription from CBOR.");
451 qWarning(
"Can no longer load QShaderDescription from binary JSON.");
458 readShaderKey(&ds, &k);
472 readShaderKey(&ds, &k);
476 for (
int b = 0;
b < mapSize; ++
b) {
479 int firstNativeBinding;
480 ds >> firstNativeBinding;
481 int secondNativeBinding;
482 ds >> secondNativeBinding;
483 map.
insert(binding, { firstNativeBinding, secondNativeBinding });
485 d->bindings.insert(k,
map);
493 : m_version(
v), m_flags(
f)
506 m_sourceVersion(sver),
507 m_sourceVariant(svar)
520 return lhs.d->stage ==
rhs.d->stage
521 && lhs.d->shaders ==
rhs.d->shaders;
543 seed =
hash(seed,
s.stage());
545 s.d->shaders.keyValueEnd(),
558 return lhs.version() ==
rhs.version() && lhs.flags() ==
rhs.flags();
561 #ifdef Q_OS_INTEGRITY
585 return lhs.source() ==
rhs.source() && lhs.sourceVersion() ==
rhs.sourceVersion()
586 && lhs.sourceVariant() ==
rhs.sourceVariant();
620 return lhs.shader() ==
rhs.shader() && lhs.entryPoint() ==
rhs.entryPoint();
640 return qHash(k.shader(), seed);
643 #ifndef QT_NO_DEBUG_STREAM
650 <<
"stage=" <<
d->stage
651 <<
" shaders=" <<
d->shaders.keys()
652 <<
" desc.isValid=" <<
d->desc.isValid()
670 dbg.
nospace() <<
"Version(" <<
v.version() <<
" " <<
v.flags() <<
")";
small capitals from c petite p scientific i
[1]
The QBuffer class provides a QIODevice interface for a QByteArray.
The QByteArray class provides an array of bytes.
The QDataStream class provides serialization of binary data to a QIODevice.
operator<<(QDataStream &ds, qfloat16 f)
The QDebug class provides an output stream for debugging information.
Convenience class for custom QDebug operators.
template< typename Enum > size_t qHash(QFlags< Enum > flags, size_t seed=0) noexcept
template< typename Enum > bool operator==(Enum lhs, QFlags< Enum > rhs)
template< typename InputIterator > size_t qHashRange(InputIterator first, InputIterator last, size_t seed=0)
const_iterator cbegin() const noexcept
iterator find(const Key &key)
QList< Key > keys() const
iterator erase(const_iterator it)
T value(const Key &key) const noexcept
const_iterator cend() const noexcept
template< typename... T > size_t qHashMulti(size_t seed, const T &...args)
qsizetype count(const Key &key) const noexcept
bool isEmpty() const noexcept
iterator insert(const Key &key, const T &value)
size_type count(const Key &key) const
const_iterator cend() const
const_iterator cbegin() const
bool operator==(const QShaderCode &lhs, const QShaderCode &rhs) noexcept
static QShaderDescription deserialize(QDataStream *stream, int version)
void serialize(QDataStream *stream) const
void removeResourceBindingMap(const QShaderKey &key)
QShaderCode shader(const QShaderKey &key) const
QList< QShaderKey > availableShaders() const
QShader & operator=(const QShader &other)
QByteArray serialized() const
static QShader fromSerialized(const QByteArray &data)
void removeShader(const QShaderKey &key)
void setShader(const QShaderKey &key, const QShaderCode &shader)
void setResourceBindingMap(const QShaderKey &key, const NativeResourceBindingMap &map)
const NativeResourceBindingMap * nativeResourceBindingMap(const QShaderKey &key) const
QShaderDescription description() const
void setDescription(const QShaderDescription &desc)
void setStage(Stage stage)
size_t qHash(const QShaderKey &k, size_t seed) noexcept
void setSource(QShader::Source s)
void setSourceVariant(QShader::Variant svar)
void setSourceVersion(const QShaderVersion &sver)
QShader::Source source() const
QShaderVersion sourceVersion() const
QShader::Variant sourceVariant() const
bool operator==(const QShaderKey &lhs, const QShaderKey &rhs) noexcept
bool operator==(const QShaderVersion &lhs, const QShaderVersion &rhs) noexcept
QHash< int, QWidget * > hash
[35multi]
QMap< QString, QString > map
[6]
QT_WARNING_POP void qAtomicAssign(T *&d, T *x)
void qAtomicDetach(T *&d)
Q_CORE_EXPORT QByteArray qCompress(const uchar *data, qsizetype nbytes, int compressionLevel=-1)
Q_CORE_EXPORT QByteArray qUncompress(const uchar *data, qsizetype nbytes)
typedef QByteArray(EGLAPIENTRYP PFNQGSGETDISPLAYSPROC)()
GLboolean GLboolean GLboolean b
GLsizei const GLfloat * v
[13]
GLenum GLenum GLsizei count
GLenum GLuint GLenum GLsizei const GLchar * buf
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
static const int QSB_VERSION_WITH_CBOR
QHash< QShaderKey, QShaderCode > shaders
static const int QSB_VERSION_WITH_BINARY_JSON
static const int QSB_VERSION_WITHOUT_BINDINGS
static const int QSB_VERSION_WITHOUT_VAR_ARRAYDIMS
static QShaderPrivate * get(QShader *s)
QHash< QShaderKey, QShader::NativeResourceBindingMap > bindings
static const int QSB_VERSION