-
Notifications
You must be signed in to change notification settings - Fork 59
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
Remove Matrices #760
base: cameraz
Are you sure you want to change the base?
Remove Matrices #760
Conversation
…g keys to CMake it seems)
Signed-off-by: Ali Cheraghi <[email protected]>
Signed-off-by: Ali Cheraghi <[email protected]>
Signed-off-by: Ali Cheraghi <[email protected]>
Signed-off-by: Ali Cheraghi <[email protected]>
Signed-off-by: Ali Cheraghi <[email protected]>
Signed-off-by: Ali Cheraghi <[email protected]>
Signed-off-by: Ali Cheraghi <[email protected]>
Signed-off-by: Ali Cheraghi <[email protected]>
Signed-off-by: Ali Cheraghi <[email protected]>
template<typename T> | ||
inline T radians(NBL_CONST_REF_ARG(T) degrees) | ||
{ | ||
static_assert( | ||
is_floating_point<T>::value, | ||
"This code expects the type to be either a double or a float." | ||
); | ||
|
||
return degrees * PI<T>() / T(180); | ||
} | ||
|
||
template<typename T> | ||
inline T degrees(NBL_CONST_REF_ARG(T) radians) | ||
{ | ||
static_assert( | ||
is_floating_point<T>::value, | ||
"This code expects the type to be either a double or a float." | ||
); | ||
|
||
return radians * T(180) / PI<T>(); | ||
} |
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.
we have numbers
ot something like that for PI and friends.
Also the _HLSL_VERSION
case should forward to the inline SPIR-V from the std450 extended set
DEFINE_MUL_QUATERNION_BY_SCALAR_OPERATOR(uint32_t) | ||
DEFINE_MUL_QUATERNION_BY_SCALAR_OPERATOR(uint64_t) |
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.
this is a mistake, only provide mul with T
Image Accessor concepts and workgroup FFT
IDENTITY_MATRIX(TYPE, 2, 2)\ | ||
IDENTITY_MATRIX(TYPE, 3, 3)\ | ||
IDENTITY_MATRIX(TYPE, 4, 4)\ | ||
IDENTITY_MATRIX(TYPE, 3, 4) |
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.
identity matrix is square matrix, requesting 3x4
dimensions for identity is incorrect
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.
ok I see we had hlsl::IdentityFloat32_t3x4
- in that case it's up to @devshgraphicsprogramming to decide if we keep this logic
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.
hmm since we have a diagonal
let that provide the diagonals for 4x3 when needed, and keep identity only for squares
struct identity; | ||
|
||
template<typename T, uint32_t N, uint32_t M> | ||
struct identity<matrix<T, N, M> > |
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.
with your new matrix traits you need now to check
matrix_traits<T, N, M>::Square
with new HLSL concept API
#include "position2d.h" | ||
#include "quaternion.h" | ||
#include "nbl/builtin/hlsl/math/quaternion/quaternion.hlsl" |
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.
include it somewhere else later on, no point having it global here
#include <nbl/builtin/hlsl/math/quaternion/quaternion.hlsl> | ||
// TODO: remove this header when deleting vectorSIMDf.hlsl | ||
#include <nbl/core/math/glslFunctions.h> | ||
#include "vectorSIMD.h" |
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.
including vectorSIMD.h
will give you problems soon
// TODO: remove this header when deleting vectorSIMDf.hlsl | ||
#include <nbl/core/math/glslFunctions.h> | ||
#include "vectorSIMD.h" | ||
#include <nbl/builtin/hlsl/concepts.hlsl> | ||
#include <nbl/builtin/hlsl/matrix_utils/matrix_traits.hlsl> | ||
#include <nbl/builtin/hlsl/concepts.hlsl> |
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 on earth do you include concepts.hlsl twice, and whats with vectorSIMD.h
?
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.
vectorSIMD.h
is for c++ only, will fix it
template<typename T, int N> | ||
inline void setRotation(NBL_REF_ARG(matrix<T, N, 4>) outMat, NBL_CONST_REF_ARG(nbl::hlsl::quaternion<T>) quat) |
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.
actually this method could work for 3x3 and 4x3 matrix as well
Description
Testing
TODO list: