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;
57 ioStr.append(inBuffer);
91 void setValue(QSSGDataRef<quint32> inDataStore,
bool inValue)
const
94 Q_ASSERT(idx >= 0 && idx <= INT32_MAX);
106 bool getValue(QSSGDataView<quint32> inDataStore)
const
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];
262 return (
getValue(inKeySet) & imageBit) ? true :
false;
270 theValue = theValue |
mask;
273 theValue = theValue &
mask;
346 const int strOffset = ioStr.indexOf(
name);
347 if (strOffset >= 0) {
349 if (ioStr[strOffset + nameLen] !=
'=')
351 const int codeOffsetBegin = strOffset + nameLen + 1;
353 while (ioStr[codeOffsetBegin + codeOffset] !=
';')
402 if (strOffset >= 0) {
404 if (ioStr[strOffset + nameLen] !=
'=')
406 const int codeOffsetBegin = strOffset + nameLen + 1;
408 while (ioStr[codeOffsetBegin + codeOffset] !=
';')
441 return (
getValue(inKeySet) & bit) ? true :
false;
477 if (strOffset >= 0) {
479 if (ioStr[strOffset + nameLen] !=
'=')
481 if (ioStr[strOffset + nameLen + 1] !=
'{')
483 const int codeOffsetBegin = strOffset + nameLen + 2;
485 while (ioStr[codeOffsetBegin + codeOffset] !=
'}')
488 const QVector<QByteArray>
list =
val.split(
';');
752 template<
typename TVisitor>
760 inVisitor.visit(lightFlag);
763 inVisitor.visit(lightSpotFlag);
766 inVisitor.visit(lightAreaFlag);
769 inVisitor.visit(lightShadowFlag);
791 inVisitor.visit(textureChannel);
828 template<
typename TPropType>
836 if (bit + TPropType::BitWidth > 32) {
851 size += prop.name.size();
926 template<
typename TPropType>
935 if (originalSize &&
m_str.
size() == (originalSize + 1))
946 template<
typename TPropType>
955 ioString.reserve(inProperties.m_stringBufferSizeHint);
962 inProperties.visitProperties(theVisitor);
IOBluetoothL2CAPChannel * channel
qsizetype size() const noexcept
Returns the number of bytes in this byte array.
QByteArray left(qsizetype n) const &
int toInt(bool *ok=nullptr, int base=10) const
Returns the byte array converted to an int using base base, which is ten by default.
QByteArray right(qsizetype n) const &
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 &
qsizetype size() const noexcept
qsizetype indexOf(QLatin1StringView s, qsizetype from=0, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
QString mid(qsizetype position, qsizetype n=-1) 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]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum GLuint GLenum GLsizei const GLchar * buf
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_vertexColorsMaskEnabled
QSSGShaderKeyBoolean m_lightSpotFlags[LightCount]
QSSGShaderKeyUnsigned< 4 > m_lightCount
QSSGShaderKeyBoolean m_baseColorSingleChannelEnabled
QSSGShaderKeyBoolean m_fogEnabled
QSSGShaderKeyBoolean m_usesInstancing
void visitProperties(TVisitor &inVisitor)
QSSGShaderKeyBoolean m_blendParticles
QSSGShaderKeyBoolean m_hasLighting
@ SingleChannelImagesFirst
QSSGShaderKeyTextureChannel m_textureChannels[SingleChannelImageCount]
QSSGShaderKeyBoolean m_clearcoatEnabled
QSSGShaderKeyUnsigned< 16 > m_vertexColorAlphaMask
@ 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()
QSSGShaderKeyBoolean m_usesViewIndex
QSSGShaderKeyUnsigned< 8 > m_targetPositionOffset
QSSGShaderKeyUnsigned< 16 > m_boneCount
QSSGShaderKeyBoolean m_hasIbl
@ SingleChannelImageCount
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
QSSGShaderKeyBoolean m_lightFlags[LightCount]
QSSGShaderKeyUnsigned< 8 > m_targetBinormalOffset
QSSGShaderKeyBoolean m_fresnelScaleBiasEnabled
QSSGShaderKeyUnsigned< 16 > m_vertexColorGreenMask
QSSGShaderKeyBoolean m_clearcoatFresnelScaleBiasEnabled
QSSGShaderKeyUnsigned< 3 > m_viewCount
QSSGShaderKeyAlphaMode m_alphaMode
QSSGShaderKeyBoolean m_specularSingleChannelEnabled
QSSGShaderKeyUnsigned< 8 > m_targetCount
QSSGShaderKeyBoolean m_specularGlossyEnabled
QSSGShaderKeyBoolean m_lightShadowFlags[LightCount]
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 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 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)
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