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>
41 template<qu
int32 TBitW
idth>
45 quint32 startValue = (1 << TBitWidth) - 1;
94 Q_ASSERT(idx >= 0 && idx <= INT32_MAX);
125template<qu
int32 TBitW
idth>
135 quint32 startValue = (1 << TBitWidth) - 1;
137 inValue = inValue & startValue;
141 inValue = inValue << bit;
157 retval = retval >> bit;
165 memset(
buf, 0,
sizeof (
buf));
174 if (strOffset >= 0) {
176 if (ioStr[strOffset + nameLen] !=
'=')
230 if (strOffset >= 0) {
232 if (ioStr[strOffset + nameLen] !=
'=')
234 const char ch = ioStr[strOffset + nameLen + 1];
261 return (
getValue(inKeySet) & imageBit) ? true :
false;
269 theValue = theValue |
mask;
272 theValue = theValue &
mask;
341 if (strOffset >= 0) {
343 if (ioStr[strOffset + nameLen] !=
'=')
345 const int codeOffsetBegin = strOffset + nameLen + 1;
347 while (ioStr[codeOffsetBegin + codeOffset] !=
';')
396 if (strOffset >= 0) {
398 if (ioStr[strOffset + nameLen] !=
'=')
400 const int codeOffsetBegin = strOffset + nameLen + 1;
402 while (ioStr[codeOffsetBegin + codeOffset] !=
';')
435 return (
getValue(inKeySet) & bit) ? true :
false;
471 if (strOffset >= 0) {
473 if (ioStr[strOffset + nameLen] !=
'=')
475 if (ioStr[strOffset + nameLen + 1] !=
'{')
477 const int codeOffsetBegin = strOffset + nameLen + 2;
479 while (ioStr[codeOffsetBegin + codeOffset] !=
'}')
717 template<
typename TVisitor>
725 inVisitor.visit(lightFlag);
728 inVisitor.visit(lightSpotFlag);
731 inVisitor.visit(lightAreaFlag);
734 inVisitor.visit(lightShadowFlag);
745 inVisitor.visit(textureChannel);
780 template<
typename TPropType>
788 if (bit + TPropType::BitWidth > 32) {
803 size += prop.name.size();
878 template<
typename TPropType>
887 if (originalSize &&
m_str.
size() == (originalSize + 1))
898 template<
typename TPropType>
IOBluetoothL2CAPChannel * channel
qsizetype size() const noexcept
Returns the number of bytes in this byte array.
void reserve(qsizetype size)
Attempts to allocate memory for at least size bytes.
qsizetype indexOf(char c, qsizetype from=0) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
QByteArray right(qsizetype len) const
Returns a byte array that contains the last len bytes of this byte array.
void resize(qsizetype size)
Sets the size of the byte array to size bytes.
QByteArray & append(char c)
This is an overloaded member function, provided for convenience. It differs from the above function o...
QByteArray mid(qsizetype index, qsizetype len=-1) const
Returns a byte array containing len bytes from this byte array, starting at position pos.
qsizetype size() const noexcept
qsizetype size() const
Returns the number of characters in this string.
QString mid(qsizetype position, qsizetype n=-1) const
Returns a string that contains n characters of this string, starting at the specified position index.
static QString static QString qsizetype indexOf(QChar c, qsizetype from=0, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Combined button and popup list for selecting options.
#define Q_STATIC_ASSERT(Condition)
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLsizei const GLfloat * v
[13]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLenum GLuint GLenum GLsizei const GLchar * buf
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum GLuint GLintptr offset
GLint GLint GLint GLint GLint GLint GLint GLbitfield mask
static QT_BEGIN_NAMESPACE bool isDigit(ushort ch)
QSSGDataView< T > toDataView(const T &type)
QSSGDataRef< T > toDataRef(T &type)
size_t qHash(const QSSGShaderDefaultMaterialKey &key)
#define QSSG_MAX_NUM_LIGHTS
\inmodule QtCore \reentrant
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_lightSpotFlags[LightCount]
QSSGShaderKeyUnsigned< 4 > m_lightCount
QSSGShaderKeyBoolean m_fogEnabled
QSSGShaderKeyBoolean m_usesInstancing
void visitProperties(TVisitor &inVisitor)
QSSGShaderKeyBoolean m_blendParticles
QSSGShaderKeyBoolean m_hasLighting
@ SingleChannelImagesFirst
QSSGShaderKeyTextureChannel m_textureChannels[SingleChannelImageCount]
QSSGShaderKeyBoolean m_clearcoatEnabled
@ ClearcoatRoughnessChannel
QSSGShaderKeyBoolean m_transmissionEnabled
QSSGShaderKeyBoolean m_lightmapEnabled
QSSGShaderKeyBoolean m_usesVarColor
QSSGShaderKeyBoolean m_lightAreaFlags[LightCount]
QSSGShaderKeyBoolean m_overridesPosition
QSSGShaderKeyBoolean m_isDoubleSided
QSSGShaderKeyImageMap m_imageMaps[ImageMapCount]
QSSGShaderKeySpecularModel m_specularModel
QSSGShaderKeyBoolean m_usesFloatJointIndices
QSSGShaderKeyBoolean m_specularEnabled
QSSGShaderDefaultMaterialKeyProperties()
QSSGShaderKeyUnsigned< 8 > m_targetPositionOffset
@ SingleChannelImageCount
QSSGShaderKeyUnsigned< 16 > m_boneCount
QSSGShaderKeyBoolean m_hasIbl
qsizetype m_stringBufferSizeHint
QSSGShaderKeyUnsigned< 8 > m_targetTangentOffset
QSSGShaderKeyUnsigned< 8 > m_targetTexCoord0Offset
QSSGShaderKeyUnsigned< 8 > m_targetColorOffset
QSSGShaderKeyBoolean m_vertexColorsEnabled
QSSGShaderKeyVertexAttribute m_vertexAttributes
QSSGShaderKeyUnsigned< 8 > m_targetNormalOffset
QSSGShaderKeyBoolean m_fresnelEnabled
QSSGShaderKeyBoolean m_lightFlags[LightCount]
QSSGShaderKeyUnsigned< 8 > m_targetBinormalOffset
QSSGShaderKeyAlphaMode m_alphaMode
QSSGShaderKeyUnsigned< 8 > m_targetCount
QSSGShaderKeyBoolean m_specularGlossyEnabled
QSSGShaderKeyBoolean m_lightShadowFlags[LightCount]
QSSGShaderKeyBoolean m_usesPointsTopology
QSSGShaderKeyBoolean m_specularAAEnabled
QSSGDataRef< quint32 > m_keyStore
void visit(TPropType &prop)
StringInVisitor(const QByteArray &s, QSSGDataRef< quint32 > ks)
void visit(const TPropType &prop)
QSSGDataView< quint32 > m_keyStore
StringVisitor(QByteArray &s, QSSGDataView< 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)
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 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)
void setEnvMap(QSSGDataRef< quint32 > inKeySet, bool val)
static void internalToString(QByteArray &ioStr, const QByteArrayView &name, bool inValue)
constexpr QSSGShaderKeyPropertyBase(const char *inName="")
quint32 getOffset() const
quint32 getMaskTemplate() const
void internalToString(QByteArray &ioStr, const QByteArrayView &inBuffer) const
static bool getBoolValue(const QByteArray &str, const QByteArrayView &name)
void setOffset(quint32 of)
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