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

Classes

class  glsl_var_type_getter
 type visitor which returns variable type More...
class  glsl_array_count_getter
 type visitor which gets array and sub arrays counts in format [0][1]... More...
class  glsl_writer
 general glsl writer More...
struct  layout_with_context
 Context container for layout. More...
struct  layout_without_context
 empty container for layout More...
struct  base_parser_patterns
 all parser patterns in one struct More...
struct  ubo_parser_pattern
 container for ubo parser pattern More...
struct  ubo_parser_pattern< std140_layout >
 template overload of container for ubo parser pattern for std140 layout More...
struct  ssbo_parser_pattern
 container for ssbo parser pattern More...
struct  ssbo_parser_pattern< std140_layout >
 template overload of container for ssbo parser pattern for std140 layout More...
struct  ssbo_parser_pattern< std430_layout >
 template overload of container for ssbo parser pattern for std430 layout More...
struct  ssbo_parser_pattern< scalar_layout >
 template overload of container for ssbo parser pattern for scalar layout More...
struct  is_glsl_layout
 helper struct to check if type is glsl layout More...
struct  is_glsl_layout< base_layout< T > >
struct  is_glsl_struct
 helper struct to check if type is glsl struct More...
struct  is_glsl_struct< base_struct< L > >
struct  is_glsl_layout_struct
 helper struct to check if type is glsl struct with required layout More...
struct  is_glsl_layout_struct< base_struct< Layout >, L >
struct  is_glsl_mat
 struct with bool_constant which is true if type can be converted to glsl mat type More...
struct  is_glsl_scalar
 struct with bool_constant which is true if type can be converted to glsl scalar type More...
struct  is_glsl_vec
 struct with bool_constant which is true if type can be converted to glsl vec type More...
struct  array_traits
 Array Traits. More...
struct  array_traits< std::vector< T > >
 Array Traits overload for std::vector. More...
struct  array_traits< std::array< T, N > >
 Array Traits overload for std::array. More...
struct  array_traits< T[N]>
 Array Traits overload for c-style array. More...
struct  array_traits< T(*)[N]>
 Array Traits overload for pointer to c-style array. More...
struct  array_traits< std::span< T > >
 Array Traits overload for std::span. More...
struct  is_array_of
 helper struct for is_array_of_v check More...
struct  is_array_of< Test, T, true, Args... >
struct  is_static_size_array_of_impl
 helper struct for is_static_size_array_of_v check More...
struct  is_static_size_array_of_impl< Test, T, true, Args... >
struct  is_static_size_array_of
 checks if value type is array of type and if type passes given test template struct More...
struct  single_value
 container for single values More...
struct  array_value
 container for array values More...
struct  struct_array_value
 container for array of structs More...
struct  standard_variable
 container for standard variables More...
struct  layout_variable
 container for layout variables More...

Concepts

concept  has_layout_traits_context
 Checks if a type T provides a nested 'context_type'.
concept  layout_traits_get_alignment
 Validates that T provides mandatory alignment calculation methods.
concept  has_layout_traits_opt_before_add
concept  layout_traits_opt_before_add
concept  has_layout_traits_opt_before_add_scalar
concept  layout_traits_opt_before_add_scalar
concept  has_layout_traits_opt_before_add_vec
concept  layout_traits_opt_before_add_vec
concept  has_layout_traits_opt_before_add_mat
concept  layout_traits_opt_before_add_mat
concept  has_layout_traits_opt_before_add_array
concept  layout_traits_opt_before_add_array
concept  has_layout_traits_opt_before_add_struct
concept  layout_traits_opt_before_add_struct
concept  layout_traits_before_add
 Validates optional "before_add" hooks.
concept  has_layout_traits_opt_after_add
concept  layout_traits_opt_after_add
concept  has_layout_traits_opt_after_add_scalar
concept  layout_traits_opt_after_add_scalar
concept  has_layout_traits_opt_after_add_vec
concept  layout_traits_opt_after_add_vec
concept  has_layout_traits_opt_after_add_mat
concept  layout_traits_opt_after_add_mat
concept  has_layout_traits_opt_after_add_array
concept  layout_traits_opt_after_add_array
concept  has_layout_traits_opt_after_add_struct
concept  layout_traits_opt_after_add_struct
concept  layout_traits_after_add
 Validates optional "after_add" hooks.
