1087 if (imageFormatTab[
i].
v ==
f)
1140} tessellationModeTab[] {
1150 if (tessellationModeTab[
i].
v ==
mode)
1159} tessellationWindingOrderTab[] {
1168 if (tessellationWindingOrderTab[
i].
v ==
w)
1177} tessellationPartitioningTab[] {
1187 if (tessellationPartitioningTab[
i].
v ==
p)
1193#ifndef QT_NO_DEBUG_STREAM
1200 dbg.nospace() <<
"QShaderDescription("
1201 <<
"inVars " <<
d->inVars
1202 <<
" outVars " <<
d->outVars
1203 <<
" uniformBlocks " <<
d->uniformBlocks
1204 <<
" pcBlocks " <<
d->pushConstantBlocks
1205 <<
" storageBlocks " <<
d->storageBlocks
1206 <<
" combinedSamplers " <<
d->combinedImageSamplers
1207 <<
" storageImages " <<
d->storageImages
1208 <<
" separateImages " <<
d->separateImages
1209 <<
" separateSamplers " <<
d->separateSamplers
1210 <<
" inBuiltins " <<
d->inBuiltins
1211 <<
" outBuiltins " <<
d->outBuiltins
1214 dbg.nospace() <<
"QShaderDescription(null)";
1223 dbg.nospace() <<
"InOutVariable(" <<
typeStr(
var.type) <<
' ' <<
var.name;
1225 dbg.nospace() <<
" per-patch";
1226 if (
var.location >= 0)
1227 dbg.nospace() <<
" location=" <<
var.location;
1228 if (
var.binding >= 0)
1229 dbg.nospace() <<
" binding=" <<
var.binding;
1230 if (
var.descriptorSet >= 0)
1231 dbg.nospace() <<
" set=" <<
var.descriptorSet;
1235 dbg.nospace() <<
" imageFlags=" <<
var.imageFlags;
1236 if (!
var.arrayDims.isEmpty())
1237 dbg.nospace() <<
" array=" <<
var.arrayDims;
1238 if (!
var.structMembers.isEmpty())
1239 dbg.nospace() <<
" structMembers=" <<
var.structMembers;
1240 dbg.nospace() <<
')';
1247 dbg.nospace() <<
"BlockVariable(" <<
typeStr(
var.type) <<
' ' <<
var.name;
1248 if (
var.offset != -1)
1249 dbg.nospace() <<
" offset=" <<
var.offset;
1250 dbg.nospace() <<
" size=" <<
var.size;
1251 if (!
var.arrayDims.isEmpty())
1252 dbg.nospace() <<
" array=" <<
var.arrayDims;
1253 if (
var.arrayStride)
1254 dbg.nospace() <<
" arrayStride=" <<
var.arrayStride;
1255 if (
var.matrixStride)
1256 dbg.nospace() <<
" matrixStride=" <<
var.matrixStride;
1257 if (
var.matrixIsRowMajor)
1258 dbg.nospace() <<
" [rowmaj]";
1259 if (!
var.structMembers.isEmpty())
1260 dbg.nospace() <<
" structMembers=" <<
var.structMembers;
1261 dbg.nospace() <<
')';
1269 <<
" size=" << blk.
size;
1271 dbg.nospace() <<
" binding=" << blk.
binding;
1274 dbg.nospace() <<
' ' << blk.
members <<
')';
1281 dbg.nospace() <<
"PushConstantBlock(" << blk.
name <<
" size=" << blk.
size <<
' ' << blk.
members
1292 dbg.nospace() <<
" binding=" << blk.
binding;
1299 dbg.nospace() <<
' ' << blk.
members <<
')';
1309 dbg.nospace() <<
" array=" << builtin.
arrayDims;
1310 dbg.nospace() <<
")";
1315#define JSON_KEY(key) static constexpr QLatin1StringView key ## Key() noexcept { return QLatin1StringView( #key ); }
1346JSON_KEY(tessellationOutputVertexCount)
1358 if (
v.location >= 0)
1359 (*obj)[locationKey()] =
v.location;
1361 (*obj)[bindingKey()] =
v.binding;
1362 if (
v.descriptorSet >= 0)
1363 (*obj)[
setKey()] =
v.descriptorSet;
1365 (*obj)[perPatchKey()] =
v.perPatch;
1369 (*obj)[imageFlagsKey()] = int(
v.imageFlags);
1370 if (!
v.arrayDims.isEmpty()) {
1372 for (
int dim :
v.arrayDims)
1374 (*obj)[arrayDimsKey()] = dimArr;
1380 (*stream) <<
v.location;
1381 (*stream) <<
v.binding;
1382 (*stream) <<
v.descriptorSet;
1383 (*stream) << int(
v.imageFormat);
1384 (*stream) << int(
v.imageFlags);
1385 (*stream) << int(
v.arrayDims.size());
1386 for (
int dim :
v.arrayDims)
1389 (*stream) <<
quint8(
v.perPatch);
1394 (*stream) << int(
v.type);
1396 (*stream) << int(
v.varType);
1397 (*stream) << int(
v.arrayDims.size());
1398 for (
int dim :
v.arrayDims)
1409 obj[offsetKey()] =
v.offset;
1410 obj[sizeKey()] =
v.size;
1411 if (!
v.arrayDims.isEmpty()) {
1413 for (
int dim :
v.arrayDims)
1415 obj[arrayDimsKey()] = dimArr;
1418 obj[arrayStrideKey()] =
v.arrayStride;
1420 obj[matrixStrideKey()] =
v.matrixStride;
1421 if (
v.matrixIsRowMajor)
1422 obj[matrixRowMajorKey()] =
true;
1423 if (!
v.structMembers.isEmpty()) {
1427 obj[structMembersKey()] = arr;
1438 if (!
v.structMembers.isEmpty()) {
1442 obj[structMembersKey()] = arr;
1453 if (!
v.arrayDims.isEmpty()) {
1455 for (
int dim :
v.arrayDims)
1457 obj[arrayDimsKey()] = dimArr;
1465 (*stream) << int(
v.type);
1466 (*stream) <<
v.offset;
1467 (*stream) <<
v.size;
1468 (*stream) << int(
v.arrayDims.size());
1469 for (
int dim :
v.arrayDims)
1471 (*stream) <<
v.arrayStride;
1472 (*stream) <<
v.matrixStride;
1473 (*stream) <<
v.matrixIsRowMajor;
1474 (*stream) << int(
v.structMembers.size());
1483 (*stream) << int(
v.type);
1486 (*stream) << int(
v.structMembers.size());
1500 root[inputsKey()] = jinputs;
1506 root[outputsKey()] = joutputs;
1513 juniformBlock[sizeKey()] =
b.
size;
1515 juniformBlock[bindingKey()] =
b.binding;
1516 if (
b.descriptorSet >= 0)
1517 juniformBlock[
setKey()] =
b.descriptorSet;
1521 juniformBlock[membersKey()] =
members;
1522 juniformBlocks.
append(juniformBlock);
1524 if (!juniformBlocks.
isEmpty())
1525 root[uniformBlocksKey()] = juniformBlocks;
1531 jpushConstantBlock[sizeKey()] =
b.
size;
1535 jpushConstantBlock[membersKey()] =
members;
1536 jpushConstantBlocks.
append(jpushConstantBlock);
1538 if (!jpushConstantBlocks.
isEmpty())
1539 root[pushConstantBlocksKey()] = jpushConstantBlocks;
1546 jstorageBlock[knownSizeKey()] =
b.knownSize;
1548 jstorageBlock[bindingKey()] =
b.binding;
1549 if (
b.descriptorSet >= 0)
1550 jstorageBlock[
setKey()] =
b.descriptorSet;
1551 if (
b.runtimeArrayStride)
1552 jstorageBlock[runtimeArrayStrideKey()] =
b.runtimeArrayStride;
1553 if (
b.qualifierFlags)
1554 jstorageBlock[qualifierFlagsKey()] = int(
b.qualifierFlags);
1558 jstorageBlock[membersKey()] =
members;
1559 jstorageBlocks.
append(jstorageBlock);
1561 if (!jstorageBlocks.
isEmpty())
1562 root[storageBlocksKey()] = jstorageBlocks;
1572 if (!jcombinedSamplers.
isEmpty())
1573 root[combinedImageSamplersKey()] = jcombinedSamplers;
1583 if (!jstorageImages.
isEmpty())
1584 root[storageImagesKey()] = jstorageImages;
1590 root[inBuiltinsKey()] = jinBuiltins;
1596 root[outBuiltinsKey()] = joutBuiltins;
1600 for (
size_t i = 0;
i < 3; ++
i)
1602 root[computeLocalSizeKey()] = jlocalSize;
1625 if (!jseparateImages.
isEmpty())
1626 root[separateImagesKey()] = jseparateImages;
1636 if (!jseparateSamplers.
isEmpty())
1637 root[separateSamplersKey()] = jseparateSamplers;
1656 (*stream) <<
b.size;
1657 (*stream) <<
b.binding;
1658 (*stream) <<
b.descriptorSet;
1659 (*stream) << int(
b.members.size());
1667 (*stream) <<
b.size;
1668 (*stream) << int(
b.members.size());
1677 (*stream) <<
b.knownSize;
1678 (*stream) <<
b.binding;
1679 (*stream) <<
b.descriptorSet;
1680 (*stream) << int(
b.members.size());
1684 (*stream) <<
b.runtimeArrayStride;
1685 (*stream) <<
b.qualifierFlags;
1692 (*stream) << int(
v.type);
1699 (*stream) << int(
v.type);
1703 for (
size_t i = 0;
i < 3; ++
i)
1709 (*stream) << int(
v.type);
1716 (*stream) << int(
v.type);
1738 (*stream) >>
v->location;
1739 (*stream) >>
v->binding;
1740 (*stream) >>
v->descriptorSet;
1745 v->imageFlags = QShaderDescription::ImageFlags(
f);
1749 v->arrayDims.resize(
f);
1750 for (
int i = 0;
i <
f; ++
i)
1788 (*stream) >>
var.offset;
1789 (*stream) >>
var.size;
1795 (*stream) >>
var.arrayStride;
1796 (*stream) >>
var.matrixStride;
1797 (*stream) >>
var.matrixIsRowMajor;
1852 (*stream) >> memberCount;
1854 for (
int memberIdx = 0; memberIdx < memberCount; ++memberIdx)
1866 (*stream) >> memberCount;
1868 for (
int memberIdx = 0; memberIdx < memberCount; ++memberIdx)
1884 (*stream) >> memberCount;
1886 for (
int memberIdx = 0; memberIdx < memberCount; ++memberIdx)
1919 for (
size_t i = 0;
i < 3; ++
i) {
1985 return lhs.d->inVars == rhs.d->inVars
1986 && lhs.d->outVars == rhs.d->outVars
1987 && lhs.d->uniformBlocks == rhs.d->uniformBlocks
1988 && lhs.d->pushConstantBlocks == rhs.d->pushConstantBlocks
1989 && lhs.d->storageBlocks == rhs.d->storageBlocks
1990 && lhs.d->combinedImageSamplers == rhs.d->combinedImageSamplers
1991 && lhs.d->separateImages == rhs.d->separateImages
1992 && lhs.d->separateSamplers == rhs.d->separateSamplers
1993 && lhs.d->storageImages == rhs.d->storageImages
1994 && lhs.d->inBuiltins == rhs.d->inBuiltins
1995 && lhs.d->outBuiltins == rhs.d->outBuiltins
1996 && lhs.d->localSize == rhs.d->localSize
1997 && lhs.d->tessOutVertCount == rhs.d->tessOutVertCount
1998 && lhs.d->tessMode == rhs.d->tessMode
1999 && lhs.d->tessWind == rhs.d->tessWind
2000 && lhs.d->tessPart == rhs.d->tessPart;
2011 return lhs.name == rhs.name
2012 && lhs.type == rhs.type
2013 && lhs.location == rhs.location
2014 && lhs.binding == rhs.binding
2015 && lhs.descriptorSet == rhs.descriptorSet
2016 && lhs.imageFormat == rhs.imageFormat
2017 && lhs.imageFlags == rhs.imageFlags
2018 && lhs.arrayDims == rhs.arrayDims
2019 && lhs.perPatch == rhs.perPatch
2020 && lhs.structMembers == rhs.structMembers;
2031 return lhs.name == rhs.name
2032 && lhs.type == rhs.type
2033 && lhs.offset == rhs.offset
2034 && lhs.size == rhs.size
2035 && lhs.arrayDims == rhs.arrayDims
2036 && lhs.arrayStride == rhs.arrayStride
2037 && lhs.matrixStride == rhs.matrixStride
2038 && lhs.matrixIsRowMajor == rhs.matrixIsRowMajor
2039 && lhs.structMembers == rhs.structMembers;
2050 return lhs.blockName == rhs.blockName
2051 && lhs.structName == rhs.structName
2052 && lhs.size == rhs.size
2053 && lhs.binding == rhs.binding
2054 && lhs.descriptorSet == rhs.descriptorSet
2055 && lhs.members == rhs.members;
2066 return lhs.name == rhs.name
2067 && lhs.size == rhs.size
2068 && lhs.members == rhs.members;
2079 return lhs.blockName == rhs.blockName
2080 && lhs.instanceName == rhs.instanceName
2081 && lhs.knownSize == rhs.knownSize
2082 && lhs.binding == rhs.binding
2083 && lhs.descriptorSet == rhs.descriptorSet
2084 && lhs.runtimeArrayStride == rhs.runtimeArrayStride
2085 && lhs.qualifierFlags == rhs.qualifierFlags
2086 && lhs.members == rhs.members;
2097 return lhs.type == rhs.type
2098 && lhs.varType == rhs.varType
2099 && lhs.arrayDims == rhs.arrayDims;
void append(const QCborValue &value)
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
bool isEmpty() const
Returns true if the object is empty.
void append(const QJsonValue &value)
Inserts value at the end of the array.
\inmodule QtCore\reentrant
QByteArray toJson(JsonFormat format=Indented) const
\inmodule QtCore\reentrant
qsizetype size() const
Returns the number of (key, value) pairs stored in the object.
\inmodule QtCore\reentrant
qsizetype size() const noexcept
bool isEmpty() const noexcept
void resize(qsizetype size)
QList< InOutVariable > separateSamplers() const
QList< InOutVariable > inputVariables() const
~QShaderDescription()
Destructor.
void serialize(QDataStream *stream, int version) const
Serializes this QShaderDescription to stream.
TessellationWindingOrder
\value UnknownTessellationWindingOrder \value CwTessellationWindingOrder \value CcwTessellationWindin...
@ CwTessellationWindingOrder
@ CcwTessellationWindingOrder
@ UnknownTessellationWindingOrder
QList< StorageBlock > storageBlocks() const
static QShaderDescription deserialize(QDataStream *stream, int version)
TessellationPartitioning tessellationPartitioning() const
VariableType
Represents the type of a variable or block member.
QList< PushConstantBlock > pushConstantBlocks() const
@ ImageFormatR11fG11fB10f
QList< InOutVariable > storageImages() const
QShaderDescription()
Constructs a new, empty QShaderDescription.
QList< BuiltinVariable > inputBuiltinVariables() const
TessellationMode tessellationMode() const
BuiltinType
\variable QShaderDescription::BuiltinVariable::type
@ LocalInvocationIdBuiltin
@ LocalInvocationIndexBuiltin
@ GlobalInvocationIdBuiltin
TessellationMode
\value UnknownTessellationMode \value TrianglesTessellationMode \value QuadTessellationMode \value Is...
@ IsolineTessellationMode
@ TrianglesTessellationMode
@ UnknownTessellationMode
QList< BuiltinVariable > outputBuiltinVariables() const
TessellationPartitioning
\value UnknownTessellationPartitioning \value EqualTessellationPartitioning \value FractionalEvenTess...
@ EqualTessellationPartitioning
@ FractionalEvenTessellationPartitioning
@ UnknownTessellationPartitioning
@ FractionalOddTessellationPartitioning
QList< InOutVariable > outputVariables() const
QList< InOutVariable > combinedImageSamplers() const
QByteArray toJson() const
QList< InOutVariable > separateImages() const
QShaderDescription & operator=(const QShaderDescription &other)
Assigns other to this object.
TessellationWindingOrder tessellationWindingOrder() const
QList< UniformBlock > uniformBlocks() const
uint tessellationOutputVertexCount() const
std::array< uint, 3 > computeShaderLocalSize() const
\macro QT_RESTRICTED_CAST_FROM_ASCII
static QString fromUtf8(QByteArrayView utf8)
This is an overloaded member function, provided for convenience. It differs from the above function o...
QByteArray toUtf8() const &
Combined button and popup list for selecting options.
QT_WARNING_POP void qAtomicAssign(T *&d, T *x)
This is a helper for the assignment operators of implicitly shared classes.
void qAtomicDetach(T *&d)
This is a helper for the detach method of implicitly shared classes.
GLboolean GLboolean GLboolean b
GLsizei const GLfloat * v
[13]
GLfloat GLfloat GLfloat w
[0]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLenum GLenum GLsizei count
GLenum GLuint GLintptr offset
QCborArray members(const QCborMap *classDef, QLatin1StringView key, QTypeRevision maxMajorVersion, Postprocess &&process)
bool operator==(const QRandomGenerator &rng1, const QRandomGenerator &rng2)
static QLatin1StringView tessModeStr(QShaderDescription::TessellationMode mode)
static QLatin1StringView tessPartStr(QShaderDescription::TessellationPartitioning p)
static void serializeBlockMemberVar(QDataStream *stream, const QShaderDescription::BlockVariable &v)
static void deserializeDecorations(QDataStream *stream, int version, QShaderDescription::InOutVariable *v)
QDebug operator<<(QDebug dbg, const QShaderDescription &sd)
static QLatin1StringView builtinTypeStr(QShaderDescription::BuiltinType t)
static const struct TypeTab typeTab[]
static QJsonObject inOutObject(const QShaderDescription::InOutVariable &v)
static QShaderDescription::BuiltinVariable deserializeBuiltinVar(QDataStream *stream, int version)
static void serializeBuiltinVar(QDataStream *stream, const QShaderDescription::BuiltinVariable &v, int version)
static QJsonObject builtinObject(const QShaderDescription::BuiltinVariable &v)
static void serializeInOutVar(QDataStream *stream, const QShaderDescription::InOutVariable &v, int version)
static void serializeDecorations(QDataStream *stream, const QShaderDescription::InOutVariable &v, int version)
static QLatin1StringView imageFormatStr(QShaderDescription::ImageFormat f)
static const struct BuiltinTypeTab builtinTypeTab[]
static QJsonObject blockMemberObject(const QShaderDescription::BlockVariable &v)
static void addDeco(QJsonObject *obj, const QShaderDescription::InOutVariable &v)
static QShaderDescription::InOutVariable deserializeInOutVar(QDataStream *stream, int version)
static QLatin1StringView tessWindStr(QShaderDescription::TessellationWindingOrder w)
static QLatin1StringView typeStr(QShaderDescription::VariableType t)
static QShaderDescription::BlockVariable deserializeBlockMemberVar(QDataStream *stream, int version)
QFuture< QSet< QChar > > set
[10]
QShaderDescription::BuiltinType v
QList< QShaderDescription::InOutVariable > separateImages
QList< QShaderDescription::InOutVariable > inVars
std::array< uint, 3 > localSize
QList< QShaderDescription::StorageBlock > storageBlocks
void loadFromStream(QDataStream *stream, int version)
static QShaderDescriptionPrivate * get(QShaderDescription *desc)
QShaderDescription::TessellationMode tessMode
QList< QShaderDescription::BuiltinVariable > inBuiltins
void writeToStream(QDataStream *stream, int version)
QList< QShaderDescription::InOutVariable > combinedImageSamplers
QList< QShaderDescription::BuiltinVariable > outBuiltins
QList< QShaderDescription::InOutVariable > outVars
QList< QShaderDescription::InOutVariable > storageImages
QShaderDescription::TessellationPartitioning tessPart
QList< QShaderDescription::UniformBlock > uniformBlocks
QList< QShaderDescription::InOutVariable > separateSamplers
QList< QShaderDescription::PushConstantBlock > pushConstantBlocks
QShaderDescription::TessellationWindingOrder tessWind
\variable QShaderDescription::InOutVariable::name
bool operator==(const QShaderDescription::BlockVariable &lhs, const QShaderDescription::BlockVariable &rhs) noexcept
Returns true if the two BlockVariable objects lhs and rhs are equal.
\variable QShaderDescription::StorageBlock::blockName
bool operator==(const QShaderDescription::BuiltinVariable &lhs, const QShaderDescription::BuiltinVariable &rhs) noexcept
Returns true if the two BuiltinVariable objects lhs and rhs are equal.
bool operator==(const QShaderDescription::InOutVariable &lhs, const QShaderDescription::InOutVariable &rhs) noexcept
Returns true if the two InOutVariable objects lhs and rhs are equal.
\variable QShaderDescription::UniformBlock::blockName
bool operator==(const QShaderDescription::PushConstantBlock &lhs, const QShaderDescription::PushConstantBlock &rhs) noexcept
Returns true if the two PushConstantBlock objects lhs and rhs are equal.
QList< BlockVariable > members
\variable QShaderDescription::PushConstantBlock::name
QualifierFlags qualifierFlags
QList< BlockVariable > members
bool operator==(const QShaderDescription::StorageBlock &lhs, const QShaderDescription::StorageBlock &rhs) noexcept
Returns true if the two StorageBlock objects lhs and rhs are equal.
static const int QSB_VERSION_WITHOUT_INPUT_OUTPUT_INTERFACE_BLOCKS
static const int QSB_VERSION_WITHOUT_VAR_ARRAYDIMS
static const int QSB_VERSION_WITHOUT_EXTENDED_STORAGE_BUFFER_INFO
static const int QSB_VERSION_WITHOUT_NATIVE_SHADER_INFO
static const int QSB_VERSION_WITHOUT_SEPARATE_IMAGES_AND_SAMPLERS
QShaderDescription::TessellationMode v
QShaderDescription::TessellationPartitioning v
QShaderDescription::TessellationWindingOrder v
QShaderDescription::VariableType v