5#ifndef QSSG_RENDER_SHADER_KEY_H
6#define QSSG_RENDER_SHADER_KEY_H
19#include <QtQuick3DUtils/private/qssgdataref_p.h>
20#include <QtQuick3DUtils/private/qssgrenderbasetypes_p.h>
21#include <QtQuick3DRuntimeRender/private/qssgrenderdefaultmaterial_p.h>
22#include <QtQuick3DRuntimeRender/private/qssgrhicontext_p.h>
33struct QSSGShaderKeyPropertyBase
37 explicit constexpr QSSGShaderKeyPropertyBase(
const char *inName =
"") : name(inName), offset(0) {}
38 quint32 getOffset()
const {
return offset; }
39 void setOffset(quint32 of) { offset = of; }
41 template<quint32 TBitWidth>
42 quint32 getMaskTemplate()
const
44 quint32 bit = offset % 32;
45 quint32 startValue = (1 << TBitWidth) - 1;
46 quint32 mask = startValue << bit;
50 quint32 getIdx()
const {
return offset / 32; }
53 void internalToString(QByteArray &ioStr,
const QByteArrayView &inBuffer)
const
57 ioStr.append(inBuffer);
60 static void internalToString(QByteArray &ioStr,
const QByteArrayView &name,
bool inValue)
65 ioStr.append(inValue ? QByteArrayView(
"true") : QByteArrayView(
"false"));
68 static bool getBoolValue(
const QByteArray& str,
const QByteArrayView &name)
70 const int index = str.indexOf(name);
73 const qsizetype nameLen = name.size();
74 if (str[index + nameLen] !=
'=')
76 if (str.mid(index + nameLen + 1, 4) == QByteArrayView(
"true"))
91 void setValue(QSSGDataRef<quint32> inDataStore,
bool inValue)
const
93 const qint32 idx = qint32(getIdx());
94 Q_ASSERT(idx >= 0 && idx <= INT32_MAX);
95 Q_ASSERT(inDataStore.size() > idx);
96 quint32 mask = getMask();
97 quint32 &target = inDataStore[idx];
99 target = target | mask;
102 target = target & mask;
106 bool getValue(QSSGDataView<quint32> inDataStore)
const
108 quint32 idx = getIdx();
109 quint32 mask = getMask();
110 const quint32 &target = inDataStore[idx];
111 return (target & mask) ?
true :
false;
114 void toString(QByteArray &ioStr, QSSGDataView<quint32> inKeySet)
const
116 bool isHigh = getValue(inKeySet);
117 internalToString(ioStr, name, isHigh);
119 void fromString(
const QByteArray &ioStr, QSSGDataRef<quint32> inKeySet)
121 setValue(inKeySet, getBoolValue(ioStr, name));
125template<quint32 TBitWidth>
133 void setValue(QSSGDataRef<quint32> inDataStore, quint32 inValue)
const
135 quint32 startValue = (1 << TBitWidth) - 1;
137 inValue = inValue & startValue;
138 quint32 bit = offset % 32;
139 quint32 mask = getMask();
140 quint32 idx = getIdx();
141 inValue = inValue << bit;
142 quint32 &target = inDataStore[idx];
144 quint32 inverseMask = ~mask;
145 target = target & inverseMask;
146 target = target | inValue;
151 quint32 idx = getIdx();
152 quint32 bit = offset % 32;
153 quint32 mask = getMask();
154 const quint32 &target = inDataStore[idx];
156 quint32 retval = target & mask;
157 retval = retval >> bit;
161 void toString(QByteArray &ioStr, QSSGDataView<quint32> inKeySet)
const
163 quint32 value = getValue(inKeySet);
165 memset(buf, 0,
sizeof (buf));
166 toStr(value, toDataRef(buf, 64));
167 internalToString(ioStr, buf);
170 void fromString(
const QByteArray &ioStr, QSSGDataRef<quint32> inKeySet)
172 const qsizetype nameLen = name.size();
173 const qsizetype strOffset = ioStr.indexOf(name);
174 if (strOffset >= 0) {
176 if (ioStr[strOffset + nameLen] !=
'=')
178 const QByteArray s = ioStr.right(ioStr.size() - strOffset - nameLen - 1);
180 while (QChar(QLatin1Char(s[i])).isDigit())
182 const quint32 value = s.left(i).toInt();
183 setValue(inKeySet, value);
188 static quint32 toStr(quint32 item, QSSGDataRef<
char> buffer)
191 return static_cast<quint32>(::snprintf(buffer.begin(), buffer.size(),
"%u", item));
212 setValue(inKeySet, quint32(channel));
220 void toString(QByteArray &ioStr, QSSGDataView<quint32> inKeySet)
const
224 ioStr.append(textureChannelToChar[getTextureChannel(inKeySet)]);
226 void fromString(
const QByteArray &ioStr, QSSGDataRef<quint32> inKeySet)
228 const qsizetype nameLen = name.size();
229 const qsizetype strOffset = ioStr.indexOf(name);
230 if (strOffset >= 0) {
232 if (ioStr[strOffset + nameLen] !=
'=')
234 const char ch = ioStr[strOffset + nameLen + 1];
262 return (getValue(inKeySet) & imageBit) ?
true :
false;
267 quint32 theValue = getValue(inKeySet);
268 quint32 mask = imageBit;
270 theValue = theValue | mask;
273 theValue = theValue & mask;
275 setValue(inKeySet, theValue);
278 bool isEnabled(QSSGDataView<quint32> inKeySet)
const {
return getBitValue(Enabled, inKeySet); }
279 void setEnabled(QSSGDataRef<quint32> inKeySet,
bool val) { setBitValue(Enabled, val, inKeySet); }
281 bool isEnvMap(QSSGDataView<quint32> inKeySet)
const {
return getBitValue(EnvMap, inKeySet); }
282 void setEnvMap(QSSGDataRef<quint32> inKeySet,
bool val) { setBitValue(EnvMap, val, inKeySet); }
284 bool isLightProbe(QSSGDataView<quint32> inKeySet)
const {
return getBitValue(LightProbe, inKeySet); }
285 void setLightProbe(QSSGDataRef<quint32> inKeySet,
bool val) { setBitValue(LightProbe, val, inKeySet); }
287 bool isIdentityTransform(QSSGDataView<quint32> inKeySet)
const {
return getBitValue(Identity, inKeySet); }
290 bool isUsingUV1(QSSGDataView<quint32> inKeySet)
const {
return getBitValue(UsesUV1, inKeySet); }
291 void setUsesUV1(QSSGDataRef<quint32> inKeySet,
bool val) { setBitValue(UsesUV1, val, inKeySet); }
293 bool isLinear(QSSGDataView<quint32> inKeySet)
const {
return getBitValue(Linear, inKeySet); }
294 void setLinear(QSSGDataRef<quint32> inKeySet,
bool val) { setBitValue(Linear, val, inKeySet); }
296 void toString(QByteArray &ioStr, QSSGDataView<quint32> inKeySet)
const
299 ioStr.append(QByteArrayView(
"={"));
300 internalToString(ioStr, QByteArrayView(
"enabled"), isEnabled(inKeySet));
302 internalToString(ioStr, QByteArrayView(
"envMap"), isEnvMap(inKeySet));
304 internalToString(ioStr, QByteArrayView(
"lightProbe"), isLightProbe(inKeySet));
306 internalToString(ioStr, QByteArrayView(
"identity"), isIdentityTransform(inKeySet));
308 internalToString(ioStr, QByteArrayView(
"usesUV1"), isUsingUV1(inKeySet));
310 internalToString(ioStr, QByteArrayView(
"linear"), isLinear(inKeySet));
319 void setSpecularModel(QSSGDataRef<quint32> inKeySet, QSSGRenderDefaultMaterial::MaterialSpecularModel inModel)
321 setValue(inKeySet, quint32(inModel));
326 return static_cast<QSSGRenderDefaultMaterial::MaterialSpecularModel>(getValue(inKeySet));
329 void toString(QByteArray &ioStr, QSSGDataView<quint32> inKeySet)
const
333 switch (getSpecularModel(inKeySet)) {
334 case QSSGRenderDefaultMaterial::MaterialSpecularModel::SchlickGGX:
335 ioStr.append(QByteArrayView(
"SchlickGGX"));
337 case QSSGRenderDefaultMaterial::MaterialSpecularModel::BlinnPhong:
338 ioStr.append(QByteArrayView(
"BlinnPhong"));
342 void fromString(
const QByteArray &ioStr, QSSGDataRef<quint32> inKeySet)
344 const qsizetype nameLen = name.size();
345 const int strOffset = ioStr.indexOf(name);
346 if (strOffset >= 0) {
348 if (ioStr[strOffset + nameLen] !=
'=')
350 const int codeOffsetBegin = strOffset + nameLen + 1;
352 while (ioStr[codeOffsetBegin + codeOffset] !=
';')
354 const QByteArray val = ioStr.mid(codeOffsetBegin, codeOffset);
355 if (val == QByteArrayView(
"SchlickGGX"))
356 setSpecularModel(inKeySet, QSSGRenderDefaultMaterial::MaterialSpecularModel::SchlickGGX);
357 if (val == QByteArrayView(
"BlinnPhong"))
358 setSpecularModel(inKeySet, QSSGRenderDefaultMaterial::MaterialSpecularModel::BlinnPhong);
367 void setDiffuseModel(QSSGDataRef<quint32> inKeySet, QSSGRenderDefaultMaterial::MaterialDiffuseModel inModel)
369 setValue(inKeySet, quint32(inModel));
374 return static_cast<QSSGRenderDefaultMaterial::MaterialDiffuseModel>(getValue(inKeySet));
377 void toString(QByteArray &ioStr, QSSGDataView<quint32> inKeySet)
const
381 switch (getDiffuseModel(inKeySet)) {
382 case QSSGRenderDefaultMaterial::MaterialDiffuseModel::Burley:
383 ioStr.append(QByteArrayView(
"Burley"));
385 case QSSGRenderDefaultMaterial::MaterialDiffuseModel::Lambert:
386 ioStr.append(QByteArrayView(
"Lambert"));
388 case QSSGRenderDefaultMaterial::MaterialDiffuseModel::LambertWrap:
389 ioStr.append(QByteArrayView(
"LambertWrap"));
393 void fromString(
const QByteArray &ioStr, QSSGDataRef<quint32> inKeySet)
395 const qsizetype nameLen = name.size();
396 const int strOffset = ioStr.indexOf(name);
397 if (strOffset >= 0) {
399 if (ioStr[strOffset + nameLen] !=
'=')
401 const int codeOffsetBegin = strOffset + nameLen + 1;
403 while (ioStr[codeOffsetBegin + codeOffset] !=
';')
405 const QByteArray val = ioStr.mid(codeOffsetBegin, codeOffset);
406 if (val == QByteArrayView(
"Burley"))
407 setDiffuseModel(inKeySet, QSSGRenderDefaultMaterial::MaterialDiffuseModel::Burley);
408 if (val == QByteArrayView(
"Lambert"))
409 setDiffuseModel(inKeySet, QSSGRenderDefaultMaterial::MaterialDiffuseModel::Lambert);
410 if (val == QByteArrayView(
"LambertWrap"))
411 setDiffuseModel(inKeySet, QSSGRenderDefaultMaterial::MaterialDiffuseModel::LambertWrap);
420 void setAlphaMode(QSSGDataRef<quint32> inKeySet, QSSGRenderDefaultMaterial::MaterialAlphaMode inMode)
422 setValue(inKeySet, quint32(inMode));
427 return static_cast<QSSGRenderDefaultMaterial::MaterialAlphaMode>(getValue(inKeySet));
430 void toString(QByteArray &ioStr, QSSGDataView<quint32> inKeySet)
const
434 switch (getAlphaMode(inKeySet)) {
435 case QSSGRenderDefaultMaterial::MaterialAlphaMode::Default:
436 ioStr.append(QByteArrayView(
"Default"));
438 case QSSGRenderDefaultMaterial::MaterialAlphaMode::Mask:
439 ioStr.append(QByteArrayView(
"Mask"));
441 case QSSGRenderDefaultMaterial::MaterialAlphaMode::Blend:
442 ioStr.append(QByteArrayView(
"Blend"));
444 case QSSGRenderDefaultMaterial::MaterialAlphaMode::Opaque:
445 ioStr.append(QByteArrayView(
"Opaque"));
449 void fromString(
const QByteArray &ioStr, QSSGDataRef<quint32> inKeySet)
451 const qsizetype nameLen = name.size();
452 const qsizetype strOffset = ioStr.indexOf(name);
453 if (strOffset >= 0) {
455 if (ioStr[strOffset + nameLen] !=
'=')
457 const int codeOffsetBegin = strOffset + nameLen + 1;
459 while (ioStr[codeOffsetBegin + codeOffset] !=
';')
461 const QByteArray val = ioStr.mid(codeOffsetBegin, codeOffset);
462 if (val == QByteArrayView(
"Default"))
463 setAlphaMode(inKeySet, QSSGRenderDefaultMaterial::MaterialAlphaMode::Default);
464 if (val == QByteArrayView(
"Mask"))
465 setAlphaMode(inKeySet, QSSGRenderDefaultMaterial::MaterialAlphaMode::Mask);
466 if (val == QByteArrayView(
"Blend"))
467 setAlphaMode(inKeySet, QSSGRenderDefaultMaterial::MaterialAlphaMode::Blend);
468 if (val == QByteArrayView(
"Opaque"))
469 setAlphaMode(inKeySet, QSSGRenderDefaultMaterial::MaterialAlphaMode::Opaque);
492 return (getValue(inKeySet) & bit) ?
true :
false;
496 quint32 v = getValue(inKeySet);
497 v = value ? (v | bit) : (v & ~bit);
498 setValue(inKeySet, v);
501 void toString(QByteArray &ioStr, QSSGDataView<quint32> inKeySet)
const
504 ioStr.append(QByteArrayView(
"={"));
505 internalToString(ioStr, QByteArrayView(
"position"), getBitValue(Position, inKeySet));
507 internalToString(ioStr, QByteArrayView(
"normal"), getBitValue(Normal, inKeySet));
509 internalToString(ioStr, QByteArrayView(
"texcoord0"), getBitValue(TexCoord0, inKeySet));
511 internalToString(ioStr, QByteArrayView(
"texcoord1"), getBitValue(TexCoord1, inKeySet));
513 internalToString(ioStr, QByteArrayView(
"tangent"), getBitValue(Tangent, inKeySet));
515 internalToString(ioStr, QByteArrayView(
"binormal"), getBitValue(Binormal, inKeySet));
517 internalToString(ioStr, QByteArrayView(
"color"), getBitValue(Color, inKeySet));
519 internalToString(ioStr, QByteArrayView(
"texcoordlightmap"), getBitValue(TexCoordLightmap, inKeySet));
521 internalToString(ioStr, QByteArrayView(
"joint&weight"), getBitValue(JointAndWeight, inKeySet));
524 void fromString(
const QByteArray &ioStr, QSSGDataRef<quint32> inKeySet)
526 const qsizetype nameLen = name.size();
527 const qsizetype strOffset = ioStr.indexOf(name);
528 if (strOffset >= 0) {
530 if (ioStr[strOffset + nameLen] !=
'=')
532 if (ioStr[strOffset + nameLen + 1] !=
'{')
534 const int codeOffsetBegin = strOffset + nameLen + 2;
536 while (ioStr[codeOffsetBegin + codeOffset] !=
'}')
538 const QByteArray val = ioStr.mid(codeOffsetBegin, codeOffset);
539 const QVector<QByteArray> list = val.split(
';');
540 if (list.size() != 8)
542 setBitValue(Position, inKeySet, getBoolValue(list[0], QByteArrayView(
"position")));
543 setBitValue(Normal, inKeySet, getBoolValue(list[1], QByteArrayView(
"normal")));
544 setBitValue(TexCoord0, inKeySet, getBoolValue(list[2], QByteArrayView(
"texcoord0")));
545 setBitValue(TexCoord1, inKeySet, getBoolValue(list[3], QByteArrayView(
"texcoord1")));
546 setBitValue(Tangent, inKeySet, getBoolValue(list[4], QByteArrayView(
"tangent")));
547 setBitValue(Binormal, inKeySet, getBoolValue(list[5], QByteArrayView(
"binormal")));
548 setBitValue(Color, inKeySet, getBoolValue(list[6], QByteArrayView(
"color")));
549 setBitValue(TexCoordLightmap, inKeySet, getBoolValue(list[7], QByteArrayView(
"texcoordlightmap")));
707 m_imageMaps[0].name =
"diffuseMap";
708 m_imageMaps[1].name =
"emissiveMap";
709 m_imageMaps[2].name =
"specularMap";
710 m_imageMaps[3].name =
"baseColorMap";
711 m_imageMaps[4].name =
"bumpMap";
712 m_imageMaps[5].name =
"specularAmountMap";
713 m_imageMaps[6].name =
"normalMap";
714 m_imageMaps[7].name =
"clearcoatNormalMap";
715 m_imageMaps[8].name =
"opacityMap";
716 m_imageMaps[9].name =
"roughnessMap";
717 m_imageMaps[10].name =
"metalnessMap";
718 m_imageMaps[11].name =
"occlusionMap";
719 m_imageMaps[12].name =
"translucencyMap";
720 m_imageMaps[13].name =
"heightMap";
721 m_imageMaps[14].name =
"clearcoatMap";
722 m_imageMaps[15].name =
"clearcoatRoughnessMap";
723 m_imageMaps[16].name =
"transmissionMap";
724 m_imageMaps[17].name =
"thicknessMap";
726 m_textureChannels[0].name =
"opacityMap_channel";
727 m_textureChannels[1].name =
"roughnessMap_channel";
728 m_textureChannels[2].name =
"metalnessMap_channel";
729 m_textureChannels[3].name =
"occlusionMap_channel";
730 m_textureChannels[4].name =
"translucencyMap_channel";
731 m_textureChannels[5].name =
"heightMap_channel";
732 m_textureChannels[6].name =
"clearcoatMap_channel";
733 m_textureChannels[7].name =
"clearcoatRoughnessMap_channel";
734 m_textureChannels[8].name =
"transmissionMap_channel";
735 m_textureChannels[9].name =
"thicknessMap_channel";
736 m_textureChannels[10].name =
"baseColorMap_channel";
737 m_textureChannels[11].name =
"specularAmountMap_channel";
738 m_textureChannels[12].name =
"emissiveMap_channel";
743 template<
typename TVisitor>
746 inVisitor.visit(m_hasLighting);
747 inVisitor.visit(m_hasPunctualLights);
748 inVisitor.visit(m_hasShadows);
749 inVisitor.visit(m_hasIbl);
750 inVisitor.visit(m_specularEnabled);
751 inVisitor.visit(m_fresnelEnabled);
752 inVisitor.visit(m_fresnelScaleBiasEnabled);
753 inVisitor.visit(m_clearcoatFresnelScaleBiasEnabled);
754 inVisitor.visit(m_baseColorSingleChannelEnabled);
755 inVisitor.visit(m_specularSingleChannelEnabled);
756 inVisitor.visit(m_emissiveSingleChannelEnabled);
757 inVisitor.visit(m_invertOpacityMapValue);
758 inVisitor.visit(m_vertexColorsEnabled);
759 inVisitor.visit(m_vertexColorsMaskEnabled);
760 inVisitor.visit(m_vertexColorRedMask);
761 inVisitor.visit(m_vertexColorGreenMask);
762 inVisitor.visit(m_vertexColorBlueMask);
763 inVisitor.visit(m_vertexColorAlphaMask);
764 inVisitor.visit(m_specularModel);
765 inVisitor.visit(m_diffuseModel);
767 for (quint32 idx = 0, end = ImageMapCount; idx < end; ++idx)
768 inVisitor.visit(m_imageMaps[idx]);
770 for (
auto &textureChannel : m_textureChannels)
771 inVisitor.visit(textureChannel);
773 inVisitor.visit(m_boneCount);
774 inVisitor.visit(m_isDoubleSided);
775 inVisitor.visit(m_overridesPosition);
776 inVisitor.visit(m_usesProjectionMatrix);
777 inVisitor.visit(m_usesInverseProjectionMatrix);
778 inVisitor.visit(m_usesPointsTopology);
779 inVisitor.visit(m_usesVarColor);
780 inVisitor.visit(m_alphaMode);
781 inVisitor.visit(m_vertexAttributes);
782 inVisitor.visit(m_usesFloatJointIndices);
783 inVisitor.visit(m_usesInstancing);
784 inVisitor.visit(m_targetCount);
785 inVisitor.visit(m_targetPositionOffset);
786 inVisitor.visit(m_targetNormalOffset);
787 inVisitor.visit(m_targetTangentOffset);
788 inVisitor.visit(m_targetBinormalOffset);
789 inVisitor.visit(m_targetTexCoord0Offset);
790 inVisitor.visit(m_targetTexCoord1Offset);
791 inVisitor.visit(m_targetColorOffset);
792 inVisitor.visit(m_blendParticles);
793 inVisitor.visit(m_clearcoatEnabled);
794 inVisitor.visit(m_transmissionEnabled);
795 inVisitor.visit(m_specularAAEnabled);
796 inVisitor.visit(m_lightmapEnabled);
797 inVisitor.visit(m_specularGlossyEnabled);
798 inVisitor.visit(m_metallicRoughnessEnabled);
799 inVisitor.visit(m_debugMode);
800 inVisitor.visit(m_fogEnabled);
801 inVisitor.visit(m_viewCount);
802 inVisitor.visit(m_usesViewIndex);
803 inVisitor.visit(m_orderIndependentTransparency);
810 template<
typename TPropType>
817 quint32 bit = m_offset % 32;
818 if (bit + TPropType::BitWidth > 32) {
819 m_offset += 32 - bit;
822 inProp.setOffset(m_offset);
823 m_offset += TPropType::BitWidth;
833 size += prop.name.size();
845 offsetVisitor.visit(prop);
846 stringSizeVisitor.visit(prop);
853 visitProperties(visitor);
856 Q_ASSERT(visitor.offsetVisitor.m_offset < 768);
859 m_stringBufferSizeHint = visitor.stringSizeVisitor.size;
873 for (size_t idx = 0; idx < DataBufferSize; ++idx)
874 m_dataBuffer[idx] = 0;
879 for (size_t idx = 0; idx < DataBufferSize; ++idx)
880 m_dataBuffer[idx] = 0;
886 for (size_t idx = 0; idx < DataBufferSize; ++idx)
887 retval = retval ^ qHash(m_dataBuffer[idx]);
888 return retval ^ m_featureSetHash;
894 for (size_t idx = 0; idx < DataBufferSize && retval; ++idx)
895 retval = m_dataBuffer[idx] == other.m_dataBuffer[idx];
896 return retval && m_featureSetHash == other.m_featureSetHash;
928 template<
typename TPropType>
931 prop.fromString(m_str, m_keyStore);
937 ioString.reserve(inProperties.m_stringBufferSizeHint);
938 StringVisitor theVisitor(ioString, *
this);
944 inProperties.visitProperties(theVisitor);
949 ret.resize(
sizeof(m_dataBuffer));
950 memcpy(ret.data(), m_dataBuffer,
sizeof(m_dataBuffer));
955 if (data.size() !=
sizeof(m_dataBuffer))
957 memcpy((
void *)m_dataBuffer, data.data(),
sizeof(m_dataBuffer));
962Q_STATIC_ASSERT(std::is_trivially_destructible<QSSGShaderDefaultMaterialKey>::value);
size_t qHash(const QSSGShaderDefaultMaterialKey &key)
OffsetVisitor offsetVisitor
StringSizeVisitor stringSizeVisitor
void visit(TPropType &inProp)
constexpr void visit(const P &prop)
QSSGShaderKeyBoolean m_usesInverseProjectionMatrix
QSSGShaderKeyUnsigned< 4 > m_debugMode
QSSGShaderKeyBoolean m_usesProjectionMatrix
QSSGShaderKeyUnsigned< 8 > m_targetTexCoord1Offset
QSSGShaderKeyBoolean m_vertexColorsMaskEnabled
QSSGShaderKeyBoolean m_baseColorSingleChannelEnabled
QSSGShaderKeyBoolean m_fogEnabled
QSSGShaderKeyBoolean m_usesInstancing
void visitProperties(TVisitor &inVisitor)
QSSGShaderKeyBoolean m_blendParticles
QSSGShaderKeyBoolean m_hasLighting
QSSGShaderKeyBoolean m_hasPunctualLights
@ SingleChannelImagesFirst
QSSGShaderKeyTextureChannel m_textureChannels[SingleChannelImageCount]
QSSGShaderKeyBoolean m_clearcoatEnabled
QSSGShaderKeyUnsigned< 16 > m_vertexColorAlphaMask
@ ClearcoatRoughnessChannel
QSSGShaderKeyBoolean m_transmissionEnabled
QSSGShaderKeyBoolean m_lightmapEnabled
QSSGShaderKeyBoolean m_usesVarColor
QSSGShaderKeyBoolean m_overridesPosition
QSSGShaderKeyBoolean m_isDoubleSided
QSSGShaderKeyImageMap m_imageMaps[ImageMapCount]
QSSGShaderKeySpecularModel m_specularModel
QSSGShaderKeyBoolean m_usesFloatJointIndices
QSSGShaderKeyBoolean m_specularEnabled
QSSGShaderDefaultMaterialKeyProperties()
QSSGShaderKeyBoolean m_usesViewIndex
QSSGShaderKeyUnsigned< 8 > m_targetPositionOffset
QSSGShaderKeyUnsigned< 16 > m_boneCount
QSSGShaderKeyBoolean m_hasIbl
qsizetype m_stringBufferSizeHint
QSSGShaderKeyUnsigned< 8 > m_targetTangentOffset
QSSGShaderKeyUnsigned< 8 > m_targetTexCoord0Offset
QSSGShaderKeyUnsigned< 16 > m_vertexColorBlueMask
QSSGShaderKeyUnsigned< 8 > m_targetColorOffset
QSSGShaderKeyBoolean m_emissiveSingleChannelEnabled
QSSGShaderKeyBoolean m_vertexColorsEnabled
QSSGShaderKeyVertexAttribute m_vertexAttributes
QSSGShaderKeyUnsigned< 8 > m_targetNormalOffset
QSSGShaderKeyBoolean m_fresnelEnabled
QSSGShaderKeyUnsigned< 8 > m_targetBinormalOffset
QSSGShaderKeyBoolean m_fresnelScaleBiasEnabled
QSSGShaderKeyUnsigned< 16 > m_vertexColorGreenMask
QSSGShaderKeyBoolean m_clearcoatFresnelScaleBiasEnabled
QSSGShaderKeyBoolean m_metallicRoughnessEnabled
QSSGShaderKeyUnsigned< 3 > m_viewCount
@ SingleChannelImageCount
QSSGShaderKeyAlphaMode m_alphaMode
QSSGShaderKeyBoolean m_specularSingleChannelEnabled
QSSGShaderKeyUnsigned< 3 > m_orderIndependentTransparency
QSSGShaderKeyUnsigned< 8 > m_targetCount
QSSGShaderKeyBoolean m_specularGlossyEnabled
QSSGShaderKeyDiffuseModel m_diffuseModel
QSSGShaderKeyBoolean m_hasShadows
QSSGShaderKeyBoolean m_usesPointsTopology
QSSGShaderKeyBoolean m_invertOpacityMapValue
QSSGShaderKeyUnsigned< 16 > m_vertexColorRedMask
QSSGShaderKeyBoolean m_specularAAEnabled
QSSGDataRef< quint32 > m_keyStore
void visit(TPropType &prop)
StringInVisitor(const QByteArray &s, QSSGDataRef< quint32 > ks)
void toString(QByteArray &ioString, const QSSGShaderDefaultMaterialKeyProperties &inProperties) const
quint32 m_dataBuffer[DataBufferSize]
QSSGShaderDefaultMaterialKey(size_t inFeatureSetHash)
bool operator==(const QSSGShaderDefaultMaterialKey &other) const
QSSGShaderDefaultMaterialKey()
void fromString(QByteArray &ioString, QSSGShaderDefaultMaterialKeyProperties &inProperties)
QByteArray toByteArray() const
bool fromByteArray(const QByteArray &data) const
void toString(QByteArray &ioStr, QSSGDataView< quint32 > inKeySet) const
QSSGRenderDefaultMaterial::MaterialAlphaMode getAlphaMode(QSSGDataView< quint32 > inKeySet) const
QSSGShaderKeyAlphaMode(const char *inName="")
void setAlphaMode(QSSGDataRef< quint32 > inKeySet, QSSGRenderDefaultMaterial::MaterialAlphaMode inMode)
void fromString(const QByteArray &ioStr, QSSGDataRef< quint32 > inKeySet)
void setValue(QSSGDataRef< quint32 > inDataStore, bool inValue) const
void toString(QByteArray &ioStr, QSSGDataView< quint32 > inKeySet) const
constexpr QSSGShaderKeyBoolean(const char *inName="")
bool getValue(QSSGDataView< quint32 > inDataStore) const
void fromString(const QByteArray &ioStr, QSSGDataRef< quint32 > inKeySet)
QSSGShaderKeyDiffuseModel(const char *inName="")
void setDiffuseModel(QSSGDataRef< quint32 > inKeySet, QSSGRenderDefaultMaterial::MaterialDiffuseModel inModel)
QSSGRenderDefaultMaterial::MaterialDiffuseModel getDiffuseModel(QSSGDataView< quint32 > inKeySet) const
void fromString(const QByteArray &ioStr, QSSGDataRef< quint32 > inKeySet)
void toString(QByteArray &ioStr, QSSGDataView< quint32 > inKeySet) const
void setIdentityTransform(QSSGDataRef< quint32 > inKeySet, bool val)
void setBitValue(ImageMapBits imageBit, bool inValue, QSSGDataRef< quint32 > inKeySet)
void setEnabled(QSSGDataRef< quint32 > inKeySet, bool val)
bool isUsingUV1(QSSGDataView< quint32 > inKeySet) const
QSSGShaderKeyImageMap(const char *inName="")
void toString(QByteArray &ioStr, QSSGDataView< quint32 > inKeySet) const
bool isIdentityTransform(QSSGDataView< quint32 > inKeySet) const
bool isEnabled(QSSGDataView< quint32 > inKeySet) const
bool isLightProbe(QSSGDataView< quint32 > inKeySet) const
void setLinear(QSSGDataRef< quint32 > inKeySet, bool val)
void setUsesUV1(QSSGDataRef< quint32 > inKeySet, bool val)
bool isEnvMap(QSSGDataView< quint32 > inKeySet) const
bool getBitValue(ImageMapBits imageBit, QSSGDataView< quint32 > inKeySet) const
void setLightProbe(QSSGDataRef< quint32 > inKeySet, bool val)
bool isLinear(QSSGDataView< quint32 > inKeySet) const
void setEnvMap(QSSGDataRef< quint32 > inKeySet, bool val)
QSSGRenderDefaultMaterial::MaterialSpecularModel getSpecularModel(QSSGDataView< quint32 > inKeySet) const
void setSpecularModel(QSSGDataRef< quint32 > inKeySet, QSSGRenderDefaultMaterial::MaterialSpecularModel inModel)
void fromString(const QByteArray &ioStr, QSSGDataRef< quint32 > inKeySet)
void toString(QByteArray &ioStr, QSSGDataView< quint32 > inKeySet) const
QSSGShaderKeySpecularModel(const char *inName="")
void fromString(const QByteArray &ioStr, QSSGDataRef< quint32 > inKeySet)
void setTextureChannel(TexturChannelBits channel, QSSGDataRef< quint32 > inKeySet)
static constexpr char textureChannelToChar[4]
TexturChannelBits getTextureChannel(QSSGDataView< quint32 > inKeySet) const
void toString(QByteArray &ioStr, QSSGDataView< quint32 > inKeySet) const
QSSGShaderKeyTextureChannel(const char *inName="")
void fromString(const QByteArray &ioStr, QSSGDataRef< quint32 > inKeySet)
constexpr QSSGShaderKeyUnsigned(const char *inName="")
void setValue(QSSGDataRef< quint32 > inDataStore, quint32 inValue) const
quint32 getValue(QSSGDataView< quint32 > inDataStore) const
void toString(QByteArray &ioStr, QSSGDataView< quint32 > inKeySet) const
void toString(QByteArray &ioStr, QSSGDataView< quint32 > inKeySet) const
bool getBitValue(VertexAttributeBits bit, QSSGDataView< quint32 > inKeySet) const
QSSGShaderKeyVertexAttribute(const char *inName="")
void fromString(const QByteArray &ioStr, QSSGDataRef< quint32 > inKeySet)
void setBitValue(VertexAttributeBits bit, QSSGDataRef< quint32 > inKeySet, bool value) const