GLSL Struct 1.4.0
glslstruct
Loading...
Searching...
No Matches
glslstruct Namespace Reference

Main namespace of glslstruct library. More...

Namespaces

namespace  uitls
 Utility namespace of glslstruct library.
namespace  utils

Classes

struct  scalar_layout_context
 Scalar Layout additional context. More...
struct  scalar_layout_traits
 Scalar Layout traits. More...
struct  std140_layout_context
 Std140 Layout additional context. More...
struct  std140_layout_traits
 Std140 Layout traits. More...
struct  std430_layout_context
 Std430 Layout additional context. More...
struct  std430_layout_traits
 Std430 Layout traits. More...
class  array_type
 array type container More...
class  mat_type
 mat type container More...
class  scalar_type
 scalar type container More...
class  vec_type
 vec type container More...
class  base_type
 base class for all glsl type containers More...
class  type_hash_visitor
 visitor which calculate has of type More...
class  struct_type
 struct type container More...
class  mat_data
 glsl mat data container More...
struct  scalar_traits< bool >
 scalar_traits for bool values More...
struct  scalar_traits< int >
 scalar_traits for int values More...
struct  scalar_traits< unsigned int >
 scalar_traits for unsigned int values More...
struct  scalar_traits< float >
 scalar_traits for float values More...
struct  scalar_traits< double >
 scalar_traits for double values More...
class  scalar_data
 glsl scalar data container More...
class  vec_data
 glsl vec data container More...
struct  mat_traits< glm::mat< C, R, T, Q > >
 mat_traits for glm::mat values More...
struct  mat_traits< mstd::mat< C, R, T > >
 mat_traits for mstd::mat values More...
struct  vec_traits< glm::vec< L, T, Q > >
 vec_traits for glm::vec values More...
struct  vec_traits< mstd::vec< N, T > >
 vec_traits for mstd::vec values More...
class  type
 intermediate glsl type containers More...
class  var_data
 container for all variable data More...
struct  glsl_variable
 container for variables for easier initialization of layouts More...
struct  glsl_value
 container for values for easier initialization of structs More...
struct  is_type_visitor
 struct with bool_constant which is true if type T is type visitor More...
class  glsl_opengl_writer
 struct to opengl glsl writer More...
class  glsl_vulkan_writer
 struct to vulkan glsl writer More...
class  base_layout
 base layout container More...
struct  max_alignment_layout_context
 layout context which contains max alignment of all variables More...
struct  struct_added_layout_context
 layout context which contains alignment of last added struct More...
struct  is_layout_traits
 Type trait to check if T is a valid layout trait. More...
class  base_parser
 base template class of structs parser More...
class  base_struct
 base class for glsl struct representation More...
struct  mat_traits
 Contains all static functions needed for layout and struct classes to interpret given mat type as glsl mat value. More...
struct  scalar_traits
 Contains all static functions needed for layout and struct classes to interpret given scalar type as glsl scalar value. More...
struct  vec_traits
 Contains all static functions needed for layout and struct classes to interpret given vec type as glsl vec value. More...
class  eq_type_visitor
 visitor which checks if value glsl type A is equal to glsl type B More...

Concepts

concept  type_visitor
 glsl type visitor concept
concept  layout_traits
 The primary concept for GLSL layout trait definitions.

Typedefs

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

Functions

size_t ceil_to_nearest_multiple (size_t valueToRoundUp, size_t multipleValue) noexcept
 returns value rounded up to nearest multiple of given value
std::string get_array_elem_name (std::string_view arrayName, size_t elemIdx)
 returns array elem name
std::string get_struct_elem_name (std::string_view structName, std::string_view elemName)
 returns struct elem name
bool operator== (const array_type &lhs, const array_type &rhs)
 checks if two array types are equal
bool operator!= (const array_type &lhs, const array_type &rhs)
 checks if two array types are not equal
bool operator== (const mat_type &lhs, const mat_type &rhs)
 checks if two mats types are equal
bool operator!= (const mat_type &lhs, const mat_type &rhs)
 checks if two mats types are not equal
bool operator== (const scalar_type &lhs, const scalar_type &rhs)
 checks if two scalar types are equal
bool operator!= (const scalar_type &lhs, const scalar_type &rhs)
 checks if two scalar types are not equal
bool operator== (const vec_type &lhs, const vec_type &rhs)
 checks if two vec types are equal
bool operator!= (const vec_type &lhs, const vec_type &rhs)
 checks if two vec types are not equal
size_t sizeof_type (const base_type_handle &type) noexcept
 returns size of given type
template<utils::glsl_type T>
size_t sizeof_type (const std::shared_ptr< T > &type) noexcept
 returns size of given type
