5#include <private/qsgtexture_p.h>
26 const int matrixCount =
qMin(
state.projectionMatrixCount(), newMaterial->viewCount());
28 for (
int viewIndex = 0; viewIndex < matrixCount; ++viewIndex) {
29 if (
state.isMatrixDirty()) {
31 memcpy(
buf->data() + 64 * viewIndex,
m.constData(), 64);
48 Q_ASSERT(oldMaterial ==
nullptr || newMaterial->type() == oldMaterial->type());
72 t->commitTextureOperations(
state.rhi(),
state.resourceUpdateBatch());
128 , m_anisotropy_level(
QSGTexture::AnisotropyNone)
283 return diff < 0 ? -1 : 1;
352 bool changed =
false;
354 const int shaderMatrixCount = newMaterial->viewCount();
356 if (
state.isOpacityDirty()) {
357 const float opacity =
state.opacity();
358 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.
void updateSampledImage(RenderState &state, int binding, QSGTexture **texture, QSGMaterial *newMaterial, QSGMaterial *oldMaterial) override
This function is called by the scene graph to prepare use of sampled images in the shader,...
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...
QSGOpaqueTextureMaterialRhiShader(int viewCount)
The QSGOpaqueTextureMaterial class provides a convenient way of rendering textured geometry in the sc...
QSGMaterialShader * createShader(QSGRendererInterface::RenderMode renderMode) const override
QSGTexture::AnisotropyLevel anisotropyLevel() const
Returns this material's anistropy level.
QSGOpaqueTextureMaterial()
Creates a new QSGOpaqueTextureMaterial.
QSGTexture::WrapMode verticalWrapMode() const
Returns this material's vertical wrap mode.
int compare(const QSGMaterial *other) const override
QSGTexture::Filtering filtering() const
Returns this material's filtering mode.
void setTexture(QSGTexture *texture)
Sets the texture of this material to texture.
QSGTexture::WrapMode horizontalWrapMode() const
Returns this material's horizontal wrap mode.
QSGTexture::Filtering mipmapFiltering() const
Returns this material's mipmap filtering mode.
QSGMaterialType * type() const override
QSGTexture * texture() const
Returns this texture material's texture.
RenderMode
\value RenderMode2D Normal 2D rendering \value RenderMode2DNoDepthBuffer Normal 2D rendering with dep...
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...
QSGTextureMaterialRhiShader(int viewCount)
QSGMaterialType * type() const override
QSGMaterialShader * createShader(QSGRendererInterface::RenderMode renderMode) const override
void setFiltering(Filtering filter)
Sets the sampling mode to filter.
virtual bool hasAlphaChannel() const =0
Returns true if the texture data contains an alpha channel.
virtual qint64 comparisonKey() const =0
Returns a key suitable for comparing textures.
Combined button and popup list for selecting options.
constexpr const T & qMin(const T &a, const T &b)
GLint GLint GLint GLint GLint x
[0]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLenum GLuint GLenum GLsizei const GLchar * buf
static bool isPowerOfTwo(int x)
static bool isNpot(int width, int height=1, int depth=1)
static QT_BEGIN_NAMESPACE bool isPowerOfTwo(int x)
#define QStringLiteral(str)
The QSGMaterialType class is used as a unique type token in combination with QSGMaterial.