concept  layout_traits_with_context
concept  layout_traits_without_context
concept  has_ubo_pattern
 concept for check if layout can be used as ubo
concept  has_ssbo_pattern
 concept for check if layout can be used as ssbo
concept  glsl_layout
 check if type is glsl layout
concept  glsl_simple_or_layout
 check if type is glsl layout or glsl simple
concept  glsl_simple
 check if type is glsl simple (is of scalar or vec or mat type)
concept  glsl_simples_array
 check if type is array of glsl simple (scalar or vec or mat type)
concept  glsl_simples_static_size_array
 check if type is static size array of glsl simple (scalar or vec or mat type)
concept  glsl_struct
 check if type is glsl struct
concept  glsl_structs_array
 check if type is array of glsl structs
concept  glsl_layout_struct
 check if type is glsl struct with required layout
concept  glsl_layout_structs_array
 check if type is array of glsl structs with required layout
concept  glsl_simple_or_layout_struct
 check if type is glsl struct with required layout or simple type
concept  glsl_simple_or_struct
 check if type is glsl struct or simple type
concept  glsl_type
 check if T is glsl type (not base_type container but derived from base_type container)
concept  glsl_base_type
 check if T is base_type container
concept  glsl_mat
 Concept defining which type can be converted to glsl mat type.
concept  glsl_mats_array
 Concept which is true if type V is array of types that passes is_glsl_mat test.
concept  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  glsl_scalar
 Concept defining which type can be converted to glsl scalar type.
concept  glsl_scalars_array
 Concept which is true if type V is array of types that passes is_glsl_scalar test.
concept  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  glsl_vec
 Concept defining which type can be converted to glsl vec type.
concept  glsl_vecs_array
 Concept which is true if type V is array of types that passes is_glsl_vec test.
concept  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  array
 Array concept.
concept  static_size_array
 Static size array concept.

Typedefs

template<array T>
using array_value_type_t = _GLSL_STRUCT_TYPENAME17 array_traits<T>::value_type
 get value_type of array

Functions

std::string get_glsl_var_type_string (const base_type_handle &varType, const mstd::ordered_map< struct_type, std::string > &structsNames)
 returns variable type
std::string get_glsl_array_count_string (const base_type_handle &varType, bool canBeVariableSize)
 returns array counts string
std::string 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 > * get_array_data (const T &value)
 get pointer to data of array
template<array T>
static _GLSL_STRUCT_CONSTEXPR17 size_t get_array_size (const T &value)
 get size of array

Variables

template<class Layout>
static _GLSL_STRUCT_CONSTEXPR17 bool 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 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 is_glsl_layout_v = is_glsl_layout<T>::value
 check if type is glsl layout
template<class T>
static _GLSL_STRUCT_CONSTEXPR17 bool 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 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 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 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 is_glsl_struct_v = is_glsl_struct<S>::value
 check if type is glsl struct
template<class T>
static _GLSL_STRUCT_CONSTEXPR17 bool 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 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 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 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 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 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 is_glsl_base_type_v = std::is_same_v<base_type, T>
 check if T is base_type container
template<class T>
static _GLSL_STRUCT_CONSTEXPR17 bool is_glsl_mat_v = glsl_mat<T>
 Bool value which is true if type can be converted to glsl mat type.
template<class V>
static _GLSL_STRUCT_CONSTEXPR17 bool 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 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 T>
static _GLSL_STRUCT_CONSTEXPR17 bool is_glsl_scalar_v = glsl_scalar<T>
 Bool value which is true if type can be converted to glsl scalar type.
template<class V>
static _GLSL_STRUCT_CONSTEXPR17 bool 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 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 T>
static _GLSL_STRUCT_CONSTEXPR17 bool is_glsl_vec_v = glsl_vec<T>
 Bool value which is true if type can be converted to glsl vec type.
template<class V>
static _GLSL_STRUCT_CONSTEXPR17 bool 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 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<class T>
static _GLSL_STRUCT_CONSTEXPR17 bool is_array_v = array<T>
 checks if T has array traits defined
template<class T>
static _GLSL_STRUCT_CONSTEXPR17 bool 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
template<static_size_array T>
static _GLSL_STRUCT_CONSTEXPR17 size_t 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 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 is_static_size_array_of_v = is_static_size_array_of<Test, T, Args...>::value
 checks if value type is array of type
Feature Detection Constants

