Specifies the shading language version. 更多...
头: | #include <QShaderVersion> |
CMake: |
find_package(Qt6 REQUIRED COMPONENTS Gui)
target_link_libraries(mytarget PRIVATE Qt6::Gui) |
qmake: | QT += gui |
Since: | Qt 6.6 |
enum | Flag { GlslEs } |
flags | Flags |
QShaderVersion () | |
QShaderVersion (int v , QShaderVersion::Flags f = Flags()) | |
QShaderVersion::Flags | flags () const |
void | setFlags (QShaderVersion::Flags f ) |
void | setVersion (int v ) |
int | version () const |
bool | operator!= (const QShaderVersion & lhs , const QShaderVersion & rhs ) |
bool | operator< (const QShaderVersion & lhs , const QShaderVersion & rhs ) |
bool | operator== (const QShaderVersion & lhs , const QShaderVersion & rhs ) |
While languages like SPIR-V or the Metal Shading Language use traditional version numbers, shaders for other APIs can use slightly different versioning schemes. All those are mapped to a single version number in here, however. For HLSL, the version refers to the Shader Model version, like 5.0, 5.1, or 6.0. For GLSL an additional flag is needed to choose between GLSL and GLSL/ES.
Below is a list with the most common examples of shader versions for different graphics APIs:
A default constructed QShaderVersion contains a version of 100 and no flags set.
注意: This is a RHI API with limited compatibility guarantees, see QShader 了解细节。
Describes the flags that can be set.
常量 | 值 | 描述 |
---|---|---|
QShaderVersion::GlslEs
|
0x01
|
Indicates that GLSL/ES is meant in combination with GlslShader |
Flags 类型是 typedef 对于 QFlags <Flag>。它存储 Flag 值的 OR 组合。
[constexpr noexcept]
QShaderVersion::
QShaderVersion
()
Constructs a new QShaderVersion with version v and flags f .
Returns the flags.
另请参阅 setFlags ().
Sets the flags f .
另请参阅 flags ().
Sets the shading language version to v .
另请参阅 version ().
Returns the version.
另请参阅 setVersion ().
[noexcept]
bool
operator!=
(const
QShaderVersion
&
lhs
, const
QShaderVersion
&
rhs
)
返回
false
if the values in the two
QShaderVersion
对象
lhs
and
rhs
相等;否则返回
true
.
[noexcept]
bool
operator<
(const
QShaderVersion
&
lhs
, const
QShaderVersion
&
rhs
)
返回 true 若 lhs 小于 rhs .
Establishes a sorting order between the two QShaderVersion lhs and rhs .
[noexcept]
bool
operator==
(const
QShaderVersion
&
lhs
, const
QShaderVersion
&
rhs
)
返回
true
若两
QShaderVersion
对象
lhs
and
rhs
相等。