GLSL Struct 1.4.8
glslstruct
Loading...
Searching...
No Matches
GLSLStruct

Main group. More...

Collaboration diagram for GLSLStruct:

Topics

 Glsl type containers
 type containers are for people that want to know of which type is value stored in struct
 Glsl type visitors
 glsl type visitors
 Layout Traits
 Traits for different layouts.
 Opengl Writer
 Converts glsl struct and layout to glsl code compatible with opengl.
 Utilities
 group with utilities (not for end user to use)
 Vulkan Writer
 Converts glsl struct and layout to glsl code compatible with vulkan.

Concepts

concept  glslstruct::glsl_layout
 check if type is glsl layout
concept  glslstruct::glsl_simple
 check if type is glsl simple (is of scalar or vec or mat type)
concept  glslstruct::glsl_struct
 check if type is glsl struct
concept  glslstruct::glsl_type
 check if T is glsl type (not base_type container but derived from base_type container)
concept  glslstruct::glsl_base_type
 check if T is base_type container
concept  glslstruct::glsl_mat
 Concept defining which type can be converted to glsl mat type.
concept  glslstruct::glsl_scalar
 Concept defining which type can be converted to glsl scalar type.
concept  glslstruct::glsl_vec
 Concept defining which type can be converted to glsl vec type.

Classes

struct  glslstruct::max_alignment_layout_context
 layout context which contains max alignment of all variables More...
struct  glslstruct::struct_added_layout_context
 layout context which contains alignment of last added struct More...
struct  std::hash< glslstruct::max_alignment_layout_context >
 std::hash specialization for glslstruct::max_alignment_layout_context More...
struct  std::hash< glslstruct::struct_added_layout_context >
 std::hash specialization for glslstruct::struct_added_layout_context More...
struct  std::hash< glslstruct::scalar_layout_context >
 std::hash specialization for glslstruct::scalar_layout_context More...
struct  std::hash< glslstruct::std140_layout_context >
 std::hash specialization for glslstruct::std140_layout_context More...
struct  std::hash< glslstruct::std430_layout_context >
 std::hash specialization for glslstruct::std430_layout_context More...
class  glslstruct::mat_data
 glsl mat data container More...
struct  glslstruct::scalar_traits< bool >
 scalar_traits for bool values More...
struct  glslstruct::scalar_traits< int >
 scalar_traits for int values More...
struct  glslstruct::scalar_traits< unsigned int >
 scalar_traits for unsigned int values More...
struct  glslstruct::scalar_traits< float >
 scalar_traits for float values More...
struct  glslstruct::scalar_traits< double >
 scalar_traits for double values More...
class  glslstruct::scalar_data
 glsl scalar data container More...
class  glslstruct::vec_data
 glsl vec data container More...
struct  glslstruct::mat_traits< glm::mat< C, R, T, Q > >
 mat_traits for glm::mat values More...
struct  glslstruct::mat_traits< mstd::mat< C, R, T > >
 mat_traits for mstd::mat values More...
struct  glslstruct::vec_traits< glm::vec< L, T, Q > >
 vec_traits for glm::vec values More...
struct  glslstruct::vec_traits< mstd::vec< N, T > >
 vec_traits for mstd::vec values More...
class  glslstruct::var_data
 container for all variable data More...
class  glslstruct::base_layout< Traits >
 base layout container More...
struct  std::hash< glslstruct::base_layout< Traits > >
 std::hash overload for base_layout More...
class  glslstruct::base_parser< Layout >
 base template class of structs parser More...
class  glslstruct::base_struct< Layout >
 base class for glsl struct representation More...
struct  std::hash< glslstruct::base_struct< Layout > >
 std::hash overload for base_struct More...
struct  glslstruct::is_glsl_layout< T >
 helper struct to check if type is glsl layout More...
struct  glslstruct::is_glsl_simple< T >
 check if type is glsl simple (is of scalar or vec or mat type) More...
struct  glslstruct::is_glsl_struct< S >
 helper struct to check if type is glsl struct More...
struct  glslstruct::is_glsl_type< T >
 check if T is glsl type (not base_type container but derived from base_type container) More...
struct  glslstruct::is_glsl_base_type< T >
 check if T is base_type container More...
struct  glslstruct::mat_traits< T >
 Contains all static functions needed for layout and struct classes to interpret given mat type as glsl mat value. More...
struct  glslstruct::scalar_traits< T >
 Contains all static functions needed for layout and struct classes to interpret given scalar type as glsl scalar value. More...
