File tree 1 file changed +21
-2
lines changed
include/nbl/builtin/hlsl/cpp_compat/impl
1 file changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -908,8 +908,8 @@ struct fma_helper<T NBL_PARTIAL_REQ_BOT(VECTOR_SPECIALIZATION_CONCEPT) >
908
908
#endif
909
909
910
910
template<typename Vectorial>
911
- NBL_PARTIAL_REQ_TOP (DOT_HELPER_REQUIREMENT)
912
- struct dot_helper<Vectorial NBL_PARTIAL_REQ_BOT (DOT_HELPER_REQUIREMENT) >
911
+ NBL_PARTIAL_REQ_TOP (DOT_HELPER_REQUIREMENT && concepts::FloatingPoint<Vectorial> )
912
+ struct dot_helper<Vectorial NBL_PARTIAL_REQ_BOT (DOT_HELPER_REQUIREMENT && concepts::FloatingPoint<Vectorial> ) >
913
913
{
914
914
using scalar_type = typename vector_traits<Vectorial>::scalar_type;
915
915
@@ -926,6 +926,25 @@ struct dot_helper<Vectorial NBL_PARTIAL_REQ_BOT(DOT_HELPER_REQUIREMENT) >
926
926
}
927
927
};
928
928
929
+ template<typename Vectorial>
930
+ NBL_PARTIAL_REQ_TOP (DOT_HELPER_REQUIREMENT && !concepts::FloatingPoint<Vectorial>)
931
+ struct dot_helper<Vectorial NBL_PARTIAL_REQ_BOT (DOT_HELPER_REQUIREMENT && !concepts::FloatingPoint<Vectorial>) >
932
+ {
933
+ using scalar_type = typename vector_traits<Vectorial>::scalar_type;
934
+
935
+ static inline scalar_type __call (NBL_CONST_REF_ARG (Vectorial) lhs, NBL_CONST_REF_ARG (Vectorial) rhs)
936
+ {
937
+ static const uint32_t ArrayDim = vector_traits<Vectorial>::Dimension;
938
+ static array_get<Vectorial, scalar_type> getter;
939
+
940
+ scalar_type retval = getter (lhs, 0 ) * getter (rhs, 0 );
941
+ for (uint32_t i = 1 ; i < ArrayDim; ++i)
942
+ retval = retval + getter (lhs, i) * getter (rhs, i);
943
+
944
+ return retval;
945
+ }
946
+ };
947
+
929
948
#undef DOT_HELPER_REQUIREMENT
930
949
931
950
}
You can’t perform that action at this time.
0 commit comments