QShaderVersion Class
Specifies the shading language version. More...
Header: | #include <QShaderVersion> |
qmake: | QT += rhi |
Public Types
Public Functions
QShaderVersion() | |
QShaderVersion(int v, QShaderVersion::Flags f = ...) | |
QShaderVersion::Flags | flags() const |
void | setFlags(QShaderVersion::Flags f) |
void | setVersion(int v) |
int | version() const |
Related Non-Members
bool | operator!=(const QShaderVersion &lhs, const QShaderVersion &rhs) |
bool | operator==(const QShaderVersion &lhs, const QShaderVersion &rhs) |
Detailed Description
Specifies the shading language version.
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:
- Vulkan (SPIR-V): 100
- OpenGL: 120, 330, 440, etc.
- OpenGL ES: 100 with GlslEs, 300 with GlslEs, etc.
- Direct3D: 50, 51, 60
- Metal: 12, 20
A default constructed QShaderVersion contains a version of 100 and no flags set.
Member Type Documentation
enum QShaderVersion::Flag
flags QShaderVersion::Flags
Describes the flags that can be set.
Constant | Value | Description |
---|---|---|
QShaderVersion::GlslEs | 0x01 | Indicates that GLSL/ES is meant in combination with GlslShader |
The Flags type is a typedef for QFlags<Flag>. It stores an OR combination of Flag values.
Property Documentation
Member Function Documentation
QShaderVersion::QShaderVersion()
Default constructs an instance of QShaderVersion.
QShaderVersion::QShaderVersion(int v, QShaderVersion::Flags f = ...)
Default constructs an instance of QShaderVersion.
QShaderVersion::Flags QShaderVersion::flags() const
See also setFlags().
void QShaderVersion::setFlags(QShaderVersion::Flags f)
See also flags().
void QShaderVersion::setVersion(int v)
See also version().
int QShaderVersion::version() const
See also setVersion().
Member Variable Documentation
Related Non-Members
bool operator!=(const QShaderVersion &lhs, const QShaderVersion &rhs)
Returns false
if the values in the two QShaderVersion objects a and b are equal; otherwise returns true
.
bool operator==(const QShaderVersion &lhs, const QShaderVersion &rhs)
Returns true
if the two QShaderVersion objects a and b are equal.