QShaderKey Class

Specifies the shading language, the version with flags, and the variant. 更多...

头: #include <QShaderKey>
CMake: find_package(Qt6 REQUIRED COMPONENTS Gui)
target_link_libraries(mytarget PRIVATE Qt6::Gui)
qmake: QT += gui
Since: Qt 6.6

公共函数

QShaderKey ()
QShaderKey (QShader::Source s , const QShaderVersion & sver , QShader::Variant svar = QShader::StandardShader)
void setSource (QShader::Source s )
void setSourceVariant (QShader::Variant svar )
void setSourceVersion (const QShaderVersion & sver )
QShader::Source source () const
QShader::Variant sourceVariant () const
QShaderVersion sourceVersion () const
size_t qHash (const QShaderKey & k , size_t seed = 0)
bool operator!= (const QShaderKey & lhs , const QShaderKey & rhs )
bool operator< (const QShaderKey & lhs , const QShaderKey & rhs )
bool operator== (const QShaderKey & lhs , const QShaderKey & rhs )

详细描述

A default constructed QShaderKey has source set to SpirvShader and sourceVersion set to 100. sourceVariant defaults to StandardShader.

注意: This is a RHI API with limited compatibility guarantees, see QShader 了解细节。

成员函数文档编制

[constexpr noexcept] QShaderKey:: QShaderKey ()

QShaderKey:: QShaderKey ( QShader::Source s , const QShaderVersion & sver , QShader::Variant svar = QShader::StandardShader)

Constructs a new QShaderKey with shader type s , version sver , and variant svar .

void QShaderKey:: setSource ( QShader::Source s )

Sets the shader type s .

另请参阅 source ().

void QShaderKey:: setSourceVariant ( QShader::Variant svar )

Sets the type of variant to use to svar .

另请参阅 sourceVariant ().

void QShaderKey:: setSourceVersion (const QShaderVersion & sver )

Sets the shading language version sver .

另请参阅 sourceVersion ().

QShader::Source QShaderKey:: source () const

Returns the shader type.

另请参阅 setSource ().

QShader::Variant QShaderKey:: sourceVariant () const

Returns the type of the variant to use.

另请参阅 setSourceVariant ().

QShaderVersion QShaderKey:: sourceVersion () const

Returns the shading language version.

另请参阅 setSourceVersion ().

相关非成员

[noexcept] size_t qHash (const QShaderKey & k , size_t seed = 0)

返回哈希值为 k ,使用 seed 做计算种子。

[noexcept] bool operator!= (const QShaderKey & lhs , const QShaderKey & rhs )

返回 false if the values in the two QShaderKey 对象 lhs and rhs 相等;否则返回 true .

[noexcept] bool operator< (const QShaderKey & lhs , const QShaderKey & rhs )

返回 true 若 lhs 小于 rhs .

Establishes a sorting order between the two keys lhs and rhs .

[noexcept] bool operator== (const QShaderKey & lhs , const QShaderKey & rhs )

返回 true 若两 QShaderKey 对象 lhs and rhs 相等。