Skip to content

Commit ca2ac6f

Browse files
author
kevyuu
committed
Remove Bit count constraint on some of Transcoder method due to redundancy.
1 parent 6c82428 commit ca2ac6f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

include/nbl/builtin/hlsl/morton.hlsl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ struct code
342342
*
343343
* @param [in] cartesian Coordinates to encode
344344
*/
345-
template<typename I NBL_FUNC_REQUIRES(8 * sizeof(I) >= Bits)
345+
template<typename I>
346346
inline explicit code(NBL_CONST_REF_ARG(vector<I, D>) cartesian)
347347
{
348348
*this = create(cartesian);
@@ -351,7 +351,7 @@ struct code
351351
/**
352352
* @brief Decodes this Morton code back to a set of cartesian coordinates
353353
*/
354-
template<typename I NBL_FUNC_REQUIRES(8 * sizeof(I) >= Bits && is_signed_v<I> == Signed)
354+
template<typename I NBL_FUNC_REQUIRES(is_signed_v<I> == Signed)
355355
constexpr explicit operator vector<I, D>() const noexcept;
356356

357357
#endif
@@ -521,8 +521,8 @@ namespace impl
521521
{
522522

523523
// I must be of same signedness as the morton code, and be wide enough to hold each component
524-
template<typename I, uint16_t Bits, uint16_t D, typename _uint64_t> NBL_PARTIAL_REQ_TOP(concepts::IntegralScalar<I> && 8 * sizeof(I) >= Bits)
525-
struct static_cast_helper<vector<I, D>, morton::code<is_signed_v<I>, Bits, D, _uint64_t> NBL_PARTIAL_REQ_BOT(concepts::IntegralScalar<I> && 8 * sizeof(I) >= Bits) >
524+
template<typename I, uint16_t Bits, uint16_t D, typename _uint64_t> NBL_PARTIAL_REQ_TOP(concepts::IntegralScalar<I>)
525+
struct static_cast_helper<vector<I, D>, morton::code<is_signed_v<I>, Bits, D, _uint64_t> NBL_PARTIAL_REQ_BOT(concepts::IntegralScalar<I>) >
526526
{
527527
NBL_CONSTEXPR_STATIC vector<I, D> cast(NBL_CONST_REF_ARG(morton::code<is_signed_v<I>, Bits, D, _uint64_t>) val)
528528
{
@@ -606,7 +606,7 @@ constexpr morton::code<Signed, Bits, D, _uint64_t> morton::code<Signed, Bits, D,
606606
}
607607

608608
template <bool Signed, uint16_t Bits, uint16_t D, typename _uint64_t NBL_PRIMARY_REQUIRES(morton::impl::Dimension<D>&& D* Bits <= 64)
609-
template <typename I NBL_FUNC_REQUIRES(8 * sizeof(I) >= Bits && is_signed_v<I> == Signed)
609+
template <typename I NBL_FUNC_REQUIRES(is_signed_v<I> == Signed)
610610
constexpr morton::code<Signed, Bits, D, _uint64_t>::operator vector<I, D>() const noexcept
611611
{
612612
return _static_cast<vector<I, D>, morton::code<Signed, Bits, D>>(*this);

0 commit comments

Comments
 (0)