Skip to content

Commit 977b0cd

Browse files
author
devsh
committed
Use NBL_VALID_EXPRESSION, always_true is NOT a way to check the validity of an expression!
1 parent ece9310 commit 977b0cd

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ inline bool isinf_uint_impl(UnsignedInteger val)
4242
namespace impl
4343
{
4444
#ifndef __HLSL_VERSION
45-
template<typename T, typename U>
46-
NBL_BOOL_CONCEPT MixIsCallable = always_true<decltype(glm::mix(declval<T>(), declval<T>(), declval<U>()))>;
45+
NBL_VALID_EXPRESSION(MixIsCallable, (T)(U), glm::mix(declval<T>(),declval<T>(),declval<U>()));
4746
#endif
47+
4848
template<typename T, typename U>
4949
NBL_BOOL_CONCEPT MixCallingBuiltins =
5050
#ifdef __HLSL_VERSION

include/nbl/builtin/hlsl/spirv_intrinsics/glsl.std.450.hlsl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,7 @@ template<typename T NBL_FUNC_REQUIRES(concepts::FloatingPointVectorOrScalar<T>)
9595
[[vk::ext_instruction(GLSLstd450::GLSLstd450FMix, "GLSL.std.450")]]
9696
T fMix(T x, T y, T a);
9797

98-
template<typename T>
99-
NBL_BOOL_CONCEPT FMixIsCallable = always_true<decltype(spirv::fMix<T>(experimental::declval<T>(), experimental::declval<T>(), experimental::declval<T>()))>;
98+
NBL_VALID_EXPRESSION(FMixIsCallable, (T), spirv::fMix<T>(experimental::declval<T>(),experimental::declval<T>(),experimental::declval<T>()));
10099

101100
template<typename SquareMatrix NBL_FUNC_REQUIRES(matrix_traits<SquareMatrix>::Square)
102101
[[vk::ext_instruction(GLSLstd450::GLSLstd450Determinant, "GLSL.std.450")]]

0 commit comments

Comments
 (0)