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 & key , 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 & key , size_t seed = 0)

返迴哈希值為 key ,使用 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 相等。