Skip to content

Commit 9656f25

Browse files
take template aliases and variables for a spin!
1 parent a0f2131 commit 9656f25

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

include/nbl/builtin/hlsl/type_traits.hlsl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -601,6 +601,9 @@ struct is_vector<vector<T, N> > : bool_constant<true> {};
601601
template<class T, uint32_t N, uint32_t M>
602602
struct is_matrix<matrix<T, N, M> > : bool_constant<true> {};
603603

604+
template<class T>
605+
NBL_CONSTEXPR bool is_matrix_v = is_matrix<T>::value;
606+
604607

605608
template<typename T,bool=is_scalar<T>::value>
606609
struct scalar_type
@@ -626,6 +629,9 @@ struct scalar_type<matrix<T,N,M>,false>
626629
using type = T;
627630
};
628631

632+
template<typename T>
633+
using scalar_type_t = typename scalar_type<T>::type;
634+
629635

630636
template<uint16_t bytesize>
631637
struct unsigned_integer_of_size

0 commit comments

Comments
 (0)