|
Blender V5.3
|
#include <constexpr.hh>
Public Types | |
| enum | CompType { BOOL = 0x00 , UINT = 0x10 , INT = 0x20 , FLOAT = 0x30 } |
| enum | Type { INVALID = 0 , BOOL1 = CompType::BOOL | 0x01 , BOOL2 = CompType::BOOL | 0x02 , BOOL3 = CompType::BOOL | 0x03 , BOOL4 = CompType::BOOL | 0x04 , UINT1 = CompType::UINT | 0x11 , UINT2 = CompType::UINT | 0x12 , UINT3 = CompType::UINT | 0x13 , UINT4 = CompType::UINT | 0x14 , INT1 = CompType::INT | 0x21 , INT2 = CompType::INT | 0x22 , INT3 = CompType::INT | 0x23 , INT4 = CompType::INT | 0x24 , FLOAT1 = CompType::FLOAT | 0x31 , FLOAT2 = CompType::FLOAT | 0x32 , FLOAT3 = CompType::FLOAT | 0x33 , FLOAT4 = CompType::FLOAT | 0x34 } |
Public Member Functions | |
| bool | is_array () const |
| bool | is_scalar () const |
| int | comp_len () const |
| CompType | comp_type () const |
| void | convert_or_broadcast (Type dst, std::vector< uint32_t > &r) const |
| uint32_t | convert_scalar (CompType dst_comp) const |
| ConstexprValue (int32_t s) | |
| ConstexprValue (uint32_t s) | |
| ConstexprValue (bool s) | |
| ConstexprValue (float s) | |
| ConstexprValue (Type t, const ConstexprValue &x) | |
| ConstexprValue (Type t, const ConstexprValue &x, const ConstexprValue &y) | |
| ConstexprValue (Type t, const ConstexprValue &x, const ConstexprValue &y, const ConstexprValue &z) | |
| ConstexprValue (Type t, const ConstexprValue &x, const ConstexprValue &y, const ConstexprValue &z, const ConstexprValue &w) | |
| ConstexprValue | operator+ () const |
| ConstexprValue | operator- () const |
| ConstexprValue | operator~ () const |
| ConstexprValue | operator! () const |
| ConstexprValue & | operator++ () |
| ConstexprValue & | operator-- () |
| ConstexprValue | operator++ (int) |
| ConstexprValue | operator-- (int) |
| COMPOUND_ASSIGN (%=, cast_to_int_if_not_uint(l) % cast_to_int_if_not_uint(r)) COMPOUND_ASSIGN(& | |
| cast_to_int_if_not_uint (l) &cast_to_int_if_not_uint(r)) COMPOUND_ASSIGN(| | |
| cast_to_int_if_not_uint (l)|cast_to_int_if_not_uint(r)) COMPOUND_ASSIGN(^ | |
| cast_to_int_if_not_uint (l) ^ cast_to_int_if_not_uint(r)) COMPOUND_ASSIGN(<< | |
| cast_to_int_if_not_uint (l)<< cast_to_int_if_not_uint(r)) COMPOUND_ASSIGN(> > | |
| cast_to_int_if_not_uint (l) > > cast_to_int_if_not_uint(r)) const uint32_t &comp_raw(int i) const | |
| uint32_t & | comp_raw (int i) |
| template<typename T> | |
| T | comp_as (int i) const |
| template<typename T> | |
| void | set_as (int i, T v) |
| template<typename T> | |
| T | comp_cast (int i) const |
Static Public Member Functions | |
| static uint32_t | cast_value (CompType from, CompType to, uint32_t value) |
| template<typename Func> | |
| static ConstexprValue | constexpr_op (const Func &fn, const ConstexprValue &lhs, const ConstexprValue &rhs, const bool is_bool_result=false, const bool use_left_type=false) |
| template<typename T> | |
| static constexpr auto | cast_to_int_if_not_uint (T val) |
Public Attributes | |
| enum bsl::ConstexprValue::Type | type_ = INVALID |
| std::vector< uint32_t > | values = {0} |
Container for the value of a constexpr.
Note that we do not support smaller types (e.g. char, ushort, ...) because they might not exist in the target language. Supporting them would mean having potentially 2 different result for the same expression depending on whether or not it is constexpr.
Definition at line 25 of file constexpr.hh.
| Enumerator | |
|---|---|
| BOOL | |
| UINT | |
| INT | |
| FLOAT | |
Definition at line 26 of file constexpr.hh.
| Enumerator | |
|---|---|
| INVALID | |
| BOOL1 | |
| BOOL2 | |
| BOOL3 | |
| BOOL4 | |
| UINT1 | |
| UINT2 | |
| UINT3 | |
| UINT4 | |
| INT1 | |
| INT2 | |
| INT3 | |
| INT4 | |
| FLOAT1 | |
| FLOAT2 | |
| FLOAT3 | |
| FLOAT4 | |
Definition at line 33 of file constexpr.hh.
|
inlineexplicit |
Definition at line 139 of file constexpr.hh.
References INT1, type_, and values.
Referenced by constexpr_op(), ConstexprValue(), ConstexprValue(), ConstexprValue(), ConstexprValue(), bsl::ExpressionTypeParser::identifier(), bsl::ExpressionTypeParser::number_literal(), operator!(), operator+(), operator++(), operator++(), operator-(), operator--(), operator--(), operator~(), and bsl::SymbolParser::parse_enum_value().
|
inlineexplicit |
Definition at line 140 of file constexpr.hh.
|
inlineexplicit |
Definition at line 141 of file constexpr.hh.
|
inlineexplicit |
Definition at line 142 of file constexpr.hh.
|
inlineexplicit |
Definition at line 144 of file constexpr.hh.
References ConstexprValue(), type_, values, and x.
|
inlineexplicit |
Definition at line 149 of file constexpr.hh.
References comp_type(), ConstexprValue(), type_, values, x, and y.
|
inlineexplicit |
Definition at line 154 of file constexpr.hh.
References comp_type(), ConstexprValue(), type_, values, x, y, and z().
|
inlineexplicit |
Definition at line 165 of file constexpr.hh.
References comp_type(), ConstexprValue(), type_, values, w(), x, y, and z().
| bsl::ConstexprValue::cast_to_int_if_not_uint | ( | l | ) | & |
References cast_to_int_if_not_uint(), and COMPOUND_ASSIGN().
Referenced by cast_to_int_if_not_uint(), cast_to_int_if_not_uint(), cast_to_int_if_not_uint(), cast_to_int_if_not_uint(), cast_to_int_if_not_uint(), and COMPOUND_ASSIGN().
|
inline |
Definition at line 249 of file constexpr.hh.
References cast_to_int_if_not_uint(), comp_raw(), COMPOUND_ASSIGN(), and values.
| bsl::ConstexprValue::cast_to_int_if_not_uint | ( | l | ) |
References cast_to_int_if_not_uint(), and COMPOUND_ASSIGN().
| bsl::ConstexprValue::cast_to_int_if_not_uint | ( | l | ) |
References cast_to_int_if_not_uint(), and COMPOUND_ASSIGN().
| bsl::ConstexprValue::cast_to_int_if_not_uint | ( | l | ) |
References cast_to_int_if_not_uint(), and COMPOUND_ASSIGN().
|
inlinestaticconstexpr |
Definition at line 387 of file constexpr.hh.
References T.
|
inlinestatic |
Definition at line 73 of file constexpr.hh.
References BOOL, FLOAT, INT, and UINT.
Referenced by convert_or_broadcast(), and convert_scalar().
Definition at line 262 of file constexpr.hh.
References comp_raw(), and T.
Referenced by constexpr_op(), and bsl::ExpressionTypeParser::ternary().
Definition at line 272 of file constexpr.hh.
References BOOL, comp_raw(), comp_type(), FLOAT, INT, T, and UINT.
Referenced by bsl::anyGreaterThanEqual(), bsl::anyLessThan(), and bsl::ExpressionTypeParser::identifier().
|
inline |
Definition at line 63 of file constexpr.hh.
References type_.
Referenced by constexpr_op(), convert_or_broadcast(), is_array(), and is_scalar().
|
inline |
Definition at line 257 of file constexpr.hh.
References values.
Referenced by cast_to_int_if_not_uint(), comp_as(), comp_cast(), and set_as().
|
inline |
Definition at line 68 of file constexpr.hh.
References type_.
Referenced by comp_cast(), constexpr_op(), ConstexprValue(), ConstexprValue(), ConstexprValue(), convert_or_broadcast(), and convert_scalar().
| bsl::ConstexprValue::COMPOUND_ASSIGN | ( | % | , |
| cast_to_int_if_not_uint(l) % cast_to_int_if_not_uint(r) | ) & |
References cast_to_int_if_not_uint(), and COMPOUND_ASSIGN().
Referenced by cast_to_int_if_not_uint(), cast_to_int_if_not_uint(), cast_to_int_if_not_uint(), cast_to_int_if_not_uint(), cast_to_int_if_not_uint(), and COMPOUND_ASSIGN().
|
inlinestatic |
Definition at line 288 of file constexpr.hh.
References BOOL, comp_as(), comp_len(), comp_type(), ConstexprValue(), FLOAT, INT, is_array(), is_scalar(), LOOP, set_as(), type_, UINT, and values.
Referenced by operator!(), bsl::operator!=(), bsl::operator%(), bsl::operator&(), bsl::operator&&(), bsl::operator*(), bsl::operator+(), operator-(), bsl::operator-(), bsl::operator/(), bsl::operator<(), bsl::operator<<(), bsl::operator<=(), bsl::operator==(), bsl::operator>(), bsl::operator>=(), bsl::operator>>(), bsl::operator^(), bsl::operator|(), bsl::operator||(), and operator~().
|
inline |
Definition at line 93 of file constexpr.hh.
References cast_value(), comp_len(), comp_type(), is_array(), is_scalar(), and values.
|
inline |
Definition at line 121 of file constexpr.hh.
References blender::gpu::shader::metadata::assert, cast_value(), comp_type(), is_array(), is_scalar(), and values.
|
inline |
Definition at line 53 of file constexpr.hh.
References comp_len(), and values.
Referenced by constexpr_op(), convert_or_broadcast(), and convert_scalar().
|
inline |
Definition at line 58 of file constexpr.hh.
References comp_len().
Referenced by constexpr_op(), convert_or_broadcast(), and convert_scalar().
|
inline |
Definition at line 195 of file constexpr.hh.
References constexpr_op(), and ConstexprValue().
|
inline |
Definition at line 180 of file constexpr.hh.
References ConstexprValue().
|
inline |
Definition at line 202 of file constexpr.hh.
References ConstexprValue(), and values.
|
inline |
Definition at line 217 of file constexpr.hh.
References ConstexprValue().
|
inline |
Definition at line 185 of file constexpr.hh.
References constexpr_op(), and ConstexprValue().
|
inline |
Definition at line 209 of file constexpr.hh.
References ConstexprValue(), and values.
|
inline |
Definition at line 223 of file constexpr.hh.
References ConstexprValue().
|
inline |
Definition at line 190 of file constexpr.hh.
References constexpr_op(), and ConstexprValue().
Definition at line 267 of file constexpr.hh.
References comp_raw(), and T.
Referenced by constexpr_op().
| enum bsl::ConstexprValue::Type bsl::ConstexprValue::type_ = INVALID |
| std::vector<uint32_t> bsl::ConstexprValue::values = {0} |
Definition at line 137 of file constexpr.hh.
Referenced by bsl::anyGreaterThanEqual(), bsl::anyLessThan(), cast_to_int_if_not_uint(), comp_raw(), constexpr_op(), ConstexprValue(), ConstexprValue(), ConstexprValue(), ConstexprValue(), ConstexprValue(), ConstexprValue(), ConstexprValue(), ConstexprValue(), convert_or_broadcast(), convert_scalar(), is_array(), operator++(), and operator--().