std::string to_string (const base_type_handle &type) noexcept
 converts type to string
template<utils::glsl_type T>
std::string to_string (const std::shared_ptr< T > &type) noexcept
 converts type to string
template<utils::glsl_type T>
_GLSL_STRUCT_CONSTEXPR20 bool operator== (const base_type &lhs, const T &rhs)
 checks if types are equal
template<utils::glsl_type T>
_GLSL_STRUCT_CONSTEXPR20 bool operator!= (const base_type &lhs, const T &rhs)
 checks if types are not equal
bool operator== (const struct_type &lhs, const struct_type &rhs)
 checks if two struct types are equal
bool operator!= (const struct_type &lhs, const struct_type &rhs)
 checks if two struct types are not equal
template<utils::glsl_scalar T>
static ValueType get_scalar_value_type () noexcept
 returns ValueType of T based on scalar_traits
template<utils::glsl_scalar T>
static scalar_data get_scalar_data (const T &value)
 returns scalar_data of T based on scalar_traits
template<utils::glsl_scalar T>
static T get_scalar_value (const scalar_data &data)
 returns value of type T from scalar_data based on scalar_traits
std::string scalar_to_string (ValueType valueType)
 returns glsl scalar type string
template<utils::glsl_scalar T>
static std::string scalar_to_string ()
 returns glsl scalar type string from type T based on scalar_traits
template<utils::glsl_mat T>
static _GLSL_STRUCT_INLINE17 _GLSL_STRUCT_CONSTEXPR17 size_t get_mat_columns () noexcept
 returns number of columns of T based on mat_traits
template<utils::glsl_mat T>
static _GLSL_STRUCT_INLINE17 _GLSL_STRUCT_CONSTEXPR17 size_t get_mat_rows () noexcept
 returns number of rows of T based on mat_traits
template<utils::glsl_mat T>
static _GLSL_STRUCT_INLINE17 _GLSL_STRUCT_CONSTEXPR17 ValueType get_mat_value_type () noexcept
 returns ValueType of T based on mat_traits
template<utils::glsl_mat T>
static mat_data get_mat_data (const T &value)
 returns mat_data of T based on mat_traits
template<utils::glsl_mat T>
static T get_mat_value (const mat_data &data)
 returns mat value of type T from mat_data based on mat_traits
std::string mat_to_string (ValueType valueType, size_t columns, size_t rows)
 returns glsl mat type string
template<utils::glsl_mat T>
static std::string mat_to_string ()
 returns glsl mat type string from type T based on mat_traits
template<utils::glsl_vec T>
static size_t get_vec_length () noexcept
 returns length of T based on vec_traits
template<utils::glsl_vec T>
static ValueType get_vec_value_type () noexcept
 returns ValueType of T based on vec_traits
template<utils::glsl_vec T>
static vec_data get_vec_data (const T &value)
 returns vec_data of T based on vec_traits
template<utils::glsl_vec T>
static T get_vec_value (const vec_data &data)
 returns vec value of type T from vec_data based on vec_traits
std::string vec_to_string (ValueType valueType, size_t length)
 returns glsl vec type string
template<utils::glsl_vec T>
static std::string vec_to_string ()
 returns glsl vec type string from type T based on vec_traits
template<utils::glsl_type T>
_GLSL_STRUCT_INLINE17 _GLSL_STRUCT_CONSTEXPR20 bool is_of_type (const base_type_handle &type)
 requests is_of_type visitor to visit base_type
template<utils::glsl_type T>
_GLSL_STRUCT_INLINE17 _GLSL_STRUCT_CONSTEXPR20 bool is_of_type (const std::shared_ptr< T > &)
 requests is_of_type visitor to visit any glsl type
bool is_of_type (const base_type_handle &type, BaseType baseType)
 requests is_of_type visitor to visit base_type
template<utils::glsl_type T>
_GLSL_STRUCT_INLINE17 _GLSL_STRUCT_CONSTEXPR20 bool is_of_type (const std::shared_ptr< T > &, const BaseType baseType)
 requests is_of_type visitor to visit any glsl type
template<utils::glsl_type T>
std::shared_ptr< T > dynamic_type_cast (const base_type_handle &type)
 checks if base_type is of given type and returns handle to this type or nullptr if it is not
template<utils::glsl_type T>
base_type_handle dynamic_type_cast (const std::shared_ptr< T > &type)
 converts any glsl type handle to base_type handle
template<utils::glsl_type T>
_GLSL_STRUCT_INLINE17 _GLSL_STRUCT_CONSTEXPR20 std::shared_ptr< T > static_type_cast (const base_type_handle &type)
 checks if base_type is of given type and returns handle to this type or error if it is not