struct  glslstruct::vec_traits< T >
 Contains all static functions needed for layout and struct classes to interpret given vec type as glsl vec value. More...
struct  glslstruct::glsl_value< T, Num >
 container for values for easier initialization of structs More...
struct  glslstruct::glsl_variable< T, Num >
 container for variables for easier initialization of layouts More...
struct  glslstruct::is_glsl_mat< T >
 struct with bool_constant which is true if type can be converted to glsl mat type More...
struct  glslstruct::is_glsl_scalar< T >
 struct with bool_constant which is true if type can be converted to glsl scalar type More...
struct  glslstruct::is_glsl_vec< T >
 struct with bool_constant which is true if type can be converted to glsl vec type More...

Macros

#define GLSL_STRUCT_VERSION_MAJOR   1
 glslstruct version major number
#define GLSL_STRUCT_VERSION_MINOR   4
 glslstruct version minor number
#define GLSL_STRUCT_VERSION_PATCH   8
 glslstruct version patch number
#define GLSL_STRUCT_VERSION_STRING   _GLSL_STRUCT_VERSION_TO_STRING(GLSL_STRUCT_VERSION_MAJOR, GLSL_STRUCT_VERSION_MINOR, GLSL_STRUCT_VERSION_PATCH)
 glslstruct version string
#define GLSL_STRUCT_VERSION_INT   _GLSL_STRUCT_VERSION_TO_INT(GLSL_STRUCT_VERSION_MAJOR, GLSL_STRUCT_VERSION_MINOR, GLSL_STRUCT_VERSION_PATCH)
 glslstruct version int
#define GLSL_STRUCT_VERSION   GLSL_STRUCT_VERSION_STRING
 glslstruct version string
#define GLSL_STRUCT_LAST_UPDATE_DAY   19
 glslstruct last update day
#define GLSL_STRUCT_LAST_UPDATE_MONTH   05
 glslstruct last update month
#define GLSL_STRUCT_LAST_UPDATE_YEAR   2026
 glslstruct last update year
#define GLSL_STRUCT_LAST_UPDATE_DATE
 glslstruct last update date string

Typedefs

using glslstruct::std140_parser = base_parser<std140_layout>
 parser for std140 layout
using glslstruct::std430_parser = base_parser<std430_layout>
 parser for std430 layout
using glslstruct::scalar_parser = base_parser<scalar_layout>
 parser for scalar layout
using glslstruct::std140_layout = base_layout<std140_layout_traits>
 std140 layout representation
using glslstruct::std430_layout = base_layout<std430_layout_traits>
 std430 layout representation
using glslstruct::scalar_layout = base_layout<scalar_layout_traits>
 scalar layout representation
using glslstruct::std140_struct = base_struct<std140_layout>
 std140 struct representation
using glslstruct::std430_struct = base_struct<std430_layout>
 std430 struct representation
using glslstruct::scalar_struct = base_struct<scalar_layout>
 scalar struct representation
using glslstruct::base_type_handle = std::shared_ptr<base_type>
 base_type container handle
template<class Derived>
using glslstruct::type_handle = std::shared_ptr<type<Derived> >
 type container handle
using glslstruct::scalar_type_handle = std::shared_ptr<scalar_type>
 scalar_type container handle
using glslstruct::vec_type_handle = std::shared_ptr<vec_type>
 vec_type container handle
using glslstruct::mat_type_handle = std::shared_ptr<mat_type>
 mat_type container handle
using glslstruct::array_type_handle = std::shared_ptr<array_type>
 array_type container handle
using glslstruct::struct_type_handle = std::shared_ptr<struct_type>
 struct_type container handle

Functions

_GLSL_STRUCT_EXPORT size_t glslstruct::ceil_to_nearest_multiple (size_t valueToRoundUp, size_t multipleValue) noexcept
 returns value rounded up to nearest multiple of given value
_GLSL_STRUCT_EXPORT std::string glslstruct::get_array_elem_name (std::string_view arrayName, size_t elemIdx)
 returns array elem name
_GLSL_STRUCT_EXPORT std::string glslstruct::get_struct_elem_name (std::string_view structName, std::string_view elemName)
 returns struct elem name
 glslstruct::ENUM_CLASS_BASE (ValueType, uint8_t,(Bool),(Int),(Uint),(Float),(Double)) template< class T > static _GLSL_STRUCT_CONSTEXPR17 ValueType get_value_type() noexcept _GLSL_STRUCT_REQUIRES((mstd
 Value Type Enum.
_GLSL_STRUCT_EXPORT size_t glslstruct::get_value_type_size (ValueType type)
 Returns glsl type size of scalar.

Variables

template<class T>
static _GLSL_STRUCT_CONSTEXPR17 bool glslstruct::is_glsl_layout_v = is_glsl_layout<T>::value
 check if type is glsl layout
template<class T>
static _GLSL_STRUCT_CONSTEXPR17 bool glslstruct::is_glsl_simple_v = is_glsl_scalar_v<T> || is_glsl_vec_v<T> || is_glsl_mat_v<T>
 check if type is glsl simple (is of scalar or vec or mat type)
template<class S>
static _GLSL_STRUCT_CONSTEXPR17 bool glslstruct::is_glsl_struct_v = is_glsl_struct<S>::value
 check if type is glsl struct
template<class T>
static _GLSL_STRUCT_CONSTEXPR17 bool glslstruct::is_glsl_type_v
 check if T is glsl type (not base_type container but derived from base_type container)
template<class T>
static _GLSL_STRUCT_CONSTEXPR17 bool glslstruct::is_glsl_base_type_v = std::is_same_v<base_type, mstd::remove_cvref_t<T> >
 check if T is base_type container
template<class T>
static _GLSL_STRUCT_CONSTEXPR17 bool glslstruct::is_glsl_mat_v = glsl_mat<T>
 Bool value which is true if type can be converted to glsl mat type.
template<class T>
static _GLSL_STRUCT_CONSTEXPR17 bool glslstruct::is_glsl_scalar_v = glsl_scalar<T>
 Bool value which is true if type can be converted to glsl scalar type.
template<class T>
static _GLSL_STRUCT_CONSTEXPR17 bool glslstruct::is_glsl_vec_v = glsl_vec<T>
 Bool value which is true if type can be converted to glsl vec type.

Detailed Description

Main group.

Macro Definition Documentation

◆ GLSL_STRUCT_LAST_UPDATE_DATE

#define GLSL_STRUCT_LAST_UPDATE_DATE
Value:
#define GLSL_STRUCT_LAST_UPDATE_DAY
glslstruct last update day
Definition config.hpp:94
#define GLSL_STRUCT_LAST_UPDATE_YEAR
glslstruct last update year
Definition config.hpp:104
#define GLSL_STRUCT_LAST_UPDATE_MONTH
glslstruct last update month
Definition config.hpp:99
#define _GLSL_STRUCT_LAST_UPDATE_DATE_HELPER(day, month, year)
converts last update date to string
Definition config.hpp:110

glslstruct last update date string

◆ GLSL_STRUCT_LAST_UPDATE_DAY

#define GLSL_STRUCT_LAST_UPDATE_DAY   19

glslstruct last update day

◆ GLSL_STRUCT_LAST_UPDATE_MONTH

#define GLSL_STRUCT_LAST_UPDATE_MONTH   05

glslstruct last update month

◆ GLSL_STRUCT_LAST_UPDATE_YEAR

#define GLSL_STRUCT_LAST_UPDATE_YEAR   2026

glslstruct last update year

◆ GLSL_STRUCT_VERSION

#define GLSL_STRUCT_VERSION   GLSL_STRUCT_VERSION_STRING

glslstruct version string

◆ GLSL_STRUCT_VERSION_INT

glslstruct version int

◆ GLSL_STRUCT_VERSION_MAJOR

#define GLSL_STRUCT_VERSION_MAJOR   1

glslstruct version major number

◆ GLSL_STRUCT_VERSION_MINOR

#define GLSL_STRUCT_VERSION_MINOR   4

glslstruct version minor number

◆ GLSL_STRUCT_VERSION_PATCH

#define GLSL_STRUCT_VERSION_PATCH   8

glslstruct version patch number

◆ GLSL_STRUCT_VERSION_STRING

glslstruct version string

Typedef Documentation

◆ array_type_handle

using glslstruct::array_type_handle = std::shared_ptr<array_type>

array_type container handle

◆ base_type_handle

using glslstruct::base_type_handle = std::shared_ptr<base_type>

base_type container handle

◆ mat_type_handle

using glslstruct::mat_type_handle = std::shared_ptr<mat_type>

mat_type container handle

◆ scalar_layout

scalar layout representation

◆ scalar_parser

parser for scalar layout

◆ scalar_struct

scalar struct representation

◆ scalar_type_handle

using glslstruct::scalar_type_handle = std::shared_ptr<scalar_type>

scalar_type container handle

◆ std140_layout

std140 layout representation

◆ std140_parser

parser for std140 layout

◆ std140_struct

std140 struct representation

◆ std430_layout

std430 layout representation

◆ std430_parser

parser for std430 layout

◆ std430_struct

std430 struct representation

◆ struct_type_handle

using glslstruct::struct_type_handle = std::shared_ptr<struct_type>

struct_type container handle

◆ type_handle

template<class Derived>
using glslstruct::type_handle = std::shared_ptr<type<Derived> >

type container handle

Template Parameters
Derivedderived type

◆ vec_type_handle

using glslstruct::vec_type_handle = std::shared_ptr<vec_type>

vec_type container handle

Function Documentation

◆ ceil_to_nearest_multiple()

_GLSL_STRUCT_EXPORT size_t glslstruct::ceil_to_nearest_multiple ( size_t valueToRoundUp,
size_t multipleValue )
nodiscardnoexcept

returns value rounded up to nearest multiple of given value

◆ ENUM_CLASS_BASE()

glslstruct::ENUM_CLASS_BASE ( ValueType ,
uint8_t ,
(Bool) ,
(Int) ,
(Uint) ,
(Float) ,
(Double)  )
nodiscardnoexcept

Value Type Enum.

Converts type to ValueType Enum value

Template Parameters
Ttype of scalar to convert to ValueType enum (only works for { bool, int, unsigned int, float, double })

◆ get_array_elem_name()

_GLSL_STRUCT_EXPORT std::string glslstruct::get_array_elem_name ( std::string_view arrayName,
size_t elemIdx )
nodiscard

returns array elem name

◆ get_struct_elem_name()

_GLSL_STRUCT_EXPORT std::string glslstruct::get_struct_elem_name ( std::string_view structName,
std::string_view elemName )
nodiscard

returns struct elem name

◆ get_value_type_size()

_GLSL_STRUCT_EXPORT size_t glslstruct::get_value_type_size ( ValueType type)
nodiscard

Returns glsl type size of scalar.

Parameters
typescalar value type

Variable Documentation

◆ is_glsl_base_type_v

template<class T>
_GLSL_STRUCT_CONSTEXPR17 bool glslstruct::is_glsl_base_type_v = std::is_same_v<base_type, mstd::remove_cvref_t<T> >
static

check if T is base_type container

Template Parameters
Ttype which should be a base_type

◆ is_glsl_layout_v

template<class T>
_GLSL_STRUCT_CONSTEXPR17 bool glslstruct::is_glsl_layout_v = is_glsl_layout<T>::value
static

check if type is glsl layout

Template Parameters
Ttype which is glsl layout type

◆ is_glsl_mat_v

template<class T>
_GLSL_STRUCT_CONSTEXPR17 bool glslstruct::is_glsl_mat_v = glsl_mat<T>
static

Bool value which is true if type can be converted to glsl mat type.

Template Parameters
Ttype for which converter to glsl mat type should be defined

◆ is_glsl_scalar_v

template<class T>
_GLSL_STRUCT_CONSTEXPR17 bool glslstruct::is_glsl_scalar_v = glsl_scalar<T>
static

Bool value which is true if type can be converted to glsl scalar type.

Template Parameters
Ttype for which converter to glsl scalar type should be defined

◆ is_glsl_simple_v

template<class T>
_GLSL_STRUCT_CONSTEXPR17 bool glslstruct::is_glsl_simple_v = is_glsl_scalar_v<T> || is_glsl_vec_v<T> || is_glsl_mat_v<T>
static

check if type is glsl simple (is of scalar or vec or mat type)

Template Parameters
Ttype which is glsl simple type

◆ is_glsl_struct_v

template<class S>
_GLSL_STRUCT_CONSTEXPR17 bool glslstruct::is_glsl_struct_v = is_glsl_struct<S>::value
static

check if type is glsl struct

Template Parameters
Stype which is glsl struct type

◆ is_glsl_type_v

template<class T>
_GLSL_STRUCT_CONSTEXPR17 bool glslstruct::is_glsl_type_v
static
Initial value:
=
std::is_base_of_v<base_type, mstd::remove_cvref_t<T> > && !std::is_same_v<base_type, mstd::remove_cvref_t<T> >

check if T is glsl type (not base_type container but derived from base_type container)

Template Parameters
Ttype which should be a derived from base_type but not base_type

◆ is_glsl_vec_v

template<class T>
_GLSL_STRUCT_CONSTEXPR17 bool glslstruct::is_glsl_vec_v = glsl_vec<T>
static

Bool value which is true if type can be converted to glsl vec type.

Template Parameters
Ttype for which converter to glsl vec type should be defined