26 const int shaderMatrixCount = newMaterial->viewCount();
27 const int matrixCount =
qMin(
state.projectionMatrixCount(), shaderMatrixCount);
29 for (
int viewIndex = 0; viewIndex < matrixCount; ++viewIndex) {
30 if (
state.isMatrixDirty()) {
32 memcpy(
buf->data() + 64 * viewIndex,
m.constData(), 64);
37 if (
state.isOpacityDirty()) {
38 const float opacity =
state.opacity();
39 memcpy(
buf->data() + 64 * shaderMatrixCount, &opacity, 4);
The QMatrix4x4 class represents a 4x4 transformation matrix in 3D space.
Encapsulates the current rendering state during a call to QSGMaterialShader::updateUniformData() and ...
The QSGMaterialShader class represents a graphics API independent shader program.
void setShaderFileName(Stage stage, const QString &filename)
Sets the filename for the shader for the specified stage.
The QSGMaterial class encapsulates rendering state for a shader program.
void setFlag(Flags flags, bool on=true)
Sets the flags flags on this material if on is true; otherwise clears the attribute.
RenderMode
\value RenderMode2D Normal 2D rendering \value RenderMode2DNoDepthBuffer Normal 2D rendering with dep...
QSGVertexColorMaterialRhiShader(int viewCount)
bool updateUniformData(RenderState &state, QSGMaterial *newMaterial, QSGMaterial *oldMaterial) override
This function is called by the scene graph to get the contents of the shader program's uniform buffer...
int compare(const QSGMaterial *other) const override
int QSGVertexColorMaterial::compare() const
QSGMaterialShader * createShader(QSGRendererInterface::RenderMode renderMode) const override
QSGMaterialType * type() const override
QSGVertexColorMaterial()
Creates a new vertex color material.
Combined button and popup list for selecting options.
constexpr const T & qMin(const T &a, const T &b)
GLenum GLuint GLenum GLsizei const GLchar * buf
#define QStringLiteral(str)
The QSGMaterialType class is used as a unique type token in combination with QSGMaterial.