template<utils::glsl_type T>
base_type_handle static_type_cast (const std::shared_ptr< T > &type)
 converts any glsl type handle to base_type handle
template<class DerivedA, class DerivedB>
_GLSL_STRUCT_CONSTEXPR17 bool operator== (const type< DerivedA > &lhs, const type< DerivedB > &rhs)
 equal operator for two intermediate types
template<class DerivedA, class DerivedB>
_GLSL_STRUCT_CONSTEXPR17 bool operator!= (const type< DerivedA > &lhs, const type< DerivedB > &rhs)
 not equal operator for two intermediate types
 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.
size_t get_value_type_size (ValueType type)
 Returns glsl type size of scalar.

Variables

template<class T>
static _GLSL_STRUCT_CONSTEXPR17 bool is_type_visitor_v = type_visitor<T>
 bool which is true if type T is type visitor
template<class T>
static _GLSL_STRUCT_CONSTEXPR17 bool is_layout_traits_v = layout_traits<T>
 Compile-time constant to check if T is a valid layout trait.

Detailed Description

Main namespace of glslstruct library.

Function Documentation

◆ get_mat_columns()

template<utils::glsl_mat T>
_GLSL_STRUCT_INLINE17 _GLSL_STRUCT_CONSTEXPR17 size_t glslstruct::get_mat_columns ( )
staticnoexcept

returns number of columns of T based on mat_traits

◆ get_mat_data()

template<utils::glsl_mat T>
mat_data glslstruct::get_mat_data ( const T & value)
inlinestatic

returns mat_data of T based on mat_traits

◆ get_mat_rows()

template<utils::glsl_mat T>
_GLSL_STRUCT_INLINE17 _GLSL_STRUCT_CONSTEXPR17 size_t glslstruct::get_mat_rows ( )
staticnoexcept

returns number of rows of T based on mat_traits

◆ get_mat_value()

template<utils::glsl_mat T>
T glslstruct::get_mat_value ( const mat_data & data)
inlinestatic

returns mat value of type T from mat_data based on mat_traits

◆ get_mat_value_type()

template<utils::glsl_mat T>
_GLSL_STRUCT_INLINE17 _GLSL_STRUCT_CONSTEXPR17 ValueType glslstruct::get_mat_value_type ( )
staticnoexcept

returns ValueType of T based on mat_traits

◆ get_scalar_data()

template<utils::glsl_scalar T>
scalar_data glslstruct::get_scalar_data ( const T & value)
inlinestatic

returns scalar_data of T based on scalar_traits

◆ get_scalar_value()

template<utils::glsl_scalar T>
T glslstruct::get_scalar_value ( const scalar_data & data)
inlinestatic

returns value of type T from scalar_data based on scalar_traits

◆ get_scalar_value_type()

template<utils::glsl_scalar T>
ValueType glslstruct::get_scalar_value_type ( )
inlinestaticnoexcept

returns ValueType of T based on scalar_traits

◆ get_vec_data()

template<utils::glsl_vec T>
vec_data glslstruct::get_vec_data ( const T & value)
inlinestatic

returns vec_data of T based on vec_traits

◆ get_vec_length()

template<utils::glsl_vec T>
size_t glslstruct::get_vec_length ( )
inlinestaticnoexcept

returns length of T based on vec_traits

◆ get_vec_value()

template<utils::glsl_vec T>
T glslstruct::get_vec_value ( const vec_data & data)
inlinestatic

returns vec value of type T from vec_data based on vec_traits

◆ get_vec_value_type()

template<utils::glsl_vec T>
ValueType glslstruct::get_vec_value_type ( )
inlinestaticnoexcept

returns ValueType of T based on vec_traits

◆ mat_to_string() [1/2]

template<utils::glsl_mat T>
std::string glslstruct::mat_to_string ( )
inlinestatic

returns glsl mat type string from type T based on mat_traits

◆ mat_to_string() [2/2]

std::string glslstruct::mat_to_string ( ValueType valueType,
size_t columns,
size_t rows )

returns glsl mat type string

◆ scalar_to_string() [1/2]

template<utils::glsl_scalar T>
std::string glslstruct::scalar_to_string ( )
inlinestatic

returns glsl scalar type string from type T based on scalar_traits

◆ scalar_to_string() [2/2]

std::string glslstruct::scalar_to_string ( ValueType valueType)

returns glsl scalar type string

◆ vec_to_string() [1/2]

template<utils::glsl_vec T>
std::string glslstruct::vec_to_string ( )
inlinestatic

returns glsl vec type string from type T based on vec_traits

◆ vec_to_string() [2/2]

std::string glslstruct::vec_to_string ( ValueType valueType,
size_t length )

returns glsl vec type string