-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hlsl bxdfs 2 #811
base: master
Are you sure you want to change the base?
Hlsl bxdfs 2 #811
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see any changes here. Don't know why it shows up from the merge. Probably just line endings?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whitespace or GH apeing out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah when you use "ignore whitespace" it says "Whitespace-only changes"
#ifdef __HLSL_VERSION | ||
template<class T> | ||
struct rank : integral_constant<uint64_t, | ||
conditional_value< | ||
is_matrix_v<T>, | ||
uint64_t, | ||
2ull, | ||
conditional_value< | ||
is_vector_v<T>, | ||
uint64_t, | ||
1ull, | ||
0ull | ||
>::value | ||
>::value | ||
> { }; | ||
|
||
template<class T, uint64_t N> | ||
struct rank<T[N]> : integral_constant<uint64_t, 1 + rank<T>::value> { }; | ||
|
||
template<class T> | ||
struct rank<T[]> : integral_constant<uint64_t, 1 + rank<T>::value> { }; | ||
|
||
template<class T, uint32_t I = 0 NBL_STRUCT_CONSTRAINABLE> | ||
struct extent : integral_constant<uint64_t, 0> {}; | ||
|
||
template<class T, uint64_t N> | ||
struct extent<T[N], 0> : integral_constant<uint64_t, N> {}; | ||
|
||
template<class T, uint64_t N, uint32_t I> | ||
struct extent<T[N], I> : integral_constant<uint64_t,extent<T, I - 1>::value> {}; | ||
|
||
template<class T, uint32_t I> | ||
struct extent<T[], I> : integral_constant<uint64_t,extent<T, I - 1>::value> {}; | ||
|
||
template<class T, uint16_t N> | ||
struct extent<vector<T,N>, 0> : integral_constant<uint64_t, N> {}; | ||
|
||
template<class T, uint16_t M, uint16_t N, uint32_t I> | ||
struct extent<matrix<T,N,M>, I> : integral_constant<uint64_t,extent<T[N][M], I>::value> {}; | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why did you make these HLSL only? they should work in C++ and HLSL both!
@Przemog1 guide how to implement
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The C++ version already uses std::rank
and std::extent
?
// Template Variables | ||
template<typename A, typename B> | ||
NBL_CONSTEXPR bool is_same_v = is_same<A, B>::value; | ||
template<class T> | ||
NBL_CONSTEXPR bool is_unsigned_v = is_unsigned<T>::value; | ||
template<class T> | ||
NBL_CONSTEXPR bool is_integral_v = is_integral<T>::value; | ||
template<class T> | ||
NBL_CONSTEXPR bool is_floating_point_v = is_floating_point<T>::value; | ||
template<class T> | ||
NBL_CONSTEXPR bool is_signed_v = is_signed<T>::value; | ||
template<class T> | ||
NBL_CONSTEXPR bool is_scalar_v = is_scalar<T>::value; | ||
template<class T> | ||
NBL_CONSTEXPR uint32_t alignment_of_v = alignment_of<T>::value; | ||
template<class T, uint32_t N = 0> | ||
NBL_CONSTEXPR uint64_t extent_v = extent<T, N>::value; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only extent_v
should have moved, rest should have stayed where they were
Description
Recreated PR #797 because GitHub diff browser glitched.
Testing
TODO list: