PySide6.QtGui.QShaderVersion

class QShaderVersion

Specifies the shading language version.

Details

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.

Note

This is a RHI API with limited compatibility guarantees, see QShader for details.

Added in version 6.6.

Synopsis

Methods

Note

This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE

class Flag

(inherits enum.Flag) Describes the flags that can be set.

Constant

Description

QShaderVersion.Flag.GlslEs

Indicates that GLSL/ES is meant in combination with GlslShader

__init__()
__init__(v[, f=QShaderVersion.Flags()])
Parameters:
  • v – int

  • f – Combination of Flag

Constructs a new QShaderVersion with version v and flags f.

flags()
Return type:

Combination of Flag

Returns the flags.

See also

setFlags()

__ne__(rhs)
Parameters:

rhsQShaderVersion

Return type:

bool

Returns false if the values in the two QShaderVersion objects lhs and rhs are equal; otherwise returns true.

__lt__(rhs)
Parameters:

rhsQShaderVersion

Return type:

bool

Returns true if lhs is smaller than rhs.

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

__eq__(rhs)
Parameters:

rhsQShaderVersion

Return type:

bool

Returns true if the two QShaderVersion objects lhs and rhs are equal.

setFlags(f)
Parameters:

f – Combination of Flag

Sets the flags f.

See also

flags()

setVersion(v)
Parameters:

v – int

Sets the shading language version to v.

See also

version()

version()
Return type:

int

Returns the version.

See also

setVersion()