Skip to content

Commit 1316d2c

Browse files
committed
readd mpl namespace and fix merge conflicts
1 parent 8ec80ca commit 1316d2c

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

include/nbl/builtin/hlsl/mpl.hlsl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ namespace nbl
1515
{
1616
namespace hlsl
1717
{
18-
18+
namespace mpl
19+
{
1920
#ifdef __HLSL_VERSION
2021
namespace impl
2122
{
@@ -39,8 +40,8 @@ struct countl_zero
3940
{
4041
NBL_CONSTEXPR_STATIC_INLINE bool CHOOSE_HIGH = N&(countl_zero_masks<bits_log2>::LO_MASK<<countl_zero_masks<bits_log2>::SHIFT);
4142
NBL_CONSTEXPR_STATIC_INLINE uint64_t NEXT_N = (CHOOSE_HIGH ? (N>>countl_zero_masks<bits_log2>::SHIFT):N)&countl_zero_masks<bits_log2>::LO_MASK;
42-
//NBL_CONSTEXPR_STATIC_INLINE uint16_t value = type_traits::conditional_value<bits_log2,uint16_t,countl_zero<NEXT_N,bits_log2-1>::value,0>::value + (CHOOSE_HIGH ? 0ull:countl_zero_masks<bits_log2>::SHIFT);
43-
NBL_CONSTEXPR_STATIC_INLINE uint16_t value = type_traits::conditional<bits_log2,countl_zero<NEXT_N,bits_log2-1>,type_traits::integral_constant<uint16_t,0> >::type::value + (CHOOSE_HIGH ? 0ull:countl_zero_masks<bits_log2>::SHIFT);
43+
//NBL_CONSTEXPR_STATIC_INLINE uint16_t value = conditional_value<bits_log2,uint16_t,countl_zero<NEXT_N,bits_log2-1>::value,0>::value + (CHOOSE_HIGH ? 0ull:countl_zero_masks<bits_log2>::SHIFT);
44+
NBL_CONSTEXPR_STATIC_INLINE uint16_t value = conditional<bits_log2,countl_zero<NEXT_N,bits_log2-1>,integral_constant<uint16_t,0> >::type::value + (CHOOSE_HIGH ? 0ull:countl_zero_masks<bits_log2>::SHIFT);
4445
};
4546

4647
}
@@ -81,5 +82,5 @@ struct rotr
8182

8283
}
8384
}
84-
85+
}
8586
#endif

include/nbl/builtin/hlsl/type_traits.hlsl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -503,9 +503,9 @@ struct scalar_type<matrix<T,N,M> >
503503
// shoudl really return a std::type_info like struct or something, but no `constexpr` and unsure whether its possible to have a `const static SomeStruct` makes it hard to do...
504504
#define typeid(expr) (typeid_t<decltype(expr)>::value)
505505

506-
#define NBL_REGISTER_OBJ_TYPE(T) namespace nbl { namespace hlsl { namespace type_traits { template<> struct typeid_t<T> : integral_constant<uint32_t,__COUNTER__> {}; }}}
506+
#define NBL_REGISTER_OBJ_TYPE(T) namespace nbl { namespace hlsl { template<> struct typeid_t<T> : integral_constant<uint32_t,__COUNTER__> {}; }}
507507
// TODO: find out how to do it such that we don't get duplicate definition if we use two function identifiers with same signature
508-
#define NBL_REGISTER_FUN_TYPE(fn) namespace nbl { namespace hlsl { namespace type_traits { template<> struct typeid_t<__decltype(fn)> : integral_constant<uint32_t,__COUNTER__> {}; }}}
508+
#define NBL_REGISTER_FUN_TYPE(fn) namespace nbl { namespace hlsl { template<> struct typeid_t<__decltype(fn)> : integral_constant<uint32_t,__COUNTER__> {}; }}
509509
// TODO: ideally we'd like to call NBL_REGISTER_FUN_TYPE under the hood, but we can't right now. Also we have a bigger problem, the passing of the function identifier as the second template parameter doesn't work :(
510510
/*
511511
template<> \

0 commit comments

Comments
 (0)