QShaderCode Class

Contains source or binary code for a shader and additional metadata. 更多...

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

公共函数

QShaderCode ()
QShaderCode (const QByteArray & code , const QByteArray & entry = QByteArray())
QByteArray entryPoint () const
void setEntryPoint (const QByteArray & entry )
void setShader (const QByteArray & code )
QByteArray shader () const
size_t qHash (const QShaderCode & k , size_t seed = 0)
bool operator!= (const QShaderCode & lhs , const QShaderCode & rhs )
bool operator== (const QShaderCode & lhs , const QShaderCode & rhs )

详细描述

shader () is empty after retrieving a QShaderCode instance from QShader , it indicates no shader code was found for the requested key.

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

成员函数文档编制

[constexpr noexcept] QShaderCode:: QShaderCode ()

QShaderCode:: QShaderCode (const QByteArray & code , const QByteArray & entry = QByteArray())

Constructs a new QShaderCode with the specified shader source code and entry point name.

QByteArray QShaderCode:: entryPoint () const

Returns the entry point name.

另请参阅 setEntryPoint ().

void QShaderCode:: setEntryPoint (const QByteArray & entry )

设置 entry point name.

另请参阅 entryPoint ().

void QShaderCode:: setShader (const QByteArray & code )

Sets the shader source or byte code .

另请参阅 shader ().

QByteArray QShaderCode:: shader () const

Returns the shader source or bytecode.

另请参阅 setShader ().

相关非成员

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

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

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

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

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

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