5#include <private/qsgtexture_p.h>
27 if (
state.isMatrixDirty()) {
29 memcpy(
buf->data(),
m.constData(), 64);
45 Q_ASSERT(oldMaterial ==
nullptr || newMaterial->
type() == oldMaterial->
type());
69 t->commitTextureOperations(
state.rhi(),
state.resourceUpdateBatch());
125 , m_anisotropy_level(
QSGTexture::AnisotropyNone)
280 return diff < 0 ? -1 : 1;
348 bool changed =
false;
351 if (
state.isOpacityDirty()) {
352 const float opacity =
state.opacity();
353 memcpy(
buf->data() + 64, &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.
virtual QSGMaterialType * type() const =0
This function is called by the scene graph to query an identifier that is unique to the QSGMaterialSh...
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()
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()
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.
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.