Skip to content

Commit 04f1c76

Browse files
committed
adjust mix_helper calling select requirements
1 parent c353ab3 commit 04f1c76

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

include/nbl/builtin/hlsl/cpp_compat/impl/intrinsics_impl.hlsl

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -968,8 +968,19 @@ struct mix_helper<T, T NBL_PARTIAL_REQ_BOT(VECTOR_SPECIALIZATION_CONCEPT && !imp
968968
}
969969
};
970970

971-
template<typename T, typename U> NBL_PARTIAL_REQ_TOP((concepts::Vectorial<T> || concepts::Scalar<T>) && concepts::Boolean<U> && !impl::MixCallingBuiltins<T, U>)
972-
struct mix_helper<T, U NBL_PARTIAL_REQ_BOT((concepts::Vectorial<T> || concepts::Scalar<T>) && concepts::Boolean<U> && !impl::MixCallingBuiltins<T, U>) >
971+
namespace impl
972+
{
973+
template<typename T, typename U>
974+
NBL_BOOL_CONCEPT MixCallingSelect =
975+
#ifdef __HLSL_VERSION
976+
spirv::SelectIsCallable<T, U>;
977+
#else
978+
concepts::Boolean<U> && (concepts::Scalar<U> || (concepts::Vector<T> && vector_traits<T>::Dimension==vector_traits<U>::Dimension)) && !MixCallingBuiltins<T, U>;
979+
#endif
980+
}
981+
982+
template<typename T, typename U> NBL_PARTIAL_REQ_TOP(impl::MixCallingSelect<T, U>)
983+
struct mix_helper<T, U NBL_PARTIAL_REQ_BOT(impl::MixCallingSelect<T, U>) >
973984
{
974985
using return_t = T;
975986
static return_t __call(NBL_CONST_REF_ARG(T) x, NBL_CONST_REF_ARG(T) y, NBL_CONST_REF_ARG(U) a)

0 commit comments

Comments
 (0)