Boolean constants to detect specific optional methods within a layout trait.

template<class T>
static _GLSL_STRUCT_CONSTEXPR17 bool has_layout_traits_context_v = layout_traits<T> && has_layout_traits_context<T>
template<class T>
static _GLSL_STRUCT_CONSTEXPR17 bool has_layout_traits_before_add_v
template<class T>
static _GLSL_STRUCT_CONSTEXPR17 bool has_layout_traits_before_add_scalar_v
template<class T>
static _GLSL_STRUCT_CONSTEXPR17 bool has_layout_traits_before_add_vec_v
template<class T>
static _GLSL_STRUCT_CONSTEXPR17 bool has_layout_traits_before_add_mat_v
template<class T>
static _GLSL_STRUCT_CONSTEXPR17 bool has_layout_traits_before_add_array_v
template<class T>
static _GLSL_STRUCT_CONSTEXPR17 bool has_layout_traits_before_add_struct_v
template<class T>
static _GLSL_STRUCT_CONSTEXPR17 bool has_layout_traits_after_add_v
template<class T>
static _GLSL_STRUCT_CONSTEXPR17 bool has_layout_traits_after_add_scalar_v
template<class T>
static _GLSL_STRUCT_CONSTEXPR17 bool has_layout_traits_after_add_vec_v
template<class T>
static _GLSL_STRUCT_CONSTEXPR17 bool has_layout_traits_after_add_mat_v
template<class T>
static _GLSL_STRUCT_CONSTEXPR17 bool has_layout_traits_after_add_array_v
template<class T>
static _GLSL_STRUCT_CONSTEXPR17 bool has_layout_traits_after_add_struct_v

Variable Documentation

◆ has_layout_traits_after_add_array_v

template<class T>
_GLSL_STRUCT_CONSTEXPR17 bool glslstruct::utils::has_layout_traits_after_add_array_v
static
Initial value:
=
The primary concept for GLSL layout trait definitions.
Definition layout_traits_concept.hpp:254
Definition layout_traits_concept.hpp:201

◆ has_layout_traits_after_add_mat_v

template<class T>
_GLSL_STRUCT_CONSTEXPR17 bool glslstruct::utils::has_layout_traits_after_add_mat_v
static

◆ has_layout_traits_after_add_scalar_v

template<class T>
_GLSL_STRUCT_CONSTEXPR17 bool glslstruct::utils::has_layout_traits_after_add_scalar_v
static

◆ has_layout_traits_after_add_struct_v

template<class T>
_GLSL_STRUCT_CONSTEXPR17 bool glslstruct::utils::has_layout_traits_after_add_struct_v
static

◆ has_layout_traits_after_add_v

template<class T>
_GLSL_STRUCT_CONSTEXPR17 bool glslstruct::utils::has_layout_traits_after_add_v
static

◆ has_layout_traits_after_add_vec_v

template<class T>
_GLSL_STRUCT_CONSTEXPR17 bool glslstruct::utils::has_layout_traits_after_add_vec_v
static

◆ has_layout_traits_before_add_array_v

template<class T>
_GLSL_STRUCT_CONSTEXPR17 bool glslstruct::utils::has_layout_traits_before_add_array_v
static

◆ has_layout_traits_before_add_mat_v

template<class T>
_GLSL_STRUCT_CONSTEXPR17 bool glslstruct::utils::has_layout_traits_before_add_mat_v
static

◆ has_layout_traits_before_add_scalar_v

template<class T>
_GLSL_STRUCT_CONSTEXPR17 bool glslstruct::utils::has_layout_traits_before_add_scalar_v
static

◆ has_layout_traits_before_add_struct_v

template<class T>
_GLSL_STRUCT_CONSTEXPR17 bool glslstruct::utils::has_layout_traits_before_add_struct_v
static

◆ has_layout_traits_before_add_v

template<class T>
_GLSL_STRUCT_CONSTEXPR17 bool glslstruct::utils::has_layout_traits_before_add_v
static

◆ has_layout_traits_before_add_vec_v

template<class T>
_GLSL_STRUCT_CONSTEXPR17 bool glslstruct::utils::has_layout_traits_before_add_vec_v
static

◆ has_layout_traits_context_v

template<class T>
_GLSL_STRUCT_CONSTEXPR17 bool glslstruct::utils::has_layout_traits_context_v = layout_traits<T> && has_layout_traits_context<T>
static