Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QShaderVersion Class Reference

\inmodule QtGui More...

#include <qshader.h>

+ Collaboration diagram for QShaderVersion:

Public Types

enum  Flag { GlslEs = 0x01 }
 Describes the flags that can be set. More...
 

Public Member Functions

 QShaderVersion ()=default
 
 QShaderVersion (int v, Flags f=Flags())
 Constructs a new QShaderVersion with version v and flags f.
 
int version () const
 
void setVersion (int v)
 Sets the shading language version to v.
 
Flags flags () const
 
void setFlags (Flags f)
 Sets the flags f.
 

Related Symbols

(Note that these are not member symbols.)

bool operator== (const QShaderVersion &lhs, const QShaderVersion &rhs) noexcept
 Returns true if the two QShaderVersion objects lhs and rhs are equal.
 
bool operator< (const QShaderVersion &lhs, const QShaderVersion &rhs) noexcept
 
bool operator!= (const QShaderVersion &lhs, const QShaderVersion &rhs)
 Returns false if the values in the two QShaderVersion objects lhs and rhs are equal; otherwise returns true.
 

Detailed Description

\inmodule QtGui

Since
6.6

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:

\list

  • 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 \endlist

A default constructed QShaderVersion contains a version of 100 and no flags set.

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

Definition at line 31 of file qshader.h.

Member Enumeration Documentation

◆ Flag

Describes the flags that can be set.

\value GlslEs Indicates that GLSL/ES is meant in combination with GlslShader

Enumerator
GlslEs 

Definition at line 34 of file qshader.h.

Constructor & Destructor Documentation

◆ QShaderVersion() [1/2]

QShaderVersion::QShaderVersion ( )
default

◆ QShaderVersion() [2/2]

QShaderVersion::QShaderVersion ( int v,
Flags f = Flags() )

Constructs a new QShaderVersion with version v and flags f.

Definition at line 667 of file qshader.cpp.

Member Function Documentation

◆ flags()

QShaderVersion::Flags QShaderVersion::flags ( ) const
inline
Returns
the flags.

Definition at line 45 of file qshader.h.

Referenced by writeShaderKey().

+ Here is the caller graph for this function:

◆ setFlags()

void QShaderVersion::setFlags ( Flags f)
inline

Sets the flags f.

Definition at line 46 of file qshader.h.

Referenced by readShaderKey().

+ Here is the caller graph for this function:

◆ setVersion()

void QShaderVersion::setVersion ( int v)
inline

Sets the shading language version to v.

Definition at line 43 of file qshader.h.

Referenced by readShaderKey().

+ Here is the caller graph for this function:

◆ version()

int QShaderVersion::version ( ) const
inline
Returns
the version.

Definition at line 42 of file qshader.h.

Referenced by toMetalLanguageVersion(), and writeShaderKey().

+ Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ operator!=()

bool operator!= ( const QShaderVersion & lhs,
const QShaderVersion & rhs )
related

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

Definition at line 216 of file qshader.h.

◆ operator<()

bool operator< ( const QShaderVersion & lhs,
const QShaderVersion & rhs )
related
Returns
true if lhs is smaller than rhs.

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

Definition at line 841 of file qshader.cpp.

◆ operator==()

bool operator== ( const QShaderVersion & lhs,
const QShaderVersion & rhs )
related

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

Definition at line 822 of file qshader.cpp.


The documentation for this class was generated from the following files: