Skip to content
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

Open
wants to merge 125 commits into
base: master
Choose a base branch
from
Open

Hlsl bxdfs 2 #811

wants to merge 125 commits into from

Conversation

devshgraphicsprogramming
Copy link
Member

Description

Recreated PR #797 because GitHub diff browser glitched.

Testing

TODO list:

Copy link
Contributor

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?

Copy link
Member Author

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.

Copy link
Member Author

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"

Comment on lines +619 to +658
#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
Copy link
Member Author

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

Copy link
Contributor

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?

Comment on lines 606 to 623
// 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;

Copy link
Member Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants