Skip to content

Commit 0dbeb8f

Browse files
committed
Refactored intrinsics for C++ side
1 parent c1dff94 commit 0dbeb8f

File tree

9 files changed

+232
-174
lines changed

9 files changed

+232
-174
lines changed

include/nbl/builtin/hlsl/cpp_compat.hlsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
#include <nbl/builtin/hlsl/cpp_compat/basic.h>
55
// it includes vector and matrix
6-
#include <nbl/builtin/hlsl/cpp_compat/intrinsics.h>
6+
#include <nbl/builtin/hlsl/cpp_compat/intrinsics.hlsl>
77
#include <nbl/builtin/hlsl/cpp_compat/promote.hlsl>
88

99
#endif

include/nbl/builtin/hlsl/cpp_compat/basic.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,12 @@ namespace nbl::hlsl
5555

5656
// We need variadic macro in order to handle multi parameter templates because the
5757
// preprocessor parses the template parameters as different macro parameters.
58-
#define NBL_REF_ARG(...) typename nbl::hlsl::add_reference<__VA_ARGS__ >::type
59-
#define NBL_CONST_REF_ARG(...) typename nbl::hlsl::add_reference<std::add_const_t<__VA_ARGS__ >>::type
58+
#define NBL_REF_ARG(...) __VA_ARGS__&
59+
#define NBL_CONST_REF_ARG(...) const __VA_ARGS__&
60+
61+
// NOTE: implementation below will mess up template parameter deduction
62+
//#define NBL_REF_ARG(...) typename nbl::hlsl::add_reference<__VA_ARGS__ >::type
63+
//#define NBL_CONST_REF_ARG(...) typename nbl::hlsl::add_reference<std::add_const_t<__VA_ARGS__ >>::type
6064

6165
#else
6266

include/nbl/builtin/hlsl/cpp_compat/intrinsics.h

Lines changed: 0 additions & 144 deletions
This file was deleted.

0 commit comments

Comments
 (0)