|
GLSL Struct 1.4.0
glslstruct
|
group with utilities (not for end user to use) More...
Concepts | |
| concept | glslstruct::utils::has_layout_traits_context |
| Checks if a type T provides a nested 'context_type'. | |
| concept | glslstruct::utils::layout_traits_get_alignment |
| Validates that T provides mandatory alignment calculation methods. | |
| concept | glslstruct::utils::layout_traits_before_add |
| Validates optional "before_add" hooks. | |
| concept | glslstruct::utils::layout_traits_after_add |
| Validates optional "after_add" hooks. | |
| concept | glslstruct::utils::has_ubo_pattern |
| concept for check if layout can be used as ubo | |
| concept | glslstruct::utils::has_ssbo_pattern |
| concept for check if layout can be used as ssbo | |
| concept | glslstruct::utils::glsl_layout |
| check if type is glsl layout | |
| concept | glslstruct::utils::glsl_simple_or_layout |
| check if type is glsl layout or glsl simple | |
| concept | glslstruct::utils::glsl_simple |
| check if type is glsl simple (is of scalar or vec or mat type) | |
| concept | glslstruct::utils::glsl_simples_array |
| check if type is array of glsl simple (scalar or vec or mat type) | |
| concept | glslstruct::utils::glsl_simples_static_size_array |
| check if type is static size array of glsl simple (scalar or vec or mat type) | |
| concept | glslstruct::utils::glsl_struct |
| check if type is glsl struct | |
| concept | glslstruct::utils::glsl_structs_array |
| check if type is array of glsl structs | |
| concept | glslstruct::utils::glsl_layout_struct |
| check if type is glsl struct with required layout | |
| concept | glslstruct::utils::glsl_layout_structs_array |
| check if type is array of glsl structs with required layout | |
| concept | glslstruct::utils::glsl_simple_or_layout_struct |
| check if type is glsl struct with required layout or simple type | |
| concept | glslstruct::utils::glsl_simple_or_struct |
| check if type is glsl struct or simple type | |
| concept | glslstruct::utils::glsl_type |
| check if T is glsl type (not base_type container but derived from base_type container) | |
| concept | glslstruct::utils::glsl_base_type |
| check if T is base_type container | |
| concept | glslstruct::utils::glsl_mat |
| Concept defining which type can be converted to glsl mat type. | |
| concept | glslstruct::utils::glsl_mats_array |
| Concept which is true if type V is array of types that passes is_glsl_mat test. | |
| concept | glslstruct::utils::glsl_mats_static_size_array |
| Concept which is true if type V is static size array of types that passes is_glsl_mat test. | |
| concept | glslstruct::utils::glsl_scalar |
| Concept defining which type can be converted to glsl scalar type. | |
| concept | glslstruct::utils::glsl_scalars_array |
| Concept which is true if type V is array of types that passes is_glsl_scalar test. | |
| concept | glslstruct::utils::glsl_scalars_static_size_array |
| Concept which is true if type V is static size array of types that passes is_glsl_scalar test. | |
| concept | glslstruct::utils::glsl_vec |
| Concept defining which type can be converted to glsl vec type. | |
| concept | glslstruct::utils::glsl_vecs_array |
| Concept which is true if type V is array of types that passes is_glsl_vec test. | |
| concept | glslstruct::utils::glsl_vecs_static_size_array |
| Concept which is true if type V is static size array of types that passes is_glsl_vec test. | |
| concept | glslstruct::utils::array |
| Array concept. | |
| concept | glslstruct::utils::static_size_array |
| Static size array concept. | |
Classes | |
| class | glslstruct::utils::glsl_var_type_getter |
| type visitor which returns variable type More... | |
| class | glslstruct::utils::glsl_array_count_getter |
| type visitor which gets array and sub arrays counts in format [0][1]... More... | |
| class | glslstruct::utils::glsl_writer |
| general glsl writer More... | |
| struct | glslstruct::utils::layout_with_context< Traits > |
| Context container for layout. More... | |
| struct | glslstruct::utils::layout_without_context |
| empty container for layout More... | |
| struct | glslstruct::utils::base_parser_patterns |
| all parser patterns in one struct More... | |
| struct | glslstruct::utils::ubo_parser_pattern< Layout > |
| container for ubo parser pattern More... | |
| struct | glslstruct::utils::ubo_parser_pattern< std140_layout > |
| template overload of container for ubo parser pattern for std140 layout More... | |
| struct | glslstruct::utils::ssbo_parser_pattern< Layout > |
| container for ssbo parser pattern More... | |
| struct | glslstruct::utils::ssbo_parser_pattern< std140_layout > |
| template overload of container for ssbo parser pattern for std140 layout More... | |
| struct | glslstruct::utils::ssbo_parser_pattern< std430_layout > |
| template overload of container for ssbo parser pattern for std430 layout More... | |
| struct | glslstruct::utils::ssbo_parser_pattern< scalar_layout > |
| template overload of container for ssbo parser pattern for scalar layout More... | |
| struct | glslstruct::utils::is_glsl_layout< T > |
| helper struct to check if type is glsl layout More... | |
| struct | glslstruct::utils::is_glsl_struct< S > |
| helper struct to check if type is glsl struct More... | |
| struct | glslstruct::utils::is_glsl_layout_struct< S, Layout > |
| helper struct to check if type is glsl struct with required layout More... | |
| struct | glslstruct::utils::array_traits< T > |
| Array Traits. More... | |
| struct | glslstruct::utils::array_traits< std::vector< T > > |
| Array Traits overload for std::vector. More... | |
| struct | glslstruct::utils::array_traits< std::array< T, N > > |
| Array Traits overload for std::array. More... | |
| struct | glslstruct::utils::array_traits< T[N]> |
| Array Traits overload for c-style array. More... | |
| struct | glslstruct::utils::array_traits< T(*)[N]> |
| Array Traits overload for pointer to c-style array. More... | |
| struct | glslstruct::utils::array_traits< std::span< T > > |
| Array Traits overload for std::span. More... | |
| struct | glslstruct::utils::is_static_size_array_of_impl< Test, T, IsArray, Args > |
| helper struct for is_static_size_array_of_v check More... | |
| struct | glslstruct::utils::is_static_size_array_of< Test, T, Args > |
| checks if value type is array of type and if type passes given test template struct More... | |
| struct | glslstruct::utils::single_value< T > |
| container for single values More... | |
| struct | glslstruct::utils::array_value< T, Num > |
| container for array values More... | |
| struct | glslstruct::utils::struct_array_value< T, Num > |
| container for array of structs More... | |
| struct | glslstruct::utils::standard_variable |
| container for standard variables More... | |
| struct | glslstruct::utils::layout_variable< Layout > |
| container for layout variables More... | |
| struct | glslstruct::utils::is_glsl_mat< T > |
| struct with bool_constant which is true if type can be converted to glsl mat type More... | |
| struct | glslstruct::utils::is_glsl_scalar< T > |
| struct with bool_constant which is true if type can be converted to glsl scalar type More... | |
| struct | glslstruct::utils::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_STRINGIFY_HELPER(x) |
| stringify helper | |
| #define | _GLSL_STRUCT_VERSION_TO_STRING(major, minor, patch) |
| converts version numbers to string | |
| #define | _GLSL_STRUCT_VERSION_TO_INT(major, minor, patch) |
| converts version number to int | |
| #define | _GLSL_STRUCT_LAST_UPDATE_DATE_HELPER(day, month, year) |
| converts last update date to string | |
| #define | _GLSL_STRUCT_HAS_CXX17 __cplusplus >= 201703l |
| check if compiler has c++ version greater or equal to c++17 | |
| #define | _GLSL_STRUCT_HAS_CXX20 0 |
| check if compiler has c++ version greater or equal to c++20 and if user enabled c++20 features using GLSL_STRUCT_ENABLE_CXX20 | |
| #define | _GLSL_STRUCT_HAS_TYPES _GLSL_STRUCT_HAS_CXX17 |
| check if user not disabled type containers using GLSL_STRUCT_DISABLE_TYPES | |
| #define | _GLSL_STRUCT_HAS_TYPE_CHECKS 0 |
| check if user enabled type checks for struct getters using GLSL_STRUCT_ENABLE_TYPE_CHECKS (remember it only works if GLSL_STRUCT_DISABLE_TYPES was not set) | |
| #define | _GLSL_STRUCT_HAS_PARSER _GLSL_STRUCT_HAS_CXX17 |
| check if user want to include parser functionality | |
| #define | _GLSL_STRUCT_CONSTEXPR17 constexpr |
| constexpr for c++17 and higher | |
| #define | _GLSL_STRUCT_CONSTEXPR20 constexpr |
| constexpr keyword for c++20 and higher | |
| #define | _GLSL_STRUCT_REQUIRES(condition) |
| requires keyword for c++20 and higher | |
| #define | _GLSL_STRUCT_MESSAGE(MESSAGE) |
| compiler message | |
| #define | _GLSL_STRUCT_WARNING(MESSAGE) |
| compiler warning | |
| #define | _GLSL_STRUCT_ERROR(MESSAGE) |
| compiler error | |
| #define | glsl_struct_assert(expression, ...) |
| glslstruct assert | |
Typedefs | |
| template<array T> | |
| using | glslstruct::utils::array_value_type_t = _GLSL_STRUCT_TYPENAME17 array_traits<T>::value_type |
| get value_type of array | |
Functions | |
| std::string | glslstruct::utils::get_glsl_var_type_string (const base_type_handle &varType, const mstd::ordered_map< struct_type, std::string > &structsNames) |
| returns variable type | |
| std::string | glslstruct::utils::get_glsl_array_count_string (const base_type_handle &varType, bool canBeVariableSize) |
| returns array counts string | |
| std::string | glslstruct::utils::get_glsl_variable_string (std::string_view name, const base_type_handle &varType, bool canBeVariableSize, const mstd::ordered_map< struct_type, std::string > &structsNames) |
| returns variable line type name[0][1]... | |
| template<array T> | |
| static _GLSL_STRUCT_CONSTEXPR17 const array_value_type_t< T > * | glslstruct::utils::get_array_data (const T &value) |
| get pointer to data of array | |
| template<array T> | |
| static _GLSL_STRUCT_CONSTEXPR17 size_t | glslstruct::utils::get_array_size (const T &value) |
| get size of array | |
Variables | |
| template<class Layout> | |
| static _GLSL_STRUCT_CONSTEXPR17 bool | glslstruct::utils::has_ubo_pattern_v = has_ubo_pattern<Layout> |
| returns true if layout can be used as ubo | |
| template<class Layout> | |
| static _GLSL_STRUCT_CONSTEXPR17 bool | glslstruct::utils::has_ssbo_pattern_v = has_ssbo_pattern<Layout> |
| returns true if layout can be used as ssbo | |
| template<class T> | |
| static _GLSL_STRUCT_CONSTEXPR17 bool | glslstruct::utils::is_glsl_layout_v = is_glsl_layout<T>::value |
| check if type is glsl layout | |
| template<class T> | |
| static _GLSL_STRUCT_CONSTEXPR17 bool | glslstruct::utils::is_glsl_simple_or_layout_v = is_glsl_simple_v<T> || is_glsl_layout_v<T> |
| check if type is glsl layout or glsl simple | |
| template<class T> | |
| static _GLSL_STRUCT_CONSTEXPR17 bool | glslstruct::utils::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 T> | |
| static _GLSL_STRUCT_CONSTEXPR17 bool | glslstruct::utils::is_glsl_simples_array_v |
| check if type is array of glsl simple (scalar or vec or mat type) | |
| template<class T> | |
| static _GLSL_STRUCT_CONSTEXPR17 bool | glslstruct::utils::is_glsl_simples_static_size_array_v |
| check if type is static size array of glsl simple (scalar or vec or mat type) | |
| template<class S> | |
| static _GLSL_STRUCT_CONSTEXPR17 bool | glslstruct::utils::is_glsl_struct_v = is_glsl_struct<S>::value |
| check if type is glsl struct | |
| template<class T> | |
| static _GLSL_STRUCT_CONSTEXPR17 bool | glslstruct::utils::is_glsl_structs_array_v = is_array_of_v<is_glsl_struct, T> |
| check if type is array of glsl structs | |
| template<class S, class Layout> | |
| static _GLSL_STRUCT_CONSTEXPR17 bool | glslstruct::utils::is_glsl_layout_struct_v = is_glsl_layout_struct<S, Layout>::value |
| check if type is glsl struct with required layout | |
| template<class VS, class Layout> | |
| static _GLSL_STRUCT_CONSTEXPR17 bool | glslstruct::utils::is_glsl_layout_structs_array_v = is_array_of_v<is_glsl_layout_struct, VS, Layout> |
| check if type is array of glsl structs with required layout | |
| template<class T, class Layout> | |
| static _GLSL_STRUCT_CONSTEXPR17 bool | glslstruct::utils::is_glsl_simple_or_layout_struct_v |
| check if type is glsl struct with required layout or simple type | |
| template<class T> | |
| static _GLSL_STRUCT_CONSTEXPR17 bool | glslstruct::utils::is_glsl_simple_or_struct_v = is_glsl_simple_v<T> || is_glsl_struct_v<T> |
| check if type is glsl struct or simple type | |
| template<class T> | |
| static _GLSL_STRUCT_CONSTEXPR17 bool | glslstruct::utils::is_glsl_type_v = std::is_base_of_v<base_type, T> && !std::is_same_v<base_type, T> |
| 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::utils::is_glsl_base_type_v = std::is_same_v<base_type, T> |
| check if T is base_type container | |
| template<class V> | |
| static _GLSL_STRUCT_CONSTEXPR17 bool | glslstruct::utils::is_glsl_mats_array_v = is_array_of_v<is_glsl_mat, V> |
| Bool value which is true if type V is array of types that passes is_glsl_mat test. | |
| template<class V> | |
| static _GLSL_STRUCT_CONSTEXPR17 bool | glslstruct::utils::is_glsl_mats_static_size_array_v = is_static_size_array_of_v<is_glsl_mat, V> |
| Bool value which is true if type V is static size array of types that passes is_glsl_mat test. | |
| template<class V> | |
| static _GLSL_STRUCT_CONSTEXPR17 bool | glslstruct::utils::is_glsl_scalars_array_v = is_array_of_v<is_glsl_scalar, V> |
| Bool value which is true if type V is array of types that passes is_glsl_scalar test. | |
| template<class V> | |
| static _GLSL_STRUCT_CONSTEXPR17 bool | glslstruct::utils::is_glsl_scalars_static_size_array_v = is_static_size_array_of_v<is_glsl_scalar, V> |
| Bool value which is true if type V is static size array of types that passes is_glsl_scalar test. | |
| template<class V> | |
| static _GLSL_STRUCT_CONSTEXPR17 bool | glslstruct::utils::is_glsl_vecs_array_v = is_array_of_v<is_glsl_vec, V> |
| Bool value which is true if type V is array of types that passes is_glsl_vec test. | |
| template<class V> | |
| static _GLSL_STRUCT_CONSTEXPR17 bool | glslstruct::utils::is_glsl_vecs_static_size_array_v = is_static_size_array_of_v<is_glsl_vec, V> |
| Bool value which is true if type V is static size array of types that passes is_glsl_vec test. | |
| template<static_size_array T> | |
| static _GLSL_STRUCT_CONSTEXPR17 size_t | glslstruct::utils::array_static_size_v = array_traits<T>::static_size |
| get static_size of static size array | |
| template<template< class, class... > class Test, class T, class... Args> | |
| static _GLSL_STRUCT_CONSTEXPR17 bool | glslstruct::utils::is_array_of_v = is_array_of<Test, T, is_array_v<T>, Args...>::value |
| checks if value type is array of type and if type passes given test template struct | |
| template<template< class, class... > class Test, class T, class... Args> | |
| static _GLSL_STRUCT_CONSTEXPR17 bool | glslstruct::utils::is_static_size_array_of_v = is_static_size_array_of<Test, T, Args...>::value |
| checks if value type is array of type | |
| template<class T> | |
| static _GLSL_STRUCT_CONSTEXPR17 bool | glslstruct::utils::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::utils::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::utils::is_glsl_vec_v = glsl_vec<T> |
| Bool value which is true if type can be converted to glsl vec type. | |
| template<class T> | |
| static _GLSL_STRUCT_CONSTEXPR17 bool | glslstruct::utils::is_array_v = array<T> |
| checks if T has array traits defined | |
| template<class T> | |
| static _GLSL_STRUCT_CONSTEXPR17 bool | glslstruct::utils::is_static_size_array_v = static_size_array<T> |
| checks if T has array traits defined and additional static_size member of type size_t | |
group with utilities (not for end user to use)
| #define _GLSL_STRUCT_CONSTEXPR17 constexpr |
constexpr for c++17 and higher
| #define _GLSL_STRUCT_CONSTEXPR20 constexpr |
constexpr keyword for c++20 and higher
| #define _GLSL_STRUCT_ERROR | ( | MESSAGE | ) |
compiler error
| #define _GLSL_STRUCT_HAS_CXX17 __cplusplus >= 201703l |
check if compiler has c++ version greater or equal to c++17
| #define _GLSL_STRUCT_HAS_CXX20 0 |
check if compiler has c++ version greater or equal to c++20 and if user enabled c++20 features using GLSL_STRUCT_ENABLE_CXX20
| #define _GLSL_STRUCT_HAS_PARSER _GLSL_STRUCT_HAS_CXX17 |
check if user want to include parser functionality
| #define _GLSL_STRUCT_HAS_TYPE_CHECKS 0 |
check if user enabled type checks for struct getters using GLSL_STRUCT_ENABLE_TYPE_CHECKS (remember it only works if GLSL_STRUCT_DISABLE_TYPES was not set)
| #define _GLSL_STRUCT_HAS_TYPES _GLSL_STRUCT_HAS_CXX17 |
check if user not disabled type containers using GLSL_STRUCT_DISABLE_TYPES
| #define _GLSL_STRUCT_LAST_UPDATE_DATE_HELPER | ( | day, | |
| month, | |||
| year ) |
converts last update date to string
| #define _GLSL_STRUCT_MESSAGE | ( | MESSAGE | ) |
compiler message
| #define _GLSL_STRUCT_REQUIRES | ( | condition | ) |
requires keyword for c++20 and higher
| #define _GLSL_STRUCT_STRINGIFY_HELPER | ( | x | ) |
stringify helper
| #define _GLSL_STRUCT_VERSION_TO_INT | ( | major, | |
| minor, | |||
| patch ) |
converts version number to int
| #define _GLSL_STRUCT_VERSION_TO_STRING | ( | major, | |
| minor, | |||
| patch ) |
converts version numbers to string
| #define _GLSL_STRUCT_WARNING | ( | MESSAGE | ) |
compiler warning
| #define glsl_struct_assert | ( | expression, | |
| ... ) |
glslstruct assert
| using glslstruct::utils::array_value_type_t = _GLSL_STRUCT_TYPENAME17 array_traits<T>::value_type |
get value_type of array
|
staticnodiscard |
get pointer to data of array
|
staticnodiscard |
get size of array
|
nodiscard |
returns array counts string
| varType | variable for which we get array counts |
| canBeVariableSize | check if array size can be variable size |
|
nodiscard |
returns variable type
| varType | variable of which type is returned |
| structsNames | defined structs names |
|
nodiscard |
returns variable line type name[0][1]...
| name | name of variable |
| varType | type of variable |
| canBeVariableSize | check if array size can be variable size |
| structsNames | defined structs names |
|
static |
get static_size of static size array
|
static |
returns true if layout can be used as ssbo
|
static |
returns true if layout can be used as ubo
|
static |
checks if value type is array of type and if type passes given test template struct
|
static |
checks if T has array traits defined
|
static |
|
static |
check if type is glsl struct with required layout
| S | type which is glsl struct with required |
| Layout | required glsl layout type |
|
static |
check if type is array of glsl structs with required layout
| VS | type which is array of glsl structs with required layout |
| Layout | required glsl layout type |
|
static |
check if type is glsl layout
| T | type which is glsl layout type |
|
static |
Bool value which is true if type can be converted to glsl mat type.
| T | type for which converter to glsl mat type should be defined |
|
static |
Bool value which is true if type V is array of types that passes is_glsl_mat test.
| V | type that is checked |
|
static |
Bool value which is true if type V is static size array of types that passes is_glsl_mat test.
| V | type that is checked |
|
static |
Bool value which is true if type can be converted to glsl scalar type.
| T | type for which converter to glsl scalar type should be defined |
|
static |
Bool value which is true if type V is array of types that passes is_glsl_scalar test.
| V | type that is checked |
|
static |
Bool value which is true if type V is static size array of types that passes is_glsl_scalar test.
| V | type that is checked |
|
static |
check if type is glsl struct with required layout or simple type
| T | type which is glsl struct with required layout or simple type |
| Layout | required glsl layout type |
|
static |
check if type is glsl layout or glsl simple
| T | type which is glsl layout or simple type |
|
static |
check if type is glsl struct or simple type
| T | type which is glsl struct or simple type |
|
static |
check if type is glsl simple (is of scalar or vec or mat type)
| T | type which is glsl simple type |
|
static |
check if type is array of glsl simple (scalar or vec or mat type)
|
static |
check if type is static size array of glsl simple (scalar or vec or mat type)
|
static |
check if type is glsl struct
| S | type which is glsl struct type |
|
static |
check if type is array of glsl structs
|
static |
|
static |
Bool value which is true if type can be converted to glsl vec type.
| T | type for which converter to glsl vec type should be defined |
|
static |
Bool value which is true if type V is array of types that passes is_glsl_vec test.
| V | type that is checked |
|
static |
Bool value which is true if type V is static size array of types that passes is_glsl_vec test.
| V | type that is checked |
|
static |
checks if value type is array of type
|
static |
checks if T has array traits defined and additional static_size member of